NodeWorld

Rigidbody

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public sealed class Rigidbody : Component

Namespace NodeWorld.Flux.

A Rigidbody of the world: its physics runs on each player's game. The server has none.

Properties

velocity

csharp
public Vector3 velocity { get; set; }

Velocity, in m/s.

angularVelocity

csharp
public Vector3 angularVelocity { get; set; }

Spin, in radians per second.

mass

csharp
public float mass { get; set; }

Mass, in kg, above 0.

isKinematic

csharp
public bool isKinematic { get; set; }

Moved by scripts and animation only: forces and collisions do not move it.

useGravity

csharp
public bool useGravity { get; set; }

Gravity pulls the body.

detectCollisions

csharp
public bool detectCollisions { get; set; }

The body collides (false: it goes through everything).

constraints

csharp
public RigidbodyConstraints constraints { get; set; }

The positions and rotations the physics may not change.

interpolation

csharp
public RigidbodyInterpolation interpolation { get; set; }

How the body is drawn between physics steps.

linearDamping

csharp
public float linearDamping { get; set; }

Drag on its velocity.

angularDamping

csharp
public float angularDamping { get; set; }

Drag on its spin.

maxAngularVelocity

csharp
public float maxAngularVelocity { get; set; }

The fastest the body may spin (rad/s).

centerOfMass

csharp
public Vector3 centerOfMass { get; set; }

Center of mass, in the object's space.

Methods

AddForce

csharp
public void AddForce(Vector3 force, ForceMode mode = ForceMode.Force)

Adds a force, applied as mode says.

MovePosition

csharp
public void MovePosition(Vector3 position)

Moves the body to position at the next physics step, as Unity's MovePosition.

MoveRotation

csharp
public void MoveRotation(Quaternion rotation)

Turns the body to rotation at the next physics step, as Unity's MoveRotation.

AddTorque

csharp
public void AddTorque(Vector3 torque, ForceMode mode = ForceMode.Force)

Adds a torque, applied as mode says.

AddForceAtPosition

csharp
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

csharp
public void Sleep()

Puts the body to sleep.

WakeUp

csharp
public void WakeUp()

Wakes the body up.

IsSleeping

csharp
public bool IsSleeping()

The body sleeps: the physics leaves it still until something wakes it.