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.angularVelocity 角速度
var angularVelocity : Vector3
Description描述
The angular velocity vector of the rigidbody.
刚体的角速度向量。
In most cases you should not modify it directly, as this can result in unrealistic behaviour.
在大多数情况下,你不应该直接修改它,因为这会导致不真实的行为。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Material fastWheelMaterial;
public Material slowWheelMaterial;
void Update() {
if (rigidbody.angularVelocity.magnitude < 5)
renderer.sharedMaterial = slowWheelMaterial;
else
renderer.sharedMaterial = fastWheelMaterial;
}
}
// Change the material depending on the speed of rotation
//根据不同的旋转速度,改变这个材质
var fastWheelMaterial : Material;
var slowWheelMaterial : Material;
function Update () {
if (rigidbody.angularVelocity.magnitude < 5) {
renderer.sharedMaterial = slowWheelMaterial;
}
else {
renderer.sharedMaterial = fastWheelMaterial;
}
}
最后修改:2011年1月29日 Saturday 15:50