ColAndreas
From SA-MP Wiki
Description:
ColAndreas is a collision plugin that gives the server the ability to make collision checks using primarily raycasting. ColAndreas is built on the Bullet Physics engine http://bulletphysics.org/wordpress/
Contents |
Native Functions:
CA_Init
Description:
Initializes the collision world.
Parameters:(None)
Return Values:
1 successfully initialized 0 already loaded / fail to initialize
CA_RemoveBuilding
Description:
Remove a building from the world this function is used before calling CA_Init().
Parameters:(modelid, Float:x, Float:y, Float:z, Float:radius)
modelid | Model id of building to remove using -1 will remove all buildings in radius. |
x,y,z | Position to remove buildings from. |
radius | Radius to remove buildings from. |
Return Values:
1 on success, 0 on fail
CA_RayCastLine
Description:
Performs a ray cast from a start position to an end position and returns any collision point found.
Parameters:(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z)
StartX,StartY,StartZ | Start position of ray cast. |
EndX,EndY,EndZ | Endposition of ray cast. |
&x,&y,&z | Collision position is stored in these references. |
Return Values:
Modelid of collision (20000 is water) 0 is no collision
CA_RayCastLineMulti
Description:
Performs a ray cast from a start position to an end position and returns all collision points found in array.
Parameters:(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, Float:retx[], Float:rety[], Float:retz[], Float:retdist[], ModelIDs[], size)
StartX,StartY,StartZ | Start position of ray cast. |
EndX,EndY,EndZ | Endposition of ray cast. |
retx[],rety[],retz[] | Array to return found points of collision. |
retdist[] | Distance from start to point of collision. |
ModelIDs[] | Modelids of found collisions. |
size | Size of return array to use. |
Return Values:
1 collision found 0 is no collision
CA_RayCastLineAngle
Description:
Performs a ray cast from a start position to an end position and returns any collision point found include rotation of surface.
Parameters:(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:rx, &Float:ry, &Float:rz)
StartX,StartY,StartZ | Start position of ray cast. |
EndX,EndY,EndZ | Endposition of ray cast. |
&x,&y,&z | Collision position is stored in these references. |
&rx,&ry,&rz | Rotation of surface of collision. |
Return Values:
Modelid of collision (20000 is water) 0 is no collision
CA_RayCastReflectionVector
Description:
Performs a ray cast from a start position to an end position and returns any collision point found and vector of reflection.
Parameters:(Float:StartX, Float:StartY, Float:StartZ, Float:EndX, Float:EndY, Float:EndZ, &Float:x, &Float:y, &Float:z, &Float:nx, &Float:ny, &Float:nz)
StartX,StartY,StartZ | Start position of ray cast. |
EndX,EndY,EndZ | Endposition of ray cast. |
&x,&y,&z | Collision position is stored in these references. |
&nx,&ny,&nz | Reflection vector of collision. |
Return Values:
Modelid of collision (20000 is water) 0 is no collision