Class TRayCollision

Unit

Declaration

type TRayCollision = class(specialize TStructList<TRayCollisionNode>)

Description

Represents a ray collision with TCastleTransform (TCastleTransform that may have parents).

We advise to access the useful information using only the Transform or Info methods or read Distance field.

Everything else is somewhat internal information and things get complicated if you try to make sense of it. It's a TODO: to maybe deprecate this structure in favor of something simpler.

The full description is that this is a list, from the innermost TCastleTransform that was hit by the ray, to the root of the TCastleTransform tree. The First item is the collision information with the final TCastleTransform. The rest of items are parent, grandparent etc. of this TCastleTransform object (so it is a path within TCastleViewport.Items hierarchy tree).

But be aware that CGE uses some internal TCastleTransform instances. E.g. TCastleBox, TCastleTiledMap have internal TCastleScene instances. These internal components are marked with csTransient flag in ComponentState.

We, again, advise to not iterate over this list or access e.g. first item directly. Use only Transform or Info methods or read Distance field! Things are simple then.

This is never an empty list when returned by RayCollision.

Source: transform/castletransform_initial_types.inc (line 153).

Hierarchy


Generated by PasDoc 0.17.0.snapshot.