Repository navigation
A3D_GetModelBoundingSphere
imshooter edited this page Oct 17, 2026
·
1 revision
Find the sphere that holds a model, around its position.
native bool:A3D_GetModelBoundingSphere(modelid, &Float:x, &Float:y, &Float:z, &Float:radius);| Parameter | Description |
|---|---|
modelid |
Model to read. |
&Float:x |
Centre on the X axis. |
&Float:y |
Centre on the Y axis. |
&Float:z |
Centre on the Z axis. |
&Float:radius |
Radius of the sphere. |
-
truewhen the sphere was written. -
falsewhen the database does not know the model.
The centre is an offset from the origin of the model, as for A3D_GetModelBoundingBox. The sphere holds the whole model, so for a round model its radius suits A3D_CreateSphere.
stock Physic:CreateModelSphere(modelid, Float:x, Float:y, Float:z, Float:mass) {
new
Float:centreX,
Float:centreY,
Float:centreZ,
Float:radius
;
if (!A3D_GetModelBoundingSphere(modelid, centreX, centreY, centreZ, radius)) {
return INVALID_PHYSIC_ID;
}
return A3D_CreateSphere(modelid, radius, x, y, z, mass);
}- A3D_GetModelBoundingBox: Find the box that holds a model, around its position.
- A3D_CreateSphere: Create a moving physics object shaped like a sphere.
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