Repository navigation
A3D_SetRollingFriction
Slow a moving physics object down by a constant amount, as a ball rolling on cloth.
Only the speed along the ground is reduced. It adds to the friction and the damping.
native bool:A3D_SetRollingFriction(Physic:physicid, Float:deceleration);| Parameter | Description |
|---|---|
Physic:physicid |
Physics object to change. |
Float:deceleration |
Speed lost per second, in metres per second squared. Starts at 0.0. |
-
truewhen the friction was set. -
falsewhenphysicidis not a moving physics object, ordecelerationis negative.
The friction of a contact only resists sliding. A ball that rolls without slipping keeps rolling for ever unless something slows it down, and the damping slows fast balls far more than slow ones. A rolling friction takes the same speed every second, as a ball on cloth or grass that rolls a while and then stops.
Only the speed along the ground is reduced, and the spin with it. It also acts while the object flies, so it suits objects that stay on the ground.
A pool ball that stops after a few seconds of rolling.
stock Physic:CreatePoolBall(modelid, Float:x, Float:y, Float:z) {
new Physic:ball = A3D_CreateSphere(modelid, 0.04, x, y, z, 0.17);
A3D_SetRollingFriction(ball, 0.3);
A3D_SetPlanar(ball);
A3D_SetSyncError(ball, 0.02);
return ball;
}- A3D_SetFriction: Set how much a physics object grips what it touches.
- A3D_SetDamping: Set how fast a moving physics object loses speed and spin on its own.
- A3D_SetPlanar: Keep a moving physics object at its height, so it only moves along the ground.
3DAndreas 0.7.1 · 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