Tramway SDK
Public Attributes | List of all members
tram::Physics::Collision Struct Reference

Physics collision data. More...

#include <physics/physics.h>

Public Attributes

PhysicsComponentcollider
 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...
 

Detailed Description

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.

Member Data Documentation

◆ collider

tram::Physics::Collision::collider

Pointer to a PhysicsComponent that owns the rigidbody with which the collision happened.

◆ distance

tram::Physics::Collision::distance

Distance of the collision, i.e.

how far the colliders penetrated each other.

◆ normal

tram::Physics::Collision::normal

Normal vector of the surface that the collision happened with.

◆ point

tram::Physics::Collision::point

Position of the collision in world space.


The documentation for this struct was generated from the following files: