RayInfo

Engine/source/collision/collision.h

Extension of the collision structure to allow use with raycasting.

More...

Public Attributes

t 

Distance along ray to contact point.

void *

A generic data void pointer.

Public Functions

Set the point of intersection according to t and the given ray.

Detailed Description

Extension of the collision structure to allow use with raycasting.

Public Attributes

F32 t 

Distance along ray to contact point.

void * userData 

A generic data void pointer.

Passing a void* around to random objects of unknown class types that may interpret it differently would be very dangerous. Only use userData when you call castRay/etc on an individual object of a known type.

Public Functions

RayInfo()

setContactPoint(const Point3F & start, const Point3F & end)

Set the point of intersection according to t and the given ray.

Several pieces of code will not use ray information but rather rely on contact points directly, so it is a good thing to always set this in castRay functions.