ColAndreas

From SA-MP Wiki

Jump to: navigation, search

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)
modelidModel id of building to remove using -1 will remove all buildings in radius.
x,y,zPosition to remove buildings from.
radiusRadius 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,StartZStart position of ray cast.
EndX,EndY,EndZEndposition of ray cast.
&x,&y,&zCollision 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,StartZStart position of ray cast.
EndX,EndY,EndZEndposition 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.
sizeSize 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,StartZStart position of ray cast.
EndX,EndY,EndZEndposition of ray cast.
&x,&y,&zCollision position is stored in these references.
&rx,&ry,&rzRotation 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,StartZStart position of ray cast.
EndX,EndY,EndZEndposition of ray cast.
&x,&y,&zCollision position is stored in these references.
&nx,&ny,&nzReflection vector of collision.

Return Values:

Modelid of collision (20000 is water) 0 is no collision
Personal tools
Navigation
Toolbox