Rigidbody
La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.
public sealed class Rigidbody : ComponentNamespace NodeWorld.Flux.
A Rigidbody of the world: its physics runs on each player's game. The server has none.
Properties
velocity
public Vector3 velocity { get; set; }Velocity, in m/s.
angularVelocity
public Vector3 angularVelocity { get; set; }Spin, in radians per second.
mass
public float mass { get; set; }Mass, in kg, above 0.
isKinematic
public bool isKinematic { get; set; }Moved by scripts and animation only: forces and collisions do not move it.
useGravity
public bool useGravity { get; set; }Gravity pulls the body.
detectCollisions
public bool detectCollisions { get; set; }The body collides (false: it goes through everything).
constraints
public RigidbodyConstraints constraints { get; set; }The positions and rotations the physics may not change.
interpolation
public RigidbodyInterpolation interpolation { get; set; }How the body is drawn between physics steps.
linearDamping
public float linearDamping { get; set; }Drag on its velocity.
angularDamping
public float angularDamping { get; set; }Drag on its spin.
maxAngularVelocity
public float maxAngularVelocity { get; set; }The fastest the body may spin (rad/s).
centerOfMass
public Vector3 centerOfMass { get; set; }Center of mass, in the object's space.
Methods
AddForce
public void AddForce(Vector3 force, ForceMode mode = ForceMode.Force)Adds a force, applied as mode says.
MovePosition
public void MovePosition(Vector3 position)Moves the body to position at the next physics step, as Unity's MovePosition.
MoveRotation
public void MoveRotation(Quaternion rotation)Turns the body to rotation at the next physics step, as Unity's MoveRotation.
AddTorque
public void AddTorque(Vector3 torque, ForceMode mode = ForceMode.Force)Adds a torque, applied as mode says.
AddForceAtPosition
public void AddForceAtPosition(Vector3 force, Vector3 position, ForceMode mode = ForceMode.Force)Adds a force at a point of the world: it pushes and turns the body.
Sleep
public void Sleep()Puts the body to sleep.
WakeUp
public void WakeUp()Wakes the body up.
IsSleeping
public bool IsSleeping()The body sleeps: the physics leaves it still until something wakes it.
