Rigidbody
- AddExplosionForce
- AddForceAtPosition
- AddForce
- AddRelativeForce
- AddRelativeTorque
- AddTorque
- angularDrag
- angularVelocity
- centerOfMass
- ClosestPointOnBounds
- collisionDetectionMode
- detectCollisions
- drag
- freezeRotation
- GetPointVelocity
- GetRelativePointVelocity
- inertiaTensorRotation
- inertiaTensor
- interpolation
- isKinematic
- IsSleeping
- mass
- maxAngularVelocity
- MovePosition
- MoveRotation
- OnCollisionEnter
- OnCollisionExit
- OnCollisionStay
- position
- rotation
- SetDensity
- sleepAngularVelocity
- sleepVelocity
- Sleep
- solverIterationCount
- SweepTestAll
- SweepTest
- useConeFriction
- useGravity
- velocity
- WakeUp
- worldCenterOfMass
Rigidbody.GetRelativePointVelocity 获取相对点速度
function GetRelativePointVelocity (relativePoint : Vector3) : Vector3
Description描述
The velocity relative to the rigidbody at the point relativePoint.
相对于刚体在relativePoint点的速度。
GetRelativePointVelocity will take the angularVelocity of the rigidbody into account when calculating the velocity.
GetRelativePointVelocity在计算速度的时候将考虑刚体的角速度angularVelocity。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Vector3 point;
public Vector3 velocity;
public void Awake() {
point = transform.InverseTransformPoint(new Vector3(0, -0.2F, 0));
velocity = rigidbody.GetPointVelocity(point);
print(velocity.magnitude);
}
}
最后修改:2011年2月10日 Thursday 19:59