Skip to content

Coming from ColAndreas

imshooter edited this page Oct 17, 2026 · 1 revision

3DAndreas answers the questions ColAndreas answers, faster and with less memory, and adds physics, water, surfaces, players, vehicles and actors. See Performance for the numbers. No code of ColAndreas is used. The component only reads its database as a fallback.

What changes

  • No start up call. The map is ready when the server starts. There is no CA_Init.
  • Answers. ColAndreas returns the model hit, or 0 for nothing. 3DAndreas returns true or false and gives what was hit in type and hitid, with the surface in material. See Hit types.
  • Water. ColAndreas stops rays at the water as if it were a solid model, 20000. 3DAndreas lets rays reach the bottom unless A3D_COLLIDE_WATER is in their flags, and then reports A3D_HIT_WATER.
  • Building removal. CA_RemoveBuilding works before CA_Init only and for every world. A3D_RemoveBuilding works at any time, for every world or for one, and can be undone.
  • Players, vehicles and actors. ColAndreas does not see them. 3DAndreas does, unless the flags of a query leave them out.
  • Quaternions. CA_EulerToQuat writes w last. A3D_EulerToQuaternion writes it first, as GetVehicleRotationQuat does.
  • Models. The database holds the models of the game and those SA-MP adds. Models added by the server are not in it, and there is no CA_LoadFromDff.

Heights match. With water stopping the rays, 113 of 120 vertical rays across the map give the same height as ColAndreas and the other 7 lie within 5 mm.

Function by function

ColAndreas 3DAndreas
CA_Init Nothing to call.
CA_RemoveBuilding A3D_RemoveBuilding
CA_RestoreBuilding A3D_RestoreBuilding
CA_RayCastLine A3D_RayCast, with A3D_COLLIDE_MAP and A3D_COLLIDE_WATER for the same answers. The model is hitid when type is A3D_HIT_MAP.
CA_RayCastLineID A3D_RayCast. The static object is hitid when type is A3D_HIT_STATIC.
CA_RayCastLineExtraID A3D_RayCast, then A3D_GetExtra on the object hit.
CA_RayCastMultiLine A3D_RayCastAll. The distances come from the points.
CA_RayCastLineNormal A3D_RayCastNormal
CA_RayCastLineAngle A3D_RayCastNormal, then A3D_GetSurfaceRotation.
CA_RayCastReflectionVector A3D_RayCastNormal, then A3D_GetReflection.
CA_RayCastLineEx, CA_RayCastLineAngleEx A3D_RayCastNormal, then A3D_GetPosition and A3D_GetRotation of the static object hit.
CA_ContactTest A3D_IsModelColliding. The model counts as its convex hull.
CA_EulerToQuat, CA_QuatToEuler A3D_EulerToQuaternion, A3D_QuaternionToEuler, with w first.
CA_GetModelBoundingSphere, CA_GetModelBoundingBox A3D_GetModelBoundingSphere, A3D_GetModelBoundingBox
CA_SetObjectExtraID, CA_GetObjectExtraID A3D_SetExtra, A3D_GetExtra, with eight slots.
CA_CreateObject A3D_CreateStaticObject
CA_DestroyObject A3D_DestroyObject
CA_IsValidObject A3D_IsValidObject
CA_SetObjectPos, CA_SetObjectRot A3D_SetPosition, A3D_SetRotation
CA_CreateObject_DC and the other _DC stocks CreateDynamicObject and A3D_CreateStaticObject at the same place.
CA_LoadFromDff None.
CA_FindZ_For2DCoord A3D_FindGround from 700.0 with a depth of 1700.0.
CA_IsPlayerOnSurface A3D_FindGround under the player, compared with their height.
CA_IsPlayerInWater A3D_IsPointInWater at the position of the player.
CA_IsPlayerNearWater, CA_IsPlayerFacingWater A3D_RayCast with A3D_COLLIDE_WATER, around or ahead of the player.
CA_IsPlayerBlocked A3D_SweepSphere ahead of the player.
CA_GetRoomHeight A3D_RayCast up and A3D_FindGround down.
CA_RayCastExplode, CA_GetRoomCenter A loop of A3D_RayCast.
CA_RemoveBarriers, CA_RemoveBreakableBuildings A3D_RemoveBuilding for each model.

A ColAndreas database

A server that has only scriptfiles/colandreas/ColAndreas.cadb still starts, and the component reads that file when world.db is missing. Hits then carry no surface and there is no water. Map database tells how to build world.db.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Callbacks

Clone this wiki locally