Repository navigation
A3D_IsModelColliding
imshooter edited this page Oct 18, 2026
·
2 revisions
Whether a model would touch anything at a position.
Stops at the first thing found, so it is cheaper than A3D_OverlapModel. The model counts as the shape it moves with, like in A3D_OverlapModel.
native bool:A3D_IsModelColliding(
modelid,
Float:x,
Float:y,
Float:z,
Float:rx = 0.0,
Float:ry = 0.0,
Float:rz = 0.0,
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. | 0.0 |
Float:ry |
Rotation on the Y axis. | 0.0 |
Float:rz |
Rotation on the Z axis. | 0.0 |
worldid |
Virtual world to look in, or -1 for every world. |
-1 |
A3D_COLLIDE:flags |
What may be touched. | A3D_COLLIDE_ALL |
-
truewhen it would touch something. -
falsewhen the place is free, or the model has no collision and no shape inmodels.json.
The model counts as its convex hull, as in A3D_OverlapModel. A model that rests on the ground touches it, so lift it a few centimetres or leave A3D_COLLIDE_MAP out of the flags.
The answer comes at the first thing found, which makes it the cheap test before placing something. A test costs about two microseconds.
Refuses to place furniture inside other furniture or a vehicle.
stock bool:CanPlaceFurniture(modelid, Float:x, Float:y, Float:z, Float:angle, worldid) {
return !A3D_IsModelColliding(modelid, x, y, z + 0.02, 0.0, 0.0, angle, worldid, A3D_COLLIDE_STATIC | A3D_COLLIDE_VEHICLES | A3D_COLLIDE_OBJECTS);
}- A3D_OverlapModel: Find everything a model would overlap at a position, such as before placing an object.
- A3D_FindRandomPoint: Find a random spot on the ground around a point where something fits, such as a spawn or a dropped item.
- 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