Class TRayCollision

Unit

Declaration

type TRayCollision = class(specialize TGenericStructList<TRayCollisionNode>)

Description

Represents a ray collision with a 3D objects tree. Just access the First item for the collision information with the final 3D object. The rest of items are containers of this 3D object (a path within TCastleSceneManager.Items hierarchy tree, usually).

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

Public Distance: Single;

Methods

Public function IndexOfItem(const Item: T3D): Integer;

Description

Fields

Public 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

Public function IndexOfItem(const Item: T3D): Integer;

Index of node with given Item.


Generated by PasDoc 0.14.0.