public struct NetworkRigidBodyCorrectionHow a receiving peer is allowed to correct a body it does not own.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The whole design in one component. A remote body is simulated locally from the velocity it was last sent, so it drifts from the authority — and the question is what to do about the difference. Snapping it every update is what makes networked physics look like a slideshow. What this does instead is push the body toward the authoritative pose through the solver, as a critically damped spring, so it arrives smoothly and collides correctly on the way.
Critically damped because the alternatives are both wrong: underdamped overshoots and the crate wobbles around where it should be; overdamped never quite arrives and the crate is permanently slightly behind. Critical damping is the one that converges fastest without passing the target, and it is the reason PositionStrength is expressed as a frequency rather than as a fudge factor.
And a spring cannot fix everything, which is what the snap thresholds are for. A body that respawned across the level, or one whose owner was disconnected for a second, is not off by a spring's worth — pulling it there would take seconds and drag it through every wall on the way. Past HardSnapDistance it is teleported, and that is the honest answer rather than a failure of the smoothing.
Fields and properties (5)
public float PositionStrengthHow hard position error is corrected, as the natural frequency of a critically damped spring, in radians a second.
public float RotationStrengthThe same, for rotation.
public float HardSnapDistancePast this much position error, the body is teleported rather than pulled.
public float HardSnapAnglePast this much rotation error, in radians, the body is snapped rather than pulled.
public static NetworkRigidBodyCorrection DefaultWhat a body's correction looks like out of the box.
Used by (3)
- NetworkRigidBodyCorrectionSystemVixen.Net.Physics
- NetworkRigidBodyTestsVixen.Net.Physics.Tests
- Vixen_Net_Physics_NetworkRigidBodyCorrectionSerializerVixen.Net.Physics