Tramway SDK
|
Physics collision data. More...
#include <physics/physics.h>
Public Attributes | |
PhysicsComponent * | collider |
Pointer to a PhysicsComponent that owns the rigidbody with which the collision happened. More... | |
vec3 | point |
Position of the collision in world space. More... | |
vec3 | normal |
Normal vector of the surface that the collision happened with. More... | |
float | distance |
Distance of the collision, i.e. More... | |
Physics collision data.
Used to represent a collision between two physics objects. Sometimes a function always returns a Collision struct, but it can still fail, such as the Raycast() function, which can perform a raycast that doesn't hit anything. In such a case the structs vector properties will be zeroed-out and the collider
will be set to a nullptr
.
tram::Physics::Collision::collider |
Pointer to a PhysicsComponent that owns the rigidbody with which the collision happened.
tram::Physics::Collision::distance |
Distance of the collision, i.e.
how far the colliders penetrated each other.
tram::Physics::Collision::normal |
Normal vector of the surface that the collision happened with.
tram::Physics::Collision::point |
Position of the collision in world space.