Class TRayCollision

Unit

Declaration

type TRayCollision = class(specialize TStructList<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 TCastleTransform tree leading from the final colliding object (usually TCastleScene) to the root of the TCastleTransform tree. This allows you to track the TCastleTransform 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: TCastleTransform): Integer;
Public function IndexOfItem(const ItemClass: TCastleTransformClass): 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: TCastleTransform): Integer;

Index of node with given Item, -1 if none.

Public function IndexOfItem(const ItemClass: TCastleTransformClass): Integer;

Index of node with given ItemClass, -1 if none.


Generated by PasDoc 0.15.0.