#include <coldet.h>
Inheritance diagram for CollisionModel3D:
Public Methods | |
virtual | ~CollisionModel3D () |
virtual void | setTriangleNumber (int num) = 0 |
virtual void | addTriangle (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3) = 0 |
virtual void | addTriangle (float v1[3], float v2[3], float v3[3]) = 0 |
virtual void | finalize () = 0 |
virtual void | setTransform (float m[16]) = 0 |
virtual bool | collision (CollisionModel3D* other, int AccuracyDepth=-1, int MaxProcessingTime=0, float* other_transform=0) = 0 |
virtual bool | rayCollision (float origin[3], float direction[3], bool closest=false, float segmin=0.0f, float segmax=3.4e+38F) = 0 |
virtual bool | sphereCollision (float origin[3], float radius) = 0 |
virtual bool | getCollidingTriangles (float t1[9], float t2[9], bool ModelSpace=true) = 0 |
virtual bool | getCollidingTriangles (int& t1, int& t2) = 0 |
virtual bool | getCollisionPoint (float p[3], bool ModelSpace=true) = 0 |
Note: Transformations must not contain scaling.
|
|
|
Reimplemented in CollisionModel3DImpl. |
|
Use any of the forms of this functions to enter the coordinates of the model's triangles. Reimplemented in CollisionModel3DImpl. |
|
Check for collision with another model. Do not mix model types here. MaxProcessingTime determines the maximum time in milliseconds to check for collision. If a rejection is not found by that time, the function will return true. AccuracyDepth is not yet supported. other_transform allows overriding the other model's transform, by supplying an alternative one. This can be useful when testing a model against itself with different orientations. Reimplemented in CollisionModel3DImpl. |
|
All triangles have been added, process model. Reimplemented in CollisionModel3DImpl. |
|
Retrieve the pair of triangles indices that collided. Only valid after a call to collision() that returned true. t1 belongs to _this_ model, while t2 is in the other one. Reimplemented in CollisionModel3DImpl. |
|
Retrieve the pair of triangles that collided. 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. Reimplemented in CollisionModel3DImpl. |
|
Retrieve the detected collision point. 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. Reimplemented in CollisionModel3DImpl. |
|
Returns true if the ray given in world space coordinates intersects with the object. 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. Reimplemented in CollisionModel3DImpl. |
|
The the current affine matrix for the model. See transform.txt for format information Reimplemented in CollisionModel3DImpl. |
|
Optional: Optimization for construction speed. If you know the number of triangles. Reimplemented in CollisionModel3DImpl. |
|
Returns true if the given sphere collides with the model. getCollidingTriangles() and getCollisionPoint() can be used to retrieve information about a collision. Reimplemented in CollisionModel3DImpl. |