Repository navigation
A3D_GetModelBoundingBox
imshooter edited this page Oct 17, 2026
·
1 revision
Find the box that holds a model, around its position.
Models without collision, such as plants, still have the box the game gives them.
native bool:A3D_GetModelBoundingBox(
modelid,
&Float:minX,
&Float:minY,
&Float:minZ,
&Float:maxX,
&Float:maxY,
&Float:maxZ
);| Parameter | Description |
|---|---|
modelid |
Model to read. |
&Float:minX |
Lowest corner on the X axis. |
&Float:minY |
Lowest corner on the Y axis. |
&Float:minZ |
Lowest corner on the Z axis. |
&Float:maxX |
Highest corner on the X axis. |
&Float:maxY |
Highest corner on the Y axis. |
&Float:maxZ |
Highest corner on the Z axis. |
-
truewhen the box was written. -
falsewhen the database does not know the model.
The corners are offsets from the origin of the model, as if it stood at 0.0, 0.0, 0.0 without rotation. minZ is how far the model reaches under its origin, which is what a script needs to rest it on the ground.
The database knows every model of the game and the models SA-MP adds. Models with no collision, such as most plants, still have the box the game gives them.
Stacks a model on top of another of the same kind.
stock StackModel(modelid, Float:x, Float:y, Float:z) {
new
Float:minX,
Float:minY,
Float:minZ,
Float:maxX,
Float:maxY,
Float:maxZ
;
if (!A3D_GetModelBoundingBox(modelid, minX, minY, minZ, maxX, maxY, maxZ)) {
return INVALID_OBJECT_ID;
}
return CreateObject(modelid, x, y, z + maxZ - minZ, 0.0, 0.0, 0.0);
}- A3D_GetModelBoundingSphere: Find the sphere that holds a model, around its position.
- A3D_CreateBox: Create a moving physics object shaped like a box.
- A3D_FindGround: Find the ground under a point.
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