Repository navigation
A3D_CreateStaticObject
Create a physics object that never moves, shaped like the collision of a model.
Nothing is shown. Use it under an object created by the script.
native Physic:A3D_CreateStaticObject(
modelid,
Float:x,
Float:y,
Float:z,
Float:rx = 0.0,
Float:ry = 0.0,
Float:rz = 0.0,
worldid = -1
);| Parameter | Description | Default |
|---|---|---|
modelid |
Model whose collision gives the shape. | |
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 it collides in, or -1 for every world. |
-1 |
- The physics object.
-
INVALID_PHYSIC_IDwhen the model has no collision, or the world is full.
A static object keeps the exact collision of the model: its spheres, its boxes and its faces, each with its own surface. Physics objects bounce off it and the queries find it as A3D_HIT_STATIC, with the id of the static object.
Nothing is shown. Create the object players see yourself, at the same position and rotation, with CreateObject or CreateDynamicObject. The game knows nothing of the static object either, so players and vehicles do not collide with it unless the object they see has a collision of its own.
Use it for every object a script maps that physics objects or queries must meet, such as ramps, tables, walls and furniture. The map of the game is already in the component and needs nothing.
Maps a stunt ramp that balls roll up.
public OnGameModeInit() {
CreateObject(1634, 1700.0, -2470.0, 13.85, 0.0, 0.0, 0.0);
A3D_CreateStaticObject(1634, 1700.0, -2470.0, 13.85, 0.0, 0.0, 0.0);
return 1;
}-
A3D_CreateObject: Create a moving physics object shaped like the collision of a model, or as
models.jsondescribes the model. - A3D_CreateStaticBox: Create an invisible box that never moves, such as a wall or a floor.
-
A3D_RemoveBuilding: Remove the map objects of a model around a point, as
RemoveBuildingForPlayerdoes for what players see. - A3D_DestroyObject: Destroy a physics object, a static object or a zone, and the global object that shows 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