Skip to content

A3D_GetRotation

imshooter edited this page Oct 17, 2026 · 1 revision

The rotation of a physics object, as an object rotation.

native bool:A3D_GetRotation(Physic:physicid, &Float:rx, &Float:ry, &Float:rz);

Parameters

Parameter Description
Physic:physicid Physics object to read.
&Float:rx Rotation on the X axis.
&Float:ry Rotation on the Y axis.
&Float:rz Rotation on the Z axis.

Returns

  • true when the rotation was written.
  • false when physicid is not a physics object.

Remarks

The angles may differ from the ones given to A3D_SetRotation and still describe the same rotation, since several sets of angles turn an object the same way.

Example

Tells whether a crate fell on its side.

stock bool:HasTippedOver(Physic:crate) {
    new
        Float:rx,
        Float:ry,
        Float:rz
    ;

    if (!A3D_GetRotation(crate, rx, ry, rz)) {
        return false;
    }

    return floatcos(rx, degrees) * floatcos(ry, degrees) < 0.5;
}

Related

  • A3D_SetRotation: Turn a physics object to a new rotation at once.
  • A3D_EulerToQuaternion: Turn the rotation of an object into a quaternion, in the order of GetVehicleRotationQuat.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally