Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# irr::scene::ITriangleSelector Class Reference

Interface to return triangles with specific properties. More...

`#include <ITriangleSelector.h>`

Inheritance diagram for irr::scene::ITriangleSelector:

List of all members.

## Public Member Functions

virtual const ISceneNode * | getSceneNodeForTriangle (u32 triangleIndex) const =0
| Return the scene node associated with a given triangle.
virtual s32 | getTriangleCount () const =0
| Returns amount of all available triangles in this selector.
virtual void | getTriangles (core::triangle3df *triangles, s32 arraySize, s32 &outTriangleCount, const core::line3d< f32 > &line, const core::matrix4 *transform=0) const =0
| Gets the triangles for one associated node which have or may have contact with a 3d line.
virtual void | getTriangles (core::triangle3df *triangles, s32 arraySize, s32 &outTriangleCount, const core::aabbox3d< f32 > &box, const core::matrix4 *transform=0) const =0
| Gets the triangles for one associated node which lie or may lie within a specific bounding box.
virtual void | getTriangles (core::triangle3df *triangles, s32 arraySize, s32 &outTriangleCount, const core::matrix4 *transform=0) const =0
| Gets the triangles for one associated node.
virtual | ~ITriangleSelector ()
| Destructor.

## Detailed Description

Interface to return triangles with specific properties.

Every ISceneNode may have a triangle selector, available with ISceneNode::getTriangleScelector() or ISceneManager::createTriangleSelector. 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 ITriangleSelector easily and check every triangle if it collided.

Definition at line 28 of file ITriangleSelector.h.

## Constructor & Destructor Documentation

virtual irr::scene::ITriangleSelector::~ITriangleSelector | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 33 of file ITriangleSelector.h.

## Member Function Documentation

virtual const ISceneNode* irr::scene::ITriangleSelector::getSceneNodeForTriangle | ( | u32 | triangleIndex | ) | const`[pure virtual]`

Return the scene node associated with a given triangle.

This allows you to find which scene node (potentially of several) is associated with a specific triangle.

Parameters:

  | triangleIndex,: | the index of the triangle for which you want to find the associated scene node.

Returns:
  The scene node associated with that triangle.

virtual s32 irr::scene::ITriangleSelector::getTriangleCount | ( |  | ) | const`[pure virtual]`

Returns amount of all available triangles in this selector.

virtual void irr::scene::ITriangleSelector::getTriangles | ( | core::triangle3df * | triangles,
|  | s32 | arraySize,
|  | s32 & | outTriangleCount,
|  | const core::line3d< f32 > & | line,
|  | const core::matrix4 * | transform = `0` |
| ) |  |  | const`[pure virtual]`

Gets the triangles for one associated node which have or may have contact with a 3d line.

This returns all triangles for one scene node associated with this selector. If there is more than one scene node associated (e.g. for an IMetaTriangleSelector) this this function may be called multiple times to retrieve all triangles.

Please note that unoptimized triangle selectors also may return triangles which are not in contact at all with the 3d line.

Parameters:

  | triangles,: | Array where the resulting triangles will be written to.
  | arraySize,: | Size of the target array.
  | outTriangleCount,: | Amount of triangles which have been written into the array.
  | line,: | Only triangles which may be in contact with this 3d line will be written into the array.
  | transform,: | Pointer to matrix for transforming the triangles before they are returned. Useful for example to scale all triangles down into an ellipsoid space. If this pointer is null, no transformation will be done.

virtual void irr::scene::ITriangleSelector::getTriangles | ( | core::triangle3df * | triangles,
|  | s32 | arraySize,
|  | s32 & | outTriangleCount,
|  | const core::aabbox3d< f32 > & | box,
|  | const core::matrix4 * | transform = `0` |
| ) |  |  | const`[pure virtual]`

Gets the triangles for one associated node which lie or may lie within a specific bounding box.

This returns all triangles for one scene node associated with this selector. If there is more than one scene node associated (e.g. for an IMetaTriangleSelector) this this function may be called multiple times to retrieve all triangles.

This method will return at least the triangles that intersect the box, but may return other triangles as well.

Parameters:

  | triangles,: | Array where the resulting triangles will be written to.
  | arraySize,: | Size of the target array.
  | outTriangleCount,: | Amount of triangles which have been written into the array.
  | box,: | Only triangles which are in this axis aligned bounding box will be written into the array.
  | transform,: | Pointer to matrix for transforming the triangles before they are returned. Useful for example to scale all triangles down into an ellipsoid space. If this pointer is null, no transformation will be done.

virtual void irr::scene::ITriangleSelector::getTriangles | ( | core::triangle3df * | triangles,
|  | s32 | arraySize,
|  | s32 & | outTriangleCount,
|  | const core::matrix4 * | transform = `0` |
| ) |  |  | const`[pure virtual]`

Gets the triangles for one associated node.

This returns all triangles for one scene node associated with this selector. If there is more than one scene node associated (e.g. for an IMetaTriangleSelector) this this function may be called multiple times to retrieve all triangles.

Parameters:

  | triangles,: | Array where the resulting triangles will be written to.
  | arraySize,: | Size of the target array.
  | outTriangleCount,: | Amount of triangles which have been written into the array.
  | transform,: | Pointer to matrix for transforming the triangles before they are returned. Useful for example to scale all triangles down into an ellipsoid space. If this pointer is null, no transformation will be done.

The documentation for this class was generated from the following file:

- ITriangleSelector.h

| The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:42:08 2010 by Doxygen (1.6.2)