Tramway SDK
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
tram Namespace Reference

Namespaces

namespace  Async
 
namespace  Audio
 
namespace  Core
 
namespace  Ext
 
namespace  GUI
 
namespace  implementation
 
namespace  Language
 
namespace  Physics
 
namespace  Platform
 
namespace  Render
 
namespace  Script
 
namespace  Settings
 
namespace  Stats
 
namespace  System
 
namespace  UI
 

Classes

class  AABBTree
 
class  AnimationComponent
 
class  AudioComponent
 
class  Component
 Wrapper for an EntityComponent pointer. More...
 
class  ControllerComponent
 
class  Crate
 
class  Decoration
 
struct  Edge
 
class  Entity
 
class  EntityComponent
 
struct  EntityTypeInfo
 
struct  Event
 
class  EventListener
 Smart wrapper class for Event listeners. More...
 
class  File
 
class  FileReader
 
class  FileWriter
 
class  Graph
 
class  Hashmap
 
class  Light
 
class  LightComponent
 
struct  ListenerInfo
 
class  Loader
 
class  Marker
 
struct  Message
 
class  Navmesh
 
struct  NavmeshNode
 
struct  Node
 
class  Octree
 
class  ParticleComponent
 
class  Path
 
struct  PathEdgeInfo
 
class  PathFollower
 
class  PhysicsComponent
 
class  Player
 
class  PlayerComponent
 
class  Pool
 
class  PoolProxy
 
class  PoolPtr
 
class  Queue
 
class  RenderComponent
 
class  Resource
 
class  ResourceProxy
 
struct  SharedEntityData
 
struct  Signal
 
class  SignalTable
 
class  Sound
 
class  Spinlock
 
class  SpriteComponent
 
class  Stack
 
class  StackPool
 
class  StaticWorldObject
 
class  TemplateComponent
 
class  Transition
 
class  Trigger
 
class  TriggerComponent
 
struct  UID
 
class  Value
 Generic, type-safe union. More...
 
class  ValueArray
 
class  ValuePtr
 
class  WorldCell
 

Typedefs

typedef uint32_t id_t
 
typedef uint16_t event_t
 
typedef uint32_t listener_t
 
typedef glm::vec3 vec3
 
typedef glm::quat quat
 
typedef glm::mat2 mat2
 
typedef glm::mat4 mat4
 
typedef glm::vec4 vec4
 
typedef glm::vec2 vec2
 
typedef glm::ivec3 ivec3
 
typedef glm::ivec4 ivec4
 
typedef glm::uvec3 uvec3
 
typedef glm::uvec4 uvec4
 
typedef uint32_t message_t
 
typedef uint32_t node_id_t
 
typedef uint32_t query_t
 
typedef uint32_t signal_t
 
typedef UID name_t
 
typedef Value value_t
 
typedef ValueArray valuearray_t
 
template<typename T >
using PoopProxy = PoolProxy< T >
 

Enumerations

enum  { FIELD_MODEL , FIELD_COLLMODEL }
 
enum  : uint32_t { FLAG_LOCKED = 1 }
 
enum  { FIELD_FLAGS , FIELD_MODEL , FIELD_ANIMATION }
 
enum  { FIELD_COLOR , FIELD_DISTANCE , FIELD_DIRECTION , FIELD_EXPONENT }
 
enum  { SOUND_LOOPING = 1 , SOUND_START_ON_LOAD = 2 }
 
enum  { FIELD_FLAGS , FIELD_SOUND , FIELD_VOLUME }
 
enum  { FIELD_MODEL , FIELD_LIGHTMAP }
 
enum  : uint32_t { TRIGGER_DISABLED = 1 }
 
enum  { FIELD_FLAGS , FIELD_COLLISION_MASK , FIELD_MODEL }
 
enum  FileAccessMode : uint32_t { MODE_READ = 1 , MODE_WRITE = 2 , MODE_PAUSE_LINE = 4 }
 
enum  Severity {
  SEVERITY_INFO , SEVERITY_WARNING , SEVERITY_ERROR , SEVERITY_CRITICAL_ERROR ,
  SEVERITY_DEFAULT
}
 
enum  PathType {
  PATH_STRAIGHT , PATH_LEFT , PATH_RIGHT , PATH_LINEAR ,
  PATH_CURVE
}
 
enum  Query : query_t {
  QUERY_PICKUPABLE , QUERY_LOOK_DIRECTION , QUERY_BOUNDING_BOX_MIN , QUERY_BOUNDING_BOX_MAX ,
  LAST_QUERY
}
 
enum  Type : uint32_t {
  TYPE_UNDEFINED , TYPE_BOOL , TYPE_INT , TYPE_UINT ,
  TYPE_FLOAT , TYPE_NAME , TYPE_STRING , TYPE_INT8 ,
  TYPE_INT16 , TYPE_INT32 , TYPE_INT64 , TYPE_UINT8 ,
  TYPE_UINT16 , TYPE_UINT32 , TYPE_UINT64 , TYPE_FLOAT32 ,
  TYPE_FLOAT64 , TYPE_VEC2 , TYPE_VEC3 , TYPE_VEC4 ,
  TYPE_QUAT
}
 Type enumeration for serialization, etc. More...
 
enum  FileSource { SOURCE_ANY , SOURCE_DISK }
 
enum  PlatformType { PLATFORM_WINDOWS , PLATFORM_LINUX , PLATFORM_WEB }
 

Functions

id_t GenerateID ()
 Generates a unique ID number. More...
 
uint32_t GetTick ()
 Returns the current tick. More...
 
double GetTickTime ()
 Returns the time at the start of the current tick. More...
 
float GetDeltaTime ()
 
const char * GetVersion ()
 
template<typename T >
auto read_text_from_chars (const char *&cursor, const char *cursor_end)
 
int32_t read_text_int32 (const char *&cursor, const char *cursor_end)
 
int64_t read_text_int64 (const char *&cursor, const char *cursor_end)
 
float read_text_float32 (const char *&cursor, const char *cursor_end)
 
double read_text_float64 (const char *&cursor, const char *cursor_end)
 
UID read_text_name (const char *&cursor, const char *cursor_end)
 
std::string_view read_text_line (const char *&cursor, const char *cursor_end)
 
template<typename T >
void write_text_to_chars (T value, char *&cursor, char *cursor_end)
 
void SetSystemLoggingSeverity (System::system_t system, Severity min_severity)
 
void SetLogCallback (void(*callback)(int, const char *))
 
void SetLogCallback (void(int, const char *))
 
template<typename... Args>
void Log (int severity, int system, const std::string_view &format, Args &&... args)
 
template<typename... Args>
void Log (int system, const std::string_view &format, Args &&... args)
 
template<typename... Args>
void Log (const std::string_view &format, Args &&... args)
 
template<typename... Args>
void DisplayLog (int time, const std::string_view &format, Args &&... args)
 
void QuatLookAt (quat &quaternion, const vec3 &from, const vec3 &to)
 
void ProjectLine (vec3 &point, const vec3 &from, const vec3 &to)
 
vec3 RayTriangleIntersection (vec3 ray_pos, vec3 ray_dir, vec3 point1, vec3 point2, vec3 point3)
 
vec3 MergeAABBMin (vec3 a, vec3 b)
 
vec3 MergeAABBMax (vec3 a, vec3 b)
 
void RotateAABB (vec3 &min, vec3 &max, quat rotation)
 
mat4 PositionRotationToMatrix (const vec3 &position, const quat &rotation)
 
mat4 PositionRotationScaleToMatrix (const vec3 &position, const quat &rotation, const vec3 &scale)
 
const vec3 DIRECTION_FORWARD (0.0f, 0.0f, -1.0f)
 
const vec3 DIRECTION_SIDE (1.0f, 0.0f, 0.0f)
 
const vec3 DIRECTION_UP (0.0f, 1.0f, 0.0f)
 
const vec3 IDENTITY_POSITION (0.0f, 0.0f, 0.0f)
 
const quat IDENTITY_ROTATION (1.0f, 0.0f, 0.0f, 0.0f)
 
const vec3 IDENTITY_SCALE (1.0f, 1.0f, 1.0f)
 
double GetTime ()
 Retrieves the current time. More...
 

Variables

const size_t MAX_EVENT_TYPES = 100
 
const size_t MAX_MESSAGE_TYPES = 100
 
std::priority_queue< std::pair< double, Message * >, std::vector< std::pair< double, Message * > >, std::greater< std::pair< double, Message * > > > future_messages
 
const size_t MAX_SIGNAL_TYPES = 100
 

Typedef Documentation

◆ event_t

typedef uint16_t tram::event_t

◆ id_t

typedef uint32_t tram::id_t

◆ ivec3

typedef glm::ivec3 tram::ivec3

◆ ivec4

typedef glm::ivec4 tram::ivec4

◆ listener_t

typedef uint32_t tram::listener_t

◆ mat2

typedef glm::mat2 tram::mat2

◆ mat4

typedef glm::mat4 tram::mat4

◆ message_t

typedef uint32_t tram::message_t

◆ name_t

typedef UID tram::name_t

◆ node_id_t

typedef uint32_t tram::node_id_t

◆ PoopProxy

template<typename T >
using tram::PoopProxy = typedef PoolProxy<T>

◆ quat

typedef glm::quat tram::quat

◆ query_t

typedef uint32_t tram::query_t

◆ signal_t

typedef uint32_t tram::signal_t

◆ uvec3

typedef glm::uvec3 tram::uvec3

◆ uvec4

typedef glm::uvec4 tram::uvec4

◆ value_t

◆ valuearray_t

◆ vec2

typedef glm::vec2 tram::vec2

◆ vec3

typedef glm::vec3 tram::vec3

◆ vec4

typedef glm::vec4 tram::vec4

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FIELD_FLAGS 
FIELD_MODEL 
FIELD_ANIMATION 

◆ anonymous enum

anonymous enum
Enumerator
FIELD_COLOR 
FIELD_DISTANCE 
FIELD_DIRECTION 
FIELD_EXPONENT 

◆ anonymous enum

anonymous enum
Enumerator
SOUND_LOOPING 
SOUND_START_ON_LOAD 

◆ anonymous enum

anonymous enum
Enumerator
FIELD_FLAGS 
FIELD_SOUND 
FIELD_VOLUME 

◆ anonymous enum

anonymous enum
Enumerator
FIELD_MODEL 
FIELD_LIGHTMAP 

◆ anonymous enum

anonymous enum : uint32_t
Enumerator
TRIGGER_DISABLED 

◆ anonymous enum

anonymous enum
Enumerator
FIELD_FLAGS 
FIELD_COLLISION_MASK 
FIELD_MODEL 

◆ anonymous enum

anonymous enum
Enumerator
FIELD_MODEL 
FIELD_COLLMODEL 

◆ anonymous enum

anonymous enum : uint32_t
Enumerator
FLAG_LOCKED 

◆ FileAccessMode

enum tram::FileAccessMode : uint32_t
Enumerator
MODE_READ 
MODE_WRITE 
MODE_PAUSE_LINE 

◆ FileSource

Enumerator
SOURCE_ANY 
SOURCE_DISK 

◆ PathType

Enumerator
PATH_STRAIGHT 
PATH_LEFT 
PATH_RIGHT 
PATH_LINEAR 
PATH_CURVE 

◆ PlatformType

Enumerator
PLATFORM_WINDOWS 
PLATFORM_LINUX 
PLATFORM_WEB 

◆ Query

Enumerator
QUERY_PICKUPABLE 
QUERY_LOOK_DIRECTION 
QUERY_BOUNDING_BOX_MIN 
QUERY_BOUNDING_BOX_MAX 
LAST_QUERY 

◆ Severity

Enumerator
SEVERITY_INFO 
SEVERITY_WARNING 
SEVERITY_ERROR 
SEVERITY_CRITICAL_ERROR 
SEVERITY_DEFAULT 

◆ Type

enum tram::Type : uint32_t

Type enumeration for serialization, etc.

Enumerator
TYPE_UNDEFINED 
TYPE_BOOL 
TYPE_INT 
TYPE_UINT 
TYPE_FLOAT 
TYPE_NAME 
TYPE_STRING 
TYPE_INT8 
TYPE_INT16 
TYPE_INT32 
TYPE_INT64 
TYPE_UINT8 
TYPE_UINT16 
TYPE_UINT32 
TYPE_UINT64 
TYPE_FLOAT32 
TYPE_FLOAT64 
TYPE_VEC2 
TYPE_VEC3 
TYPE_VEC4 
TYPE_QUAT 

Function Documentation

◆ DIRECTION_FORWARD()

const vec3 tram::DIRECTION_FORWARD ( 0.  0f,
0.  0f,
-1.  0f 
)

◆ DIRECTION_SIDE()

const vec3 tram::DIRECTION_SIDE ( 1.  0f,
0.  0f,
0.  0f 
)

◆ DIRECTION_UP()

const vec3 tram::DIRECTION_UP ( 0.  0f,
1.  0f,
0.  0f 
)

◆ DisplayLog()

template<typename... Args>
void tram::DisplayLog ( int  time,
const std::string_view &  format,
Args &&...  args 
)

◆ GenerateID()

id_t tram::GenerateID ( )

Generates a unique ID number.

◆ GetDeltaTime()

float tram::GetDeltaTime ( )

◆ GetTick()

uint32_t tram::GetTick ( )

Returns the current tick.

This value gets incremented once per update cycle.

Returns
Count of update cycles since the application was started.

◆ GetTickTime()

double tram::GetTickTime ( )

Returns the time at the start of the current tick.

This value changes only once per update cycle.

Returns
Time, in seconds, since the application was started.

◆ GetTime()

double tram::GetTime ( )

Retrieves the current time.

Returns the time, in seconds, since the program was started.

Note
If you want to use this time for game logic, then it might be better to use GetTickTime() function.

◆ GetVersion()

const char * tram::GetVersion ( )

◆ IDENTITY_POSITION()

const vec3 tram::IDENTITY_POSITION ( 0.  0f,
0.  0f,
0.  0f 
)

◆ IDENTITY_ROTATION()

const quat tram::IDENTITY_ROTATION ( 1.  0f,
0.  0f,
0.  0f,
0.  0f 
)

◆ IDENTITY_SCALE()

const vec3 tram::IDENTITY_SCALE ( 1.  0f,
1.  0f,
1.  0f 
)

◆ Log() [1/3]

template<typename... Args>
void tram::Log ( const std::string_view &  format,
Args &&...  args 
)

◆ Log() [2/3]

template<typename... Args>
void tram::Log ( int  severity,
int  system,
const std::string_view &  format,
Args &&...  args 
)

◆ Log() [3/3]

template<typename... Args>
void tram::Log ( int  system,
const std::string_view &  format,
Args &&...  args 
)

◆ MergeAABBMax()

vec3 tram::MergeAABBMax ( vec3  a,
vec3  b 
)

◆ MergeAABBMin()

vec3 tram::MergeAABBMin ( vec3  a,
vec3  b 
)

◆ PositionRotationScaleToMatrix()

mat4 tram::PositionRotationScaleToMatrix ( const vec3 position,
const quat rotation,
const vec3 scale 
)

◆ PositionRotationToMatrix()

mat4 tram::PositionRotationToMatrix ( const vec3 position,
const quat rotation 
)

◆ ProjectLine()

void tram::ProjectLine ( vec3 point,
const vec3 from,
const vec3 to 
)

◆ QuatLookAt()

void tram::QuatLookAt ( quat quaternion,
const vec3 from,
const vec3 to 
)

◆ RayTriangleIntersection()

vec3 tram::RayTriangleIntersection ( vec3  ray_pos,
vec3  ray_dir,
vec3  point1,
vec3  point2,
vec3  point3 
)

◆ read_text_float32()

float tram::read_text_float32 ( const char *&  cursor,
const char *  cursor_end 
)

◆ read_text_float64()

double tram::read_text_float64 ( const char *&  cursor,
const char *  cursor_end 
)

◆ read_text_from_chars()

template<typename T >
auto tram::read_text_from_chars ( const char *&  cursor,
const char *  cursor_end 
)

◆ read_text_int32()

int32_t tram::read_text_int32 ( const char *&  cursor,
const char *  cursor_end 
)

◆ read_text_int64()

int64_t tram::read_text_int64 ( const char *&  cursor,
const char *  cursor_end 
)

◆ read_text_line()

std::string_view tram::read_text_line ( const char *&  cursor,
const char *  cursor_end 
)

◆ read_text_name()

UID tram::read_text_name ( const char *&  cursor,
const char *  cursor_end 
)

◆ RotateAABB()

void tram::RotateAABB ( vec3 min,
vec3 max,
quat  rotation 
)

◆ SetLogCallback() [1/2]

void tram::SetLogCallback ( void(*)(int, const char *)  callback)

◆ SetLogCallback() [2/2]

void tram::SetLogCallback ( void(int, const char *)  )

◆ SetSystemLoggingSeverity()

void tram::SetSystemLoggingSeverity ( System::system_t  system,
Severity  min_severity 
)

◆ write_text_to_chars()

template<typename T >
void tram::write_text_to_chars ( value,
char *&  cursor,
char *  cursor_end 
)

Variable Documentation

◆ future_messages

std::priority_queue<std::pair<double, Message*>, std::vector<std::pair<double, Message*> >, std::greater<std::pair<double, Message*> > > tram::future_messages

◆ MAX_EVENT_TYPES

const size_t tram::MAX_EVENT_TYPES = 100

◆ MAX_MESSAGE_TYPES

const size_t tram::MAX_MESSAGE_TYPES = 100

◆ MAX_SIGNAL_TYPES

const size_t tram::MAX_SIGNAL_TYPES = 100