Class TTriangleSelector

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TTriangleSelector = class(TReferenceCounted)

Description

Interface to return triangles with specific properties.
Every TSceneNode may have a triangle selector, available with TSceneNode.GetTriangleScelector or TSceneManager.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 TTriangleSelector easily and check every triangle if it collided.

Hierarchy

Overview

Methods

Public constructor Create(Ref: Pointer; NManager: TReferenceCounted; AutoDrop: Boolean = False);
Public function GetSceneNodeForTriangle(TriangleIndex: LongWord): TSceneNode; inline;
Public function GetTriangles(const Box: TBoundingBox): TTriangleArray; overload; inline;
Public function GetTriangles(const Transform: TMatrix4): TTriangleArray; overload; inline;
Public function GetTriangles: TTriangleArray; overload; inline;
Public function GetTriangles(const Line: TLine3D; const Transform: TMatrix4): TTriangleArray; overload; inline;
Public function GetTriangles(const Line: TLine3D): TTriangleArray; overload; inline;
Public function GetTriangles(const Box: TBoundingBox; const Transform: TMatrix4): TTriangleArray; overload; inline;

Properties

Public property TriangleCount: LongInt read GetTriangleCount;

Description

Methods

Public constructor Create(Ref: Pointer; NManager: TReferenceCounted; AutoDrop: Boolean = False);

Constructor. Only used internally.

Public function GetSceneNodeForTriangle(TriangleIndex: LongWord): TSceneNode; inline;

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.

Public function GetTriangles(const Box: TBoundingBox): TTriangleArray; overload; inline;

Returns the triangles for one associated node which lie or may lie within a specific bounding box without transformation.
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 TMetaTriangleSelector) 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
Box
Only triangles which are in this axis aligned bounding box will be written into the array.
Public function GetTriangles(const Transform: TMatrix4): TTriangleArray; overload; inline;

Transforms and returns 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 TMetaTriangleSelector) this this function may be called multiple times to retrieve all triangles.

Parameters
Transform
Pointer to matrix for transforming the triangles before they are returned. Useful for example to scale all triangles down into an ellipsoid space.
Public function GetTriangles: TTriangleArray; overload; inline;

Returns the triangles for one associated node without transformation.
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 TMetaTriangleSelector) this this function may be called multiple times to retrieve all triangles.

Public function GetTriangles(const Line: TLine3D; const Transform: TMatrix4): TTriangleArray; overload; inline;

Transforms and returns 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 TMetaTriangleSelector) 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. Useful for example to scale all triangles down into an ellipsoid space.)

Parameters
Line
Only triangles which may be in contact with this 3d line will be appear in the returned array.
Transform
Matrix for transforming the triangles before they are returned.
Public function GetTriangles(const Line: TLine3D): TTriangleArray; overload; inline;

Returns the triangles for one associated node which have or may have contact with a 3D line without transformation.
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 TMetaTriangleSelector) 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
Line
Only triangles which may be in contact with this 3d line will be appear in the returned array.
Public function GetTriangles(const Box: TBoundingBox; const Transform: TMatrix4): TTriangleArray; overload; inline;

Transforms and returns 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 TMetaTriangleSelector) 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
Box
Only triangles which are in this axis aligned bounding box will be written into the array.
Transform
Matrix for transforming the triangles before they are returned. Useful for example to scale all triangles down into an ellipsoid space.

Properties

Public property TriangleCount: LongInt read GetTriangleCount;

The number of triangles in this selector.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22