Repository navigation
A3D_OverlapSphere
imshooter edited this page Oct 17, 2026
·
1 revision
Find everything a sphere overlaps.
native A3D_OverlapSphere(
Float:x,
Float:y,
Float:z,
Float:radius,
A3D_HIT:types[],
hitids[],
size = sizeof (hitids),
worldid = -1,
A3D_COLLIDE:flags = A3D_COLLIDE_ALL
);| Parameter | Description | Default |
|---|---|---|
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. | |
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.
Each body found is written once, in no particular order. A map object is written as its model, so two map objects of the same model both write that model. Players are found only on foot and zones never. See Hit types.
To find players, vehicles or actors near a point, A3D_GetPlayersInSphere and its siblings measure from their position and sort them by distance.
Counts the physics objects within two metres of a player.
stock CountObjectsAround(playerid) {
new
Float:x,
Float:y,
Float:z,
A3D_HIT:types[32],
hitids[32]
;
GetPlayerPos(playerid, x, y, z);
return A3D_OverlapSphere(x, y, z, 2.0, types, hitids, .worldid = GetPlayerVirtualWorld(playerid), .flags = A3D_COLLIDE_OBJECTS);
}- A3D_OverlapBox: Find everything a box overlaps, such as the room a vehicle or an object needs.
- A3D_OverlapModel: Find everything a model would overlap at a position, such as before placing an object.
- A3D_GetPlayersInSphere: Find the players within a distance of a point, nearest first.
- A3D_CreateExplosion: Push the moving physics objects around a point away from it.
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