Photon Fusion
2.1.1
Public Member Functions | |
| NormalizedStallHeuristic (float minimumLinearError=0.01f, float directionSimilarityThreshold=0.95f, float correctionFractionThreshold=0.05f, float errorRatioThreshold=0.95f) | |
| float | StalledErrorCorrectionDetection (NetworkTransform networkTransform, float physicsDt, AbstractPhysicsBody physicsBody, Vector3 previousLocalPosition, Vector3 previousExtrapolatedPosition, ref KinematicSnapshot localSnapshot, ref KinematicSnapshot extrapolatedSnapshot) |
| Implements the NetworkTransform.CustomErrorDetectionDelegate so it can be provided as a error detection heuristic for use on forecasted NetworkTransforms. | |
Error detection heuristic that detects persistent stuck states. differs from the standard implementation in that it is normalized and time-step independent and tuned via 3 fractional or precentage based thresholds
Evaluates three conditions:
When all three indicate a problem (consistent error direction, no progress, error not shrinking), returns a positive score indicating error. Otherwise returns a negative score indicating healthy correction.
| NormalizedStallHeuristic | ( | float | minimumLinearError = 0::01f, |
| float | directionSimilarityThreshold = 0::95f, | ||
| float | correctionFractionThreshold = 0::05f, | ||
| float | errorRatioThreshold = 0::95f ) |
Constructs a NormalizedStallHeuristic
Once an instance has been made the NormalizedStallHeuristic.Delegate property can be assigned to the NetworkTransform.CustomErrorDetection delegate on a network transform to override the default stall heurstics algorithm used
| minimumLinearError | Error distances below this value will return -1f, the error is too small to care |
| directionSimilarityThreshold | What proportion of the error from the previous frame needs to match this frame to be considered stalled? |
| correctionFractionThreshold | What proportion of last frames error needs to have been corrected this frame to be considered not stalled? |
| errorRatioThreshold | How much does this frames error need to have shrunk by, compared with last frames error to not be considered stalled? |
| float StalledErrorCorrectionDetection | ( | NetworkTransform | networkTransform, |
| float | physicsDt, | ||
| AbstractPhysicsBody | physicsBody, | ||
| Vector3 | previousLocalPosition, | ||
| Vector3 | previousExtrapolatedPosition, | ||
| ref KinematicSnapshot | localSnapshot, | ||
| ref KinematicSnapshot | extrapolatedSnapshot ) |
Implements the NetworkTransform.CustomErrorDetectionDelegate so it can be provided as a error detection heuristic for use on forecasted NetworkTransforms.
| networkTransform | The NetworkTransform being acted on |
| physicsDt | The physics timstep - seconds |
| physicsBody | The PhysicsBody being actted on |
| previousLocalPosition | The local position of the object captured last FixedUpdate |
| previousExtrapolatedPosition | The extrapolated position of the object captured Last FixedUpdate |
| localSnapshot | The local physics snapshot for this FixedUpdate |
| extrapolatedSnapshot | The extrapolated physics snapshot for this FixedUpdate |