Version: 2017.1

Rigidbody.GetRelativePointVelocity

切换到手册
public Vector3 GetRelativePointVelocity (Vector3 relativePoint);

描述

相对于点 relativePoint 处的刚体的速度。

计算速度时,GetRelativePointVelocity 会考虑到刚体的 angularVelocity。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Rigidbody rb; void Start() { rb = GetComponent<Rigidbody>(); } Vector3 CalcWheelVelocity(Vector3 localWheelPos) { return rb.GetRelativePointVelocity(localWheelPos); } }