Tramway SDK
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
tram::Render::Model Class Reference

#include <model.h>

Inheritance diagram for tram::Render::Model:
tram::Resource

Public Member Functions

 Model (name_t name)
 
void LoadFromDisk ()
 
void LoadFromMemory ()
 
void Unload ()
 
vertexformat_t GetVertexFormat () const
 
vertexarray_t GetVertexArray () const
 
indexarray_t GetIndexArray () const
 
const std::vector< Bone > & GetArmature () const
 
const std::vector< Material * > & GetMaterials () const
 
const std::vector< IndexRange > & GetIndexRanges () const
 
void DrawAABB (vec3 position, quat rotation)
 
void FindAllFromRay (vec3 ray_pos, vec3 ray_dir, std::vector< AABBTriangle > &result)
 
vec3 GetAABBMin () const
 
vec3 GetAABBMax () const
 
- Public Member Functions inherited from tram::Resource
 Resource (name_t name)
 
Resource::Status GetStatus () const
 
name_t GetName () const
 
size_t GetReferences () const
 
bool IsLoadFailed () const
 
void AddReference ()
 
void RemoveReference ()
 
void Load ()
 

Static Public Member Functions

static ModelFind (name_t name)
 

Protected Attributes

vertexformat_t vertex_format = VERTEX_STATIC
 
vertexarray_t vertex_array = {.generic = 0}
 
indexarray_t index_array = {.generic = 0}
 
std::vector< IndexRangeindex_ranges
 
vec3 aabb_min
 
vec3 aabb_max
 
std::vector< Material * > materials
 
Modelsource = nullptr
 
std::vector< Bonearmature
 
ModelDatamodel_data = nullptr
 
ModelAABBmodel_aabb = nullptr
 
size_t approx_vram_usage = 0
 
- Protected Attributes inherited from tram::Resource
Status status = UNLOADED
 
name_t name
 
bool load_fail = false
 
size_t references = 0
 

Additional Inherited Members

- Public Types inherited from tram::Resource
enum  Status { UNLOADED , LOADED , READY }
 

Constructor & Destructor Documentation

◆ Model()

tram::Render::Model::Model ( name_t  name)
inline

Member Function Documentation

◆ DrawAABB()

void tram::Render::Model::DrawAABB ( vec3  position,
quat  rotation 
)

◆ Find()

Model * tram::Render::Model::Find ( name_t  name)
static

◆ FindAllFromRay()

void tram::Render::Model::FindAllFromRay ( vec3  ray_pos,
vec3  ray_dir,
std::vector< AABBTriangle > &  result 
)

◆ GetAABBMax()

vec3 tram::Render::Model::GetAABBMax ( ) const
inline

◆ GetAABBMin()

vec3 tram::Render::Model::GetAABBMin ( ) const
inline

◆ GetArmature()

const std::vector< Bone > & tram::Render::Model::GetArmature ( ) const
inline

◆ GetIndexArray()

indexarray_t tram::Render::Model::GetIndexArray ( ) const
inline

◆ GetIndexRanges()

const std::vector< IndexRange > & tram::Render::Model::GetIndexRanges ( ) const
inline

◆ GetMaterials()

const std::vector< Material * > & tram::Render::Model::GetMaterials ( ) const
inline

◆ GetVertexArray()

vertexarray_t tram::Render::Model::GetVertexArray ( ) const
inline

◆ GetVertexFormat()

vertexformat_t tram::Render::Model::GetVertexFormat ( ) const
inline

◆ LoadFromDisk()

void tram::Render::Model::LoadFromDisk ( )
virtual

Implements tram::Resource.

◆ LoadFromMemory()

void tram::Render::Model::LoadFromMemory ( )
virtual

Implements tram::Resource.

◆ Unload()

void tram::Render::Model::Unload ( )
inlinevirtual

Implements tram::Resource.

Member Data Documentation

◆ aabb_max

vec3 tram::Render::Model::aabb_max
protected

◆ aabb_min

vec3 tram::Render::Model::aabb_min
protected

◆ approx_vram_usage

size_t tram::Render::Model::approx_vram_usage = 0
protected

◆ armature

std::vector<Bone> tram::Render::Model::armature
protected

◆ index_array

indexarray_t tram::Render::Model::index_array = {.generic = 0}
protected

◆ index_ranges

std::vector<IndexRange> tram::Render::Model::index_ranges
protected

◆ materials

std::vector<Material*> tram::Render::Model::materials
protected

◆ model_aabb

ModelAABB* tram::Render::Model::model_aabb = nullptr
protected

◆ model_data

ModelData* tram::Render::Model::model_data = nullptr
protected

◆ source

Model* tram::Render::Model::source = nullptr
protected

◆ vertex_array

vertexarray_t tram::Render::Model::vertex_array = {.generic = 0}
protected

◆ vertex_format

vertexformat_t tram::Render::Model::vertex_format = VERTEX_STATIC
protected

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