Tramway SDK
Namespaces | Classes | Enumerations | Functions
tram::Physics Namespace Reference

Namespaces

namespace  API
 
namespace  Bullet
 

Classes

class  ArmMotionState
 
struct  Collision
 
class  CollisionModel
 
struct  CollisionShape
 
struct  collisionshape_t
 
struct  CollisionTriangle
 
class  EntMotionState
 
class  PathAction
 
struct  rigidbody_t
 
struct  trigger_t
 

Enumerations

enum  Shape : uint32_t {
  SHAPE_SPHERE , SHAPE_CYLINDER , SHAPE_CAPSULE , SHAPE_CONE ,
  SHAPE_BOX , SHAPE_HULL , SHAPE_MESH
}
 
enum  CollisionGroup : uint32_t {
  COLL_WORLDOBJ = 2 , COLL_STATICOBJ = 4 , COLL_DYNAMICOBJ = 8 , COLL_TRIGGER = 16 ,
  COLL_PLAYER = 32 , COLL_MONSTER = 64 , COLL_VEHICLE = 128
}
 

Functions

void Init ()
 Initializes the physics system. More...
 
void Update ()
 Updates the physics system. More...
 
Collision Raycast (const vec3 &from, const vec3 &to, uint32_t collision_mask)
 Performs a raycast. More...
 
std::vector< CollisionShapecast (const CollisionShape &shape, const vec3 &from, const vec3 &to, uint32_t collision_mask)
 I have no idea if this function works. (yes it does) More...
 

Enumeration Type Documentation

◆ CollisionGroup

Enumerator
COLL_WORLDOBJ 
COLL_STATICOBJ 
COLL_DYNAMICOBJ 
COLL_TRIGGER 
COLL_PLAYER 
COLL_MONSTER 
COLL_VEHICLE 

◆ Shape

enum tram::Physics::Shape : uint32_t
Enumerator
SHAPE_SPHERE 
SHAPE_CYLINDER 
SHAPE_CAPSULE 
SHAPE_CONE 
SHAPE_BOX 
SHAPE_HULL 
SHAPE_MESH 

Function Documentation

◆ Init()

void tram::Physics::Init ( )

Initializes the physics system.

◆ Raycast()

Collision tram::Physics::Raycast ( const vec3 from,
const vec3 to,
uint32_t  collision_mask 
)

Performs a raycast.

Performs a raycast from from to to.

Returns
Collision struct. If there was nothing found, then the pointer in the struct will be set to nullptr.

◆ Shapecast()

std::vector< Collision > tram::Physics::Shapecast ( const CollisionShape shape,
const vec3 from,
const vec3 to,
uint32_t  collision_mask 
)

I have no idea if this function works. (yes it does)

◆ Update()

void tram::Physics::Update ( )

Updates the physics system.

Should only be called once in the update cycle.