Tramway SDK
Classes | Typedefs | Enumerations | Functions | Variables
tram::Physics::API Namespace Reference

Classes

class  CallbackMotionState
 
struct  CollisionShapeTransform
 
struct  ObjectCollision
 
class  PhysicsDebugDraw
 
struct  RigidbodyMetadata
 
struct  ShapecastCallback
 

Typedefs

typedef std::pair< vec3, quat >(* get_trf_callback) (void *)
 
typedef void(* set_trf_callback) (void *, std::pair< vec3, quat >)
 
typedef void(* col_callback) (void *, void *, ObjectCollision)
 

Enumerations

enum  UserIndex : int { USERINDEX_RIGIDBODY = 3 , USERINDEX_TRIGGER = 4 }
 
enum  MetadataType { METADATA_RIGIDBODY , METADATA_TRIGGER }
 

Functions

collisionshape_t MakeCollisionShape (CollisionShapeTransform *shapes, size_t shape_count)
 
collisionshape_t MakeCollisionShape (CollisionShape shape)
 
void YeetCollisionShape (collisionshape_t shape)
 
rigidbody_t MakeRigidbody (collisionshape_t shape, float mass, vec3 position, quat rotation, uint32_t mask, uint32_t group, get_trf_callback get_callback, set_trf_callback set_callback, void *data)
 
void YeetRigidbody (rigidbody_t rigidbody)
 
void SetRigidbodyTransformCallback (rigidbody_t rigidbody, get_trf_callback get_callback, set_trf_callback set_callback, void *data)
 
void SetRigidbodyCollisionCallback (rigidbody_t rigidbody, col_callback callback, void *data)
 
void SetRigidbodyCollisionMask (rigidbody_t rigidbody, uint32_t mask)
 
void SetRigidbodyCollisionGroup (rigidbody_t rigidbody, uint32_t group)
 
void SetRigidbodyLocation (rigidbody_t rigidbody, vec3 location)
 
void SetRigidbodyRotation (rigidbody_t rigidbody, quat rotation)
 
void SetRigidbodyMass (rigidbody_t rigidbody, float mass)
 
void PushRigidbody (rigidbody_t rigidbody, vec3 direction)
 
void PushRigidbody (rigidbody_t rigidbody, vec3 direction, vec3 local)
 
void SpinRigidbody (rigidbody_t rigidbody, vec3 direction)
 
void SetRigidbodyDebugDrawing (rigidbody_t rigidbody, bool drawing)
 
void SetRigidbodyKinematic (rigidbody_t rigidbody, bool kinematic)
 
void SetRigidbodyAngularFactor (rigidbody_t rigidbody, vec3 factor)
 
void SetRigidbodyLinearFactor (rigidbody_t rigidbody, vec3 factor)
 
void SetRigidbodyVelocity (rigidbody_t rigidbody, vec3 velocity)
 
vec3 GetRigidbodyVelocity (rigidbody_t rigidbody)
 
void AwakenRigidbody (rigidbody_t rigidbody)
 
void SleepRigidbody (rigidbody_t rigidbody)
 
void DisableRigidbodyDeactivation (rigidbody_t rigidbody)
 
trigger_t MakeTrigger (collisionshape_t shape, uint32_t mask, uint32_t group, vec3 position, quat rotation)
 
void YeetTrigger (trigger_t)
 
void SetTriggerCollisionCallback (trigger_t rigidbody, col_callback callback, void *data)
 
void SetTriggerCollisionMask (trigger_t rigidbody, uint32_t mask)
 
void SetTriggerCollisionGroup (trigger_t rigidbody, uint32_t group)
 
void SetTriggerLocation (trigger_t rigidbody, vec3 location)
 
void SetTriggerRotation (trigger_t rigidbody, quat location)
 
std::pair< ObjectCollision, void * > Raycast (vec3 from, vec3 to, uint32_t collision_mask)
 
std::vector< std::pair< ObjectCollision, void * > > Shapecast (CollisionShape shape, vec3 from, vec3 to, uint32_t collision_mask)
 
void Init ()
 
void StepPhysics ()
 
void DrawDebug ()
 
void DrawDebug (bool)
 
void SetRigidbodyTransformCallback (rigidbody_t rigidbody, std::pair< vec3, quat >(*get_transform_callback)(void *), void(*set_transform_callback)(void *, std::pair< vec3, quat >), void *data)
 

Variables

Pool< RigidbodyMetadatarigidbody_metadata_pool ("rigibody emtadat pool", 200)
 

Typedef Documentation

◆ col_callback

typedef void(* tram::Physics::API::col_callback) (void *, void *, ObjectCollision)

◆ get_trf_callback

typedef std::pair< vec3, quat >(* tram::Physics::API::get_trf_callback) (void *)

◆ set_trf_callback

typedef void(* tram::Physics::API::set_trf_callback) (void *, std::pair< vec3, quat >)

Enumeration Type Documentation

◆ MetadataType

Enumerator
METADATA_RIGIDBODY 
METADATA_TRIGGER 

◆ UserIndex

Enumerator
USERINDEX_RIGIDBODY 
USERINDEX_TRIGGER 

Function Documentation

◆ AwakenRigidbody()

void tram::Physics::API::AwakenRigidbody ( rigidbody_t  rigidbody)

◆ DisableRigidbodyDeactivation()

void tram::Physics::API::DisableRigidbodyDeactivation ( rigidbody_t  rigidbody)

◆ DrawDebug() [1/2]

void tram::Physics::API::DrawDebug ( )

◆ DrawDebug() [2/2]

void tram::Physics::API::DrawDebug ( bool  draw)

◆ GetRigidbodyVelocity()

vec3 tram::Physics::API::GetRigidbodyVelocity ( rigidbody_t  rigidbody)

◆ Init()

void tram::Physics::API::Init ( )

◆ MakeCollisionShape() [1/2]

collisionshape_t tram::Physics::API::MakeCollisionShape ( CollisionShape  shape)

◆ MakeCollisionShape() [2/2]

collisionshape_t tram::Physics::API::MakeCollisionShape ( CollisionShapeTransform shapes,
size_t  shape_count 
)

◆ MakeRigidbody()

rigidbody_t tram::Physics::API::MakeRigidbody ( collisionshape_t  shape,
float  mass,
vec3  position,
quat  rotation,
uint32_t  mask,
uint32_t  group,
get_trf_callback  get_callback,
set_trf_callback  set_callback,
void *  data 
)

◆ MakeTrigger()

trigger_t tram::Physics::API::MakeTrigger ( collisionshape_t  shape,
uint32_t  mask,
uint32_t  group,
vec3  position,
quat  rotation 
)

◆ PushRigidbody() [1/2]

void tram::Physics::API::PushRigidbody ( rigidbody_t  rigidbody,
vec3  direction 
)

◆ PushRigidbody() [2/2]

void tram::Physics::API::PushRigidbody ( rigidbody_t  rigidbody,
vec3  direction,
vec3  local 
)

◆ Raycast()

std::pair< ObjectCollision, void * > tram::Physics::API::Raycast ( vec3  from,
vec3  to,
uint32_t  collision_mask 
)

◆ SetRigidbodyAngularFactor()

void tram::Physics::API::SetRigidbodyAngularFactor ( rigidbody_t  rigidbody,
vec3  factor 
)

◆ SetRigidbodyCollisionCallback()

void tram::Physics::API::SetRigidbodyCollisionCallback ( rigidbody_t  rigidbody,
col_callback  callback,
void *  data 
)

◆ SetRigidbodyCollisionGroup()

void tram::Physics::API::SetRigidbodyCollisionGroup ( rigidbody_t  rigidbody,
uint32_t  group 
)

◆ SetRigidbodyCollisionMask()

void tram::Physics::API::SetRigidbodyCollisionMask ( rigidbody_t  rigidbody,
uint32_t  mask 
)

◆ SetRigidbodyDebugDrawing()

void tram::Physics::API::SetRigidbodyDebugDrawing ( rigidbody_t  rigidbody,
bool  drawing 
)

◆ SetRigidbodyKinematic()

void tram::Physics::API::SetRigidbodyKinematic ( rigidbody_t  rigidbody,
bool  kinematic 
)

◆ SetRigidbodyLinearFactor()

void tram::Physics::API::SetRigidbodyLinearFactor ( rigidbody_t  rigidbody,
vec3  factor 
)

◆ SetRigidbodyLocation()

void tram::Physics::API::SetRigidbodyLocation ( rigidbody_t  rigidbody,
vec3  location 
)

◆ SetRigidbodyMass()

void tram::Physics::API::SetRigidbodyMass ( rigidbody_t  rigidbody,
float  mass 
)

◆ SetRigidbodyRotation()

void tram::Physics::API::SetRigidbodyRotation ( rigidbody_t  rigidbody,
quat  rotation 
)

◆ SetRigidbodyTransformCallback() [1/2]

void tram::Physics::API::SetRigidbodyTransformCallback ( rigidbody_t  rigidbody,
get_trf_callback  get_callback,
set_trf_callback  set_callback,
void *  data 
)

◆ SetRigidbodyTransformCallback() [2/2]

void tram::Physics::API::SetRigidbodyTransformCallback ( rigidbody_t  rigidbody,
std::pair< vec3, quat >(*)(void *)  get_transform_callback,
void(*)(void *, std::pair< vec3, quat >)  set_transform_callback,
void *  data 
)

◆ SetRigidbodyVelocity()

void tram::Physics::API::SetRigidbodyVelocity ( rigidbody_t  rigidbody,
vec3  velocity 
)

◆ SetTriggerCollisionCallback()

void tram::Physics::API::SetTriggerCollisionCallback ( trigger_t  rigidbody,
col_callback  callback,
void *  data 
)

◆ SetTriggerCollisionGroup()

void tram::Physics::API::SetTriggerCollisionGroup ( trigger_t  rigidbody,
uint32_t  group 
)

◆ SetTriggerCollisionMask()

void tram::Physics::API::SetTriggerCollisionMask ( trigger_t  rigidbody,
uint32_t  mask 
)

◆ SetTriggerLocation()

void tram::Physics::API::SetTriggerLocation ( trigger_t  rigidbody,
vec3  location 
)

◆ SetTriggerRotation()

void tram::Physics::API::SetTriggerRotation ( trigger_t  rigidbody,
quat  location 
)

◆ Shapecast()

std::vector< std::pair< ObjectCollision, void * > > tram::Physics::API::Shapecast ( CollisionShape  shape,
vec3  from,
vec3  to,
uint32_t  collision_mask 
)

◆ SleepRigidbody()

void tram::Physics::API::SleepRigidbody ( rigidbody_t  rigidbody)

◆ SpinRigidbody()

void tram::Physics::API::SpinRigidbody ( rigidbody_t  rigidbody,
vec3  direction 
)

◆ StepPhysics()

void tram::Physics::API::StepPhysics ( )

◆ YeetCollisionShape()

void tram::Physics::API::YeetCollisionShape ( collisionshape_t  shape)

◆ YeetRigidbody()

void tram::Physics::API::YeetRigidbody ( rigidbody_t  rigidbody)

◆ YeetTrigger()

void tram::Physics::API::YeetTrigger ( trigger_t  trigger)

Variable Documentation

◆ rigidbody_metadata_pool

Pool< RigidbodyMetadata > tram::Physics::API::rigidbody_metadata_pool("rigibody emtadat pool", 200) ( "rigibody emtadat pool"  ,
200   
)