Repository navigation
A3D_OverlapModel
imshooter edited this page Oct 18, 2026
·
2 revisions
Find everything a model would overlap at a position, such as before placing an object.
The model counts as the shape it moves with: the shape models.json gives it, or the convex hull of its collision, which covers the gaps of a hollow model.
native A3D_OverlapModel(
modelid,
Float:x,
Float:y,
Float:z,
Float:rx,
Float:ry,
Float:rz,
A3D_HIT:types[],
hitids[],
size = sizeof (hitids),
worldid = -1,
A3D_COLLIDE:flags = A3D_COLLIDE_ALL
);| Parameter | Description | Default |
|---|---|---|
modelid |
Model to place. | |
Float:x |
Position on the X axis. | |
Float:y |
Position on the Y axis. | |
Float:z |
Position on the Z axis. | |
Float:rx |
Rotation on the X axis. | |
Float:ry |
Rotation on the Y axis. | |
Float:rz |
Rotation on the Z axis. | |
A3D_HIT:types[] |
What each thing found is. | |
hitids[] |
What each thing found is, as the hitid of A3D_RayCast. |
|
size |
Room in each array. | sizeof (hitids) |
worldid |
Virtual world to look in, or -1 for every world. |
-1 |
A3D_COLLIDE:flags |
What may be found. | A3D_COLLIDE_ALL |
- The number of things written.
-
0when the model has no collision and no shape inmodels.json.
The model counts as the convex hull it moves with, which fills its hollows. A chair counts as the block around its legs, seat and back. The answer is exact for solid models and generous for hollow ones.
Lists what a piece of furniture would touch.
stock ListObstacles(playerid, modelid, Float:x, Float:y, Float:z, Float:angle) {
new
A3D_HIT:types[8],
hitids[8],
message[64],
count = A3D_OverlapModel(modelid, x, y, z, 0.0, 0.0, angle, types, hitids, .flags = A3D_COLLIDE_ALL & ~A3D_COLLIDE_MAP)
;
for (new i; i != count; ++i) {
format(message, sizeof (message), "In the way: type %i, id %i.", _:types[i], hitids[i]);
SendClientMessage(playerid, -1, message);
}
}- A3D_IsModelColliding: Whether a model would touch anything at a position.
- A3D_OverlapBox: Find everything a box overlaps, such as the room a vehicle or an object needs.
- A3D_CreateStaticObject: Create a physics object that never moves, shaped like the collision of a model.
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