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.SetDensity 设置密度
function SetDensity (density : float) : void
Description描述
Sets the mass based on the attached colliders assuming a constant density.
基于附加的碰撞器假设一个固定的密度设置质量。
This is useful to set the mass to a value which scales with the size of the colliders.
这个可以用来设置质量,随着碰撞器的尺寸而缩放。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public void Awake() {
rigidbody.SetDensity(1.5F);
}
}
rigidbody.SetDensity(1.5);
最后修改:2011年2月9日 Wednesday 20:32