Class TRayCollision
Unit
Castle3D
Declaration
type TRayCollision = class(specialize TGenericStructList<TRayCollisionNode>)
Description
Represents a collision with a 3D objects (T3D descendants) tree.
This list is a path in the 3D objects tree leading from the final colliding 3D object to the root of the tree.
For example, your 3D tree may be a list (like T3DList), and within this list is a transformed list (T3DTransform), and within is your final colliding object (like TCastleScene). We will contain in this case these three items, in reverse order (TCastleScene, T3DTransform, T3DList). This allows you to track the containers that contain given collision.
This is never an empty list when returned by RayCollision.
Hierarchy
Overview
Fields
Methods
Description
Fields
 |
Distance: Single; |
Distance, in world coordinate system, from the current camera to the picked point. The suggested usage is to decide if player is close enough to reach the 3D object — for example, you may not want to allow player to open a door by clicking on it from a far distance.
If the ray hit empty space, the distance is MaxSingle. Note that only MainScene is informed about pointing device events when the ray hit empty space.
|
Methods
 |
function IndexOfItem(const Item: T3D): Integer; |
Index of node with given Item.
|
|