Repository navigation
A3D_IsLineOfSight
imshooter edited this page Oct 17, 2026
·
1 revision
Whether nothing stands between two points.
Stops at the first thing found, so it is cheaper than A3D_RayCast.
native bool:A3D_IsLineOfSight(
Float:x1,
Float:y1,
Float:z1,
Float:x2,
Float:y2,
Float:z2,
worldid = -1,
A3D_COLLIDE:flags = A3D_COLLIDE_MAP | A3D_COLLIDE_STATIC
);| Parameter | Description | Default |
|---|---|---|
Float:x1 |
First point on the X axis. | |
Float:y1 |
First point on the Y axis. | |
Float:z1 |
First point on the Z axis. | |
Float:x2 |
Second point on the X axis. | |
Float:y2 |
Second point on the Y axis. | |
Float:z2 |
Second point on the Z axis. | |
worldid |
Virtual world to look in, or -1 for every world. |
-1 |
A3D_COLLIDE:flags |
What blocks the sight, the map and static objects by default. | `A3D_COLLIDE_MAP |
-
truewhen the points see each other. -
falsewhen something stands between them.
Only the map and static objects block the sight by default, since a player or a vehicle in the way rarely hides someone for long. Other flags add them. With A3D_COLLIDE_WATER, the surface of the water blocks too, so a diver does not see the shore.
The query stops at the first thing it meets and skips working out the point, which makes it cheaper than A3D_RayCast.
Tells whether a guard actor sees a player, from eye to eye.
stock bool:DoesGuardSee(actorid, playerid) {
new
Float:guardX,
Float:guardY,
Float:guardZ,
Float:x,
Float:y,
Float:z
;
GetActorPos(actorid, guardX, guardY, guardZ);
GetPlayerPos(playerid, x, y, z);
return A3D_IsLineOfSight(guardX, guardY, guardZ + 0.7, x, y, z + 0.7, GetPlayerVirtualWorld(playerid));
}- A3D_RayCast: Find the first thing a segment between two points hits.
- A3D_GetPlayersInCone: Find the players inside a cone, such as the view of a guard or the spread of a shotgun, nearest first.
- A3D_IsPointOnScreen: Whether a point shows on the screen of a player.
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