Vixen
02b45cc4
csharp
public struct NetworkRigidBody

The motion a networked body carries beside its transform.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Why velocity goes on the wire at all. A transform alone makes a remote body a puppet: the receiver has positions a tick apart and interpolates a straight line between them, so a thrown crate travels in flat segments instead of an arc, and a tumbling one stops tumbling between updates. Sending the velocity lets the receiver's own solver carry the body between updates, which is what makes it still look like physics.

Quantised harder than the position, deliberately. A velocity is only ever used to carry a body a fraction of a second, so an error of a centimetre a second moves it by nothing anybody can see — where the same error in a position is the position being wrong. Twelve bits over ±64 m/s is 3 cm/s, which is below what the interpolation contributes.

The rest flag is the bandwidth decision. Most objects in most scenes are asleep, and a body that has come to rest has a velocity of zero for ever after — so the flag says "stopped" once and the three velocity lanes go to their unchanged bit from then on. It is also what the receiver needs in order to stop integrating and let the body settle rather than creeping.

Fields and properties (3)

  • public Vector3 LinearVelocity

    How fast it is moving, in metres a second.

  • public Vector3 AngularVelocity

    How fast it is turning, in radians a second about each axis.

  • public bool IsResting

    Whether the body has come to rest and is not being integrated.

Used by (5)

  • NetworkRigidBodyCaptureSystemVixen.Net.Physics
  • NetworkRigidBodyCorrectionSystemVixen.Net.Physics
  • NetworkRigidBodyReplicatorVixen.Net.Physics
  • NetworkRigidBodyTestsVixen.Net.Physics.Tests
  • Vixen_Net_Physics_NetworkRigidBodySerializerVixen.Net.Physics