## Documentation

- Overview
- Website
- Tutorials
- Class Index

## Classes

- _global_
- CL3D
- CL3D.AnimatedMeshSceneNode
- CL3D.Animator
- CL3D.AnimatorAnimateTexture
- CL3D.AnimatorCameraFPS
- CL3D.AnimatorCameraModelViewer
- CL3D.AnimatorCollisionResponse
- CL3D.AnimatorFlyCircle
- CL3D.AnimatorFlyStraight
- CL3D.AnimatorFollowPath
- CL3D.AnimatorOnClick
- CL3D.AnimatorOnProximity
- CL3D.AnimatorRotation
- CL3D.BillboardSceneNode
- CL3D.BoundingBoxTriangleSelector
- CL3D.Box3d
- CL3D.CameraSceneNode
- CL3D.ColorF
- CL3D.CopperCubeVariable
- CL3D.CopperLicht
- CL3D.CubeSceneNode
- CL3D.HotspotSceneNode
- CL3D.Light
- CL3D.LightSceneNode
- CL3D.Line3d
- CL3D.Material
- CL3D.Matrix4
- CL3D.Mesh
- CL3D.MeshBuffer
- CL3D.MeshSceneNode
- CL3D.MeshTriangleSelector
- CL3D.MetaTriangleSelector
- CL3D.Mobile2DInputSceneNode
- CL3D.OctTreeTriangleSelector
- CL3D.Overlay2DSceneNode
- CL3D.ParticleSystemSceneNode
- CL3D.PathSceneNode
- CL3D.Plane3d
- CL3D.Quaternion
- CL3D.Renderer
- CL3D.Scene
- CL3D.SceneNode
- CL3D.SkyBoxSceneNode
- CL3D.SoundSceneNode
- CL3D.TerrainSceneNode
- CL3D.Texture
- CL3D.TextureManager
- CL3D.Triangle3d
- CL3D.TriangleSelector
- CL3D.Vect2d
- CL3D.Vect3d
- CL3D.Vertex3D
- CL3D.WaterSurfaceSceneNode

CopperLicht API Documentation

# Class CL3D.MeshTriangleSelector

Interface to return triangles with specific properties, useful for collision detection.
Extends CL3D.TriangleSelector.

Class Overview
CL3D.MeshTriangleSelector(Mesh, materialToIgnore, materialToIgnore2, scenenode)
Implementation of TriangleSelector for meshes, useful for collision detection.
Note use CL3D.OctTreeTriangleSelector instead of this one if your mesh is huge, otherwise collision detection might be slow. Every CL3D.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.

Parameters:
{CL3D.Mesh} Mesh
  the CL3D.Mesh representing the geometry
{Number} materialToIgnore
  (optional) material type to ignore for collision. Can be set to null.
{Number} materialToIgnore2
  (optional) material type to ignore for collision. Can be set to null.
{CL3D.SceneNode} scenenode
  the CL3D.SceneNode representing the position of the geometry

Method Summary
Method Attributes | Method Name and Description
--- | ---
| createClone(node) Creates a clone of this triangle selector, for a new scene node
| getAllTriangles(transform, outArray) Returns all triangles for the scene node associated with this selector
| getRelatedSceneNode() Returns the scenenode this selector is for
| getTrianglesInBox(box, transform, outArray) Returns all triangles inside a bounding box, for the scene node associated with this selector.

Methods borrowed from class CL3D.TriangleSelector:
  getCollisionPointWithLine, setNodeToIgnore

Method Detail
createClone(node)
Creates a clone of this triangle selector, for a new scene node

Parameters:
node
  {CL3D.SceneNode} scene node the selector is based on

Returns:
  returns TriangleSelector if this selector can be cloned or null if not

getAllTriangles(transform, outArray)
Returns all triangles for the scene node associated with this selector

Parameters:
{CL3D.Matrix4} transform
  a transformation matrix which transforms all triangles before returning them
{Array} outArray
  output array of the triangles

getRelatedSceneNode()
Returns the scenenode this selector is for

Returns:
  returns SceneNode if this selector is for a specific scene node

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
  {CL3D.Box3d}
transform
  {CL3D.Matrix4} a transformation matrix which transforms all triangles before returning them
outArray
  {Array} output array of the triangles

Returns:
  the new CL3D.TriangleSelector

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit