Coppercube API Documentation
Class OctTreeTriangleSelector
OctTree implementation of a triangle selector, useful for collision detection.
Extends
TriangleSelector.
Class Overview
OctTreeTriangleSelector(Mesh, scenenode, minimalPolysPerNode)
Implementation of TriangleSelector for huge meshes, useful for collision detection.
The internal structure of this mesh is an occtree, speeding up queries using an axis aligne box (getTrianglesInBox).
Every SceneNode may have a triangle selector, available with SceneNode::Selector. This is used for doing collision detection:
For example if you know that a collision may have happened in the area between (1,1,1) and (10,10,10), you can get all triangles of the scene
node in this area with the TriangleSelector easily and check every triangle if it collided.
Method Attributes | Method Name and Description |
---|---|
getAllTriangles(transform, outArray)
Returns all triangles for the scene node associated with this selector
|
|
getTrianglesInBox(box, transform, outArray)
Returns all triangles inside a bounding box, for the scene node associated with this selector.
|
- Methods borrowed from class TriangleSelector:
- getCollisionPointWithLine
Method Detail
getAllTriangles(transform, outArray)
Returns all triangles for the scene node associated with this selector
- Parameters:
- transform
- {Matrix4} a transformation matrix which transforms all triangles before returning them
- outArray
- {Array} output array of the triangles
- Returns:
- the new TriangleSelector
getTrianglesInBox(box, transform, outArray)
Returns all triangles inside a bounding box, for the scene node associated with this selector. This method will
return at least the triangles that intersect the box, but may return other triangles as well.
- Parameters:
- box
- {Box3d}
- transform
- {Matrix4} a transformation matrix which transforms all triangles before returning them
- outArray
- {Array} output array of the triangles
- Returns:
- the new TriangleSelector