Photon Fusion
2.1.1
Class of useful helpers for the NetworkTransform. More...
Classes | |
| struct | NormalizedStallHeuristic |
Static Public Member Functions | |
| static void | ApplyCorrection (NetworkTransform nt, float physicsDt, float physicsFps, AbstractPhysicsBody physicsBody, float timeSinceLastOnCollisionEnter, ref KinematicSnapshot localSnapshot, ref KinematicSnapshot remoteSnapshot, ref KinematicSnapshot extrapolatedSnapshot) |
| Compute error between local and extrapolated kinematic snapshots and apply a correction. | |
| static void | ComputeExtrapolatedSnapshot (NetworkTransform nt, float physicsDt, AbstractPhysicsBody physicsBody, float ticksToExtrapolate, ref KinematicSnapshot local, ref KinematicSnapshot remote, out KinematicSnapshot result) |
Extrapolate with an explicit ticksToExtrapolate value. The passed ticksToExtrapolate is normally clamped to PhysicsSettings.MaxExtrapolationTime in ticks. | |
| static float | DefaultStalledErrorCorrectionDetection (NetworkTransform networkTransform, float physicsDt, AbstractPhysicsBody physicsBody, Vector3 previousLocalPosition, Vector3 previousExtrapolatedPosition, ref KinematicSnapshot localSnapshot, ref KinematicSnapshot extrapolatedSnapshot) |
| This is the default stall detection heuristic that the forecast physics uses. | |
Class of useful helpers for the NetworkTransform.
|
static |
This is the default stall detection heuristic that the forecast physics uses.
It carries out two checks
It then compares these values against the thresholds supplied in the PhysicsSettings on the network transform. Namely PhysicsSettings.HighErrorSimilarityThreshold and PhysicsSettings.LowCorrectionProgressThreshold
This default heuristic can be replaced with custom implementation by setting NetworkTransform.CustomErrorDetection on a NetworkTransform
Note: An alternative heuristic has been provided that works similarly to this but uses normalized vectors NormalizedStallHeuristic
| networkTransform | The network transform being checked |
| physicsDt | The timestep of the physics system |
| physicsBody | The physics body being forecasted |
| previousLocalPosition | The world space position captured last FixedUpdate |
| previousExtrapolatedPosition | The desired extrapolation position captured last FixedUpdate |
| localSnapshot | The local physics data for this object for this FixedUpdate |
| extrapolatedSnapshot | The desired extrapolated physics data for this object for this FixedUpdate |