Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

RaycastHit

Add this in your code:

#include <engine/physics/raycast.h>

Description

This class stores information of a racyast hit.

Variables


NameTypeDescription
hitGameObjectstd::weak_ptr<GameObject>Pointer of the GameObject hit by the ray
hitColliderstd::weak_ptr<Collider>Pointer of the Collider hit by the ray
hitPositionVector3World position of the hit
distancefloatDistance between the start position and the hit position