| Pub.ColDet: | Functions | Types | Modinfo | Source |
| Function SphereRayCollision:Int(center:Float Ptr,radius:Float,origin:Float Ptr,direction:Float Ptr,point:Float Ptr) | |
| Returns | True if collision. |
| Description | Checks for intersection between a ray and a sphere. |
| Information | Center, radius define the sphere origin Direction defines the ray Point will contain point of intersection, if one is found. |
| Function SphereSphereCollision:Int(center1:Float Ptr,radius1:Float,center2:Float Ptr,radius2:Float,point:Float Ptr) | |
| Returns | True if collision. |
| Description | Checks for intersection between 2 spheres. |
| Information | Point will contain the point of collision if one is found. |
| Type TCollisionModel3D | |
| Description | Collision Model. |
| Information | Represents the mesh to be tested for collisions. It has to be notified of all triangles, via addTriangle(). After all triangles are added, a call to finalize() will process the information and prepare for collision tests. Call collision() to check for a collision. Note: Transformations must not contain scaling. |
| Method addTriangle(x1:Float,y1:Float,z1:Float,x2:Float,y2:Float,z2:Float,x3:Float,y3:Float,z3:Float) | |
| Description | Adds the coordinates of one of the model's triangles. |
| Method collision:Int(other:TCollisionModel3D,AccuracyDepth:Int=-1,MaxProcessingTime:Int=0,other_transform:Float Ptr=Null) | |
| Returns | True if a collision occurred. |
| Description | Check For collision with another model. |
| Information |
|
| Method finalize() | |
| Description | All triangles have been added, process model. |
| Method getCollidingTriangles:Int(t1:Float Ptr,t2:Float Ptr,bModelSpace:Int=True) ' tri1[9], tri2[9] | |
| Returns | True if triangles were returned. |
| Description | Retrieve the pair of triangles that collided. |
| Information | Only valid after a call To collision() that returned true. t1 is this model's triangle and t2 is the other one. In case of ray or sphere collision, only t1 will be valid. The coordinates will be in _this_ model's coordinate space, unless ModelSpace is false, in which case, coordinates will be transformed by the model's current transform to world space. |
| Method getCollisionPoint:Int(point:Float Ptr,bModelSpace:Int=True) ' point[3] | |
| Returns | True if a point was returned. |
| Description | Retrieve the detected collision point. |
| Information | Only valid after a call To collision() that returned true. The coordinates will be in _this_ model's coordinate space, unless ModelSpace is false, in which case, coordinates will be transformed by the model's current transform to world space. |
| Method rayCollision:Int(origin:Float Ptr,direction:Float Ptr,bClosest:Int=False,segmin:Float=0.0,segmax:Float=3.4e+38) ' origin[3], direction[3] | |
| Returns | True if a collision occurred. |
| Description | Check For collision with the ray given in world space coordinates. |
| Information | getCollidingTriangles() And getCollisionPoint() can be used To retrieve information about a collision. If closest If False, the first triangle that collides with the ray is used. Otherwise the closest one will be used. Closest triangle searching will slow the test considerably. The Default ray is a standard infinite ray. However, using segmin And segmax you can define a line segment along the ray. |
| Method SetTransform(matrix:Float Ptr) ' matrix[16] | |
| Description | The the current affine matrix For the model. |
| Information | The matrices used to describe model transformations are affine 4x4 matrices which are D3D style, row major with translations in the 4th row. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 The translation vector Tx,Ty,Tz is in elements 13,14,15 If you use the transposed scheme, which is: 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 With the translation vector in elements 13,14,15 you can use this matrix without any conversion. It is also important to note that the transformations should include no scaling, as it disrupts the consistency of the collision model. |
| Method setTriangleNumber(num:Int) | |
| Description | Optional: Optimization For construction speed if you know the number of triangles. |
| Method sphereCollision:Int(origin:Float Ptr,radius:Float) ' origin[3] | |
| Returns | True if a collision occurred. |
| Description | Check For collision with the given sphere. |
| Information | getCollidingTriangles() And getCollisionPoint() can be used To retrieve information about a collision. |
| Name | Pub.ColDet |
|---|---|
| Version | 1.01 |
| Description | ColDet collision library wrapper |
| License | Public Domain |
| Author | gman |
| Credit | PhotonEffect, author of ColDet. http://www.photoneffect.com/coldet/ |
| History | 2006/7/14 - Initial Release |
| History | 2006/7/14 - Migrated to a DLL |