获取关节体在全局空间中指定 worldPoint
处的速度。
GetPointVelocity 在计算速度时会考虑关节体的角速度。
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public ArticulationBody ab;
void Start() { ab = GetComponent<ArticulationBody>(); }
// Get the velocity of a wheel, specified by its position in local space. Vector3 CalcWheelVelocity(Vector3 localWheelPos) { return ab.GetPointVelocity(transform.TransformPoint(localWheelPos)); } }