Repository navigation
Collision Flags
The flags of A3D_COLLIDE pick the kinds of body a query sees and a moving object collides with.
| Flag | Value | Bodies |
|---|---|---|
A3D_COLLIDE_MAP |
1 |
The map objects of the game |
A3D_COLLIDE_OBJECTS |
2 |
Moving physics objects |
A3D_COLLIDE_STATIC |
4 |
Static objects |
A3D_COLLIDE_PLAYERS |
8 |
Players on foot |
A3D_COLLIDE_VEHICLES |
16 |
Vehicles |
A3D_COLLIDE_WATER |
32 |
The surface of the water, for queries only |
A3D_COLLIDE_ACTORS |
64 |
Actors |
A3D_COLLIDE_ALL |
95 |
Every kind of body, without the water |
Combine flags with | and take one out of a set with & ~:
new A3D_COLLIDE:sight = A3D_COLLIDE_MAP | A3D_COLLIDE_STATIC | A3D_COLLIDE_VEHICLES;
new A3D_COLLIDE:noPlayers = A3D_COLLIDE_ALL & ~A3D_COLLIDE_PLAYERS;
new A3D_COLLIDE:wet = A3D_COLLIDE_ALL | A3D_COLLIDE_WATER;Every query that takes flags sees only the bodies they name. Rays, sweeps and overlaps default to A3D_COLLIDE_ALL. A3D_IsLineOfSight and A3D_FindGround default to A3D_COLLIDE_MAP | A3D_COLLIDE_STATIC. With A3D_COLLIDE_WATER, rays, sweeps and lines of sight stop at the water. See World queries.
A3D_SetCollisions picks what a moving object collides with, A3D_COLLIDE_ALL by default. The water flag has no effect there, since objects float with A3D_SetBuoyancy instead. Two moving objects collide only when both hold A3D_COLLIDE_OBJECTS.
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