Tramway SDK
|
High-level Render system API. More...
Namespaces | |
namespace | AABB |
namespace | API |
Rendering backend API. | |
namespace | LightTree |
Scene light tree. | |
namespace | SceneTree |
Scene tree. | |
Classes | |
struct | AABBTriangle |
class | Animation |
Skeletal animation for a 3D model. More... | |
struct | Bone |
Bone for a 3D models skeleton. More... | |
struct | BucketMapping |
struct | drawlistentry_t |
struct | DynamicModelData |
struct | DynamicModelVertex |
struct | indexarray_t |
struct | IndexRange |
struct | Keyframe |
Keyframe for a skeletal animation. More... | |
struct | KeyframeHeader |
struct | light_t |
struct | LineVertex |
class | Material |
Material resource. More... | |
class | Model |
struct | ModelAABB |
struct | ModelData |
struct | Pose |
struct | RegisteredVertexDefinition |
class | Sprite |
Sprite resource. More... | |
struct | spritearray_t |
struct | SpriteFrame |
struct | SpritePoint |
struct | SpriteVertex |
struct | StaticModelData |
struct | StaticModelVertex |
struct | texturehandle_t |
struct | Triangle |
struct | TriangleBucket |
struct | vertexarray_t |
struct | VertexAttribute |
Atributes for vertex buffer vertices. More... | |
struct | VertexDefinition |
Typedefs | |
typedef std::pair< name_t, uint64_t > | NameCount |
typedef vec3 | color_t |
typedef uint32_t | layer_t |
typedef uint32_t | vertexformat_t |
typedef uint32_t | materialtype_t |
typedef void * | aabbleaf_t |
Functions | |
Hashmap< Animation * > | animation_list ("model name list", 500) |
uint8_t * | MakeNewErrorTexture (vec3 color1, vec3 color2) |
Generates a new error texture. More... | |
StaticModelData * | MakeNewErrorModel () |
Generates a new error model. More... | |
void | Init () |
Initializes the rendering system. More... | |
void | Render () |
Renders a single frame. More... | |
void | SetSunDirection (color_t direction, layer_t layer) |
Sets the sun direction. More... | |
void | SetSunColor (color_t color, layer_t layer) |
Sets the sun color. More... | |
void | SetAmbientColor (color_t color, layer_t layer) |
Sets the ambient color. More... | |
void | SetScreenSize (float width, float height) |
void | SetViewFov (float fov, layer_t layer) |
float | GetViewFov (layer_t layer) |
void | SetOrthoRatio (float ratio, layer_t layer) |
void | SetViewDistance (float dist, layer_t layer) |
float | GetViewDistance (layer_t layer) |
void | SetViewPosition (vec3 position, layer_t layer) |
Sets the view position. More... | |
void | SetViewRotation (quat rotation, layer_t layer) |
Sets the view rotation. More... | |
vec3 | GetViewPosition (layer_t layer) |
Returns the view position for a given layer. More... | |
quat | GetViewRotation (layer_t layer) |
Returns the view rotation for a given layer. More... | |
void | AddLine (vec3 from, vec3 to, vec3 color) |
Draws a line for a single frame. More... | |
void | AddLineMarker (vec3 location, vec3 color) |
Draws a cross marker for a single frame. More... | |
void | AddLineAABB (vec3 min, vec3 max, vec3 center, quat rotation, vec3 color) |
Draws an AABB box for a single frame. More... | |
void | AddSphere (vec3 pos, float radius, color_t color) |
Draws a sphere for a single frame. More... | |
void | AddCylinder (vec3 pos, float height, float radius, color_t color) |
Draws a cylinder for a single frame. More... | |
void | AddCube (vec3 pos, float height, float radius, color_t color) |
Draws a cube for a single frame. More... | |
void | AddText (vec3 pos, const char *text, color_t color) |
Draws text, in 3D space, for a single frame. More... | |
void | AddText (float x, float y, const char *text, color_t color) |
Draws text, on the screen, for a single frame. More... | |
void | Project (const vec3 &point, vec3 &result, layer_t layer) |
Projects a point into screen coordinates. More... | |
vec3 | ProjectInverse (vec3 point, layer_t layer) |
Reverses screen coordinates into world coordinates. More... | |
vertexformat_t | RegisterVertexFormat (const char *name) |
Allocates a new vertex format. More... | |
materialtype_t | RegisterMaterialType (const char *name) |
Allocates a new material type. More... | |
vertexformat_t | FindVertexFormat (const char *name) |
Finds an already allocated vertex format by its name. More... | |
materialtype_t | FindMaterialType (const char *name) |
Finds an already material type format by its name. More... | |
const char * | GetVertexFormatName (vertexformat_t type) |
Finds an allocated vertex format's name. More... | |
const char * | GetMaterialTypeName (materialtype_t type) |
Finds an allocated material type's name. More... | |
const color_t | COLOR_WHITE (1.0f, 1.0f, 1.0f) |
const color_t | COLOR_RED (1.0f, 0.0f, 0.0f) |
const color_t | COLOR_GREEN (0.0f, 1.0f, 0.0f) |
const color_t | COLOR_BLUE (0.0f, 0.0f, 1.0f) |
const color_t | COLOR_YELLOW (1.0f, 1.0f, 0.0f) |
const color_t | COLOR_PINK (1.0f, 0.0f, 1.0f) |
const color_t | COLOR_CYAN (0.0f, 1.0f, 1.0f) |
const color_t | COLOR_BLACK (0.0f, 0.0f, 0.0f) |
const color_t | COLOR_GRAY (0.3f, 0.3f, 0.3f) |
void | RegisterVertexDefinition (vertexformat_t format, VertexDefinition definition) |
Registers a VertexDefinition for a specified vertex format. More... | |
VertexDefinition | GetVertexDefinition (vertexformat_t format) |
Returns a previously registered VertexDefinition. More... | |
Variables | |
StackPool< uint8_t > | animation_pool ("animation keyframe pool", 1024 *1024) |
const size_t | BONE_COUNT = 30 |
struct { | |
vec3 tram::Render::view_position = {0.0f, 0.0f, 0.0f} | |
quat tram::Render::view_rotation = {1.0f, 0.0f, 0.0f, 0.0f} | |
float tram::Render::view_fov = 60.0f | |
float tram::Render::near_plane = 0.01f | |
float tram::Render::far_plane = 250.0f | |
float tram::Render::ortho_ratio = 1.0f | |
vec3 tram::Render::sun_direction = {0.0f, 1.0f, 0.0f} | |
vec3 tram::Render::sun_color = {1.0f, 1.0f, 1.0f} | |
vec3 tram::Render::ambient_color = {0.0f, 0.0f, 0.0f} | |
mat4 tram::Render::projection = mat4(1.0f) | |
mat4 tram::Render::view = mat4(1.0f) | |
} | view_properties [7] |
bool | THIRD_PERSON = false |
bool | DRAW_RENDER_DEBUG = false |
vertexarray_t | colorlines_vertex_array = {} |
drawlistentry_t | colorlines_entry |
vertexarray_t | debugtext_vertex_array = {} |
drawlistentry_t | debugtext_entry |
Sprite * | font_debug = nullptr |
std::vector< LineVertex > | colorlines |
std::vector< SpriteVertex > | textvertices |
typedef void* tram::Render::aabbleaf_t |
typedef vec3 tram::Render::color_t |
typedef uint32_t tram::Render::layer_t |
typedef uint32_t tram::Render::materialtype_t |
typedef std::pair<name_t, uint64_t> tram::Render::NameCount |
typedef uint32_t tram::Render::vertexformat_t |
enum tram::Render::renderflags : uint32_t |
Draws a cube for a single frame.
Draws a cylinder for a single frame.
Draws an AABB box for a single frame.
Draws a cross marker for a single frame.
Draws a sphere for a single frame.
void tram::Render::AddText | ( | float | x, |
float | y, | ||
const char * | text, | ||
color_t | color | ||
) |
Draws text, on the screen, for a single frame.
Draws text, in 3D space, for a single frame.
const color_t tram::Render::COLOR_BLACK | ( | 0. | 0f, |
0. | 0f, | ||
0. | 0f | ||
) |
const color_t tram::Render::COLOR_BLUE | ( | 0. | 0f, |
0. | 0f, | ||
1. | 0f | ||
) |
const color_t tram::Render::COLOR_CYAN | ( | 0. | 0f, |
1. | 0f, | ||
1. | 0f | ||
) |
const color_t tram::Render::COLOR_GRAY | ( | 0. | 3f, |
0. | 3f, | ||
0. | 3f | ||
) |
const color_t tram::Render::COLOR_GREEN | ( | 0. | 0f, |
1. | 0f, | ||
0. | 0f | ||
) |
const color_t tram::Render::COLOR_PINK | ( | 1. | 0f, |
0. | 0f, | ||
1. | 0f | ||
) |
const color_t tram::Render::COLOR_RED | ( | 1. | 0f, |
0. | 0f, | ||
0. | 0f | ||
) |
const color_t tram::Render::COLOR_WHITE | ( | 1. | 0f, |
1. | 0f, | ||
1. | 0f | ||
) |
const color_t tram::Render::COLOR_YELLOW | ( | 1. | 0f, |
1. | 0f, | ||
0. | 0f | ||
) |
materialtype_t tram::Render::FindMaterialType | ( | const char * | name | ) |
Finds an already material type format by its name.
vertexformat_t tram::Render::FindVertexFormat | ( | const char * | name | ) |
Finds an already allocated vertex format by its name.
const char * tram::Render::GetMaterialTypeName | ( | materialtype_t | type | ) |
Finds an allocated material type's name.
VertexDefinition tram::Render::GetVertexDefinition | ( | vertexformat_t | format | ) |
Returns a previously registered VertexDefinition.
const char * tram::Render::GetVertexFormatName | ( | vertexformat_t | type | ) |
Finds an allocated vertex format's name.
float tram::Render::GetViewDistance | ( | layer_t | layer | ) |
float tram::Render::GetViewFov | ( | layer_t | layer | ) |
void tram::Render::Init | ( | ) |
StaticModelData * tram::Render::MakeNewErrorModel | ( | ) |
Generates a new error model.
Generates a new error texture.
Projects a point into screen coordinates.
Reverses screen coordinates into world coordinates.
materialtype_t tram::Render::RegisterMaterialType | ( | const char * | name | ) |
Allocates a new material type.
void tram::Render::RegisterVertexDefinition | ( | vertexformat_t | format, |
VertexDefinition | definition | ||
) |
Registers a VertexDefinition for a specified vertex format.
vertexformat_t tram::Render::RegisterVertexFormat | ( | const char * | name | ) |
Allocates a new vertex format.
void tram::Render::Render | ( | ) |
Renders a single frame.
Sets the ambient color.
color | Ambient color. |
layer | Rendering layer to which the ambient color will be applied. |
void tram::Render::SetOrthoRatio | ( | float | ratio, |
layer_t | layer | ||
) |
void tram::Render::SetScreenSize | ( | float | width, |
float | height | ||
) |
Sets the sun color.
color | Color of the sun. |
layer | Rendering layer to which the sun color will be applied. |
Sets the sun direction.
direction | Normal vector pointing towards the sun. |
layer | Rendering layer to which the sun direction will be applied. |
void tram::Render::SetViewDistance | ( | float | dist, |
layer_t | layer | ||
) |
void tram::Render::SetViewFov | ( | float | fov, |
layer_t | layer | ||
) |
Sets the view position.
position | View position. |
layer | Rendering layer to which the view position will be applied. |
Sets the view rotation.
rotation | View rotation. |
layer | Rendering layer to which the view rotation will be applied. |
vec3 tram::Render::ambient_color = {0.0f, 0.0f, 0.0f} |
StackPool< uint8_t > tram::Render::animation_pool("animation keyframe pool", 1024 *1024) | ( | "animation keyframe pool" | , |
1024 * | 1024 | ||
) |
const size_t tram::Render::BONE_COUNT = 30 |
std::vector<LineVertex> tram::Render::colorlines |
drawlistentry_t tram::Render::colorlines_entry |
vertexarray_t tram::Render::colorlines_vertex_array = {} |
drawlistentry_t tram::Render::debugtext_entry |
vertexarray_t tram::Render::debugtext_vertex_array = {} |
bool tram::Render::DRAW_RENDER_DEBUG = false |
float tram::Render::far_plane = 250.0f |
Sprite* tram::Render::font_debug = nullptr |
float tram::Render::near_plane = 0.01f |
float tram::Render::ortho_ratio = 1.0f |
vec3 tram::Render::sun_color = {1.0f, 1.0f, 1.0f} |
vec3 tram::Render::sun_direction = {0.0f, 1.0f, 0.0f} |
std::vector<SpriteVertex> tram::Render::textvertices |
bool tram::Render::THIRD_PERSON = false |
float tram::Render::view_fov = 60.0f |
vec3 tram::Render::view_position = {0.0f, 0.0f, 0.0f} |
struct { ... } tram::Render::view_properties[7] |
quat tram::Render::view_rotation = {1.0f, 0.0f, 0.0f, 0.0f} |