Repository navigation
A3D_ApplyImpulse
imshooter edited this page Oct 17, 2026
·
1 revision
Push a moving physics object through its centre of mass.
native bool:A3D_ApplyImpulse(Physic:physicid, Float:x, Float:y, Float:z);| Parameter | Description |
|---|---|
Physic:physicid |
Physics object to push. |
Float:x |
Impulse on the X axis, in kilograms times metres per second. |
Float:y |
Impulse on the Y axis. |
Float:z |
Impulse on the Z axis. |
-
truewhen the impulse was applied. -
falsewhenphysicidis not a moving physics object.
An impulse changes the velocity by the impulse divided by the mass, so the same push throws a light ball far and barely moves a heavy crate. An impulse of 10.0 gives a ball of half a kilogram 20 metres per second and a crate of 20 kilograms half a metre per second.
The push goes through the centre of mass, so it adds no spin. It wakes the object.
A punch that pushes whatever object it hits.
stock Punch(playerid, Physic:physicid) {
new
Float:angle
;
GetPlayerFacingAngle(playerid, angle);
A3D_ApplyImpulse(physicid, -floatsin(angle, degrees) * 40.0, floatcos(angle, degrees) * 40.0, 10.0);
}- A3D_SetVelocity: Set the velocity of a moving physics object and wake it up.
- A3D_SetAcceleration: Push a moving physics object with a constant acceleration until it is set to zero.
- A3D_CreateExplosion: Push the moving physics objects around a point away from it.
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