Repository navigation
A3D_SetSyncError
Set how far the object players see may stray from the body before a new move is sent.
It bounds the rotation too: the object may turn away from the body by the angle that moves its far end by that distance. Small objects that must look exact, such as pool balls, need a small value. Every update sent costs a packet for each player who sees the object.
native bool:A3D_SetSyncError(Physic:physicid, Float:error);| Parameter | Description |
|---|---|
Physic:physicid |
Physics object to change. |
Float:error |
Distance in metres. Starts at 3dandreas.sync_error. |
-
truewhen the distance was set. -
falsewhenphysicidis not a moving physics object, orerroris not positive.
The component works out where players see each object from the last move it sent. A new move is sent when that place strays from the body by more than this distance, when the rotation of the object turns its far end away by more than this distance, or when the last move has run its course while the body still moves. An object that falls asleep glides to where it rests in a tenth of a second. The default, 3dandreas.sync_error, is 0.1 metres, which suits objects a player does not watch closely. The balls of models.json take 0.03, and a pool ball needs about 0.02.
Each update reaches every player who sees the object, and a small error sends updates more often. A3D_GetStats counts them. See Physics objects.
stock Physic:CreateCueBall(Float:x, Float:y, Float:z) {
new Physic:ball = A3D_CreateSphere(3003, 0.04, x, y, z, 0.17);
A3D_SetSyncError(ball, 0.02);
return ball;
}- A3D_GetStats: What the component has done since the server started.
- A3D_AttachDynamicObject: Show a moving physics object with a streamer object instead of a global object.
3DAndreas 0.7.0 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions