OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Model3D::Model3D Class Reference

#include <model3d.h>

Public Member Functions

 Model3D ()
 
 ~Model3D ()
 
bool load (const std::string &a_path)
 
unsigned int get_indices_count () const
 
unsigned int get_keyframes_count () const
 
floatget_positions () const
 
floatget_normals () const
 
floatget_texture_coordinates0 () const
 
floatget_tangents () const
 
unsigned intget_indices () const
 

Protected Attributes

bool m_has_animation
 True if the model has animation data. More...
 
bool m_has_materials
 True if the model has one or more materials. More...
 
bool m_has_indices
 True if the model has indexed data. More...
 
bool m_has_normals
 True if the model has normals. More...
 
bool m_has_texture_coordinates0
 True if the model has texture coordinates 0. More...
 
unsigned intm_vertices_count
 Total number of vertices in the model. More...
 
unsigned intm_indices_count
 Total number of indices in the model. More...
 
unsigned intm_bones_count
 Total number of bones in the model. More...
 
unsigned intm_keyframes_count
 Total number of keyframes in the model. More...
 
unsigned intm_materials_count
 Total number of materials in the model. More...
 
floatm_positions
 List of 3D Vertex Positions in the model. More...
 
floatm_texture_coordinates0
 List of 3D Texture Coordinates in the model. More...
 
floatm_normals
 List of 3D Normals in the model. More...
 
floatm_tangents
 List of 3D Tangents in the model. More...
 
floatm_weights
 List of 4D Weights in the model. More...
 
unsigned intm_bone_ids
 List of 4D Bone Ids in the model. More...
 
Material ** m_materials
 List of all the materials in the model. More...
 
unsigned intm_indices
 List of indices in the model. More...
 
Keyframe ** m_keyframes
 List of all keyframes for all bones. More...
 
char * m_geometry_buffer
 All the geometry data is loaded in this buffer. More...
 
char * m_tangent_buffer
 All the tangent data is loaded in this buffer. More...
 
char * m_animation_buffer
 All the animation data is loaded in this buffer. More...
 
floatm_bounding_box_minimum
 Bounding box minimum of the model. More...
 
floatm_bounding_box_maximum
 Bounding box maximum of the model. More...
 

Friends

class Model3DClientGL
 

Detailed Description

Objects of Model3D class contains one complete model. This class can be used to load *.geom files from filesystem. A model might contain only geometry or geometry and animation. Geometry data consists of 3D Positions, One or more set of 3D Texture Coordinates, 3D Normals, 3D Tangents and 3D Bitangents etc. Positions are a must but all other attributes are optional. A model might also contain optional one or more materials. If the model has animation data. It will be automatically loaded from the *.anim file. A model can have upto 50 bones. Each vertex can be influenced by a maximum of 4 bones. Animation data consists of keyframes for all bones. Each keyframe is a set of transformations for each bone and time. There can be one or more keyframes in an animation. All these classes are optimized for load time.

Definition at line 118 of file model3d.h.

Constructor & Destructor Documentation

Model3D::Model3D::Model3D ( )

Default constructor sets all pointers to NULL

Definition at line 105 of file model3d.cpp.

Model3D::Model3D::~Model3D ( )

Default destructor sets all pointers to NULL It also frees the momory allocated to m_geometry_buffer and m_animation_buffer

Definition at line 136 of file model3d.cpp.

Member Function Documentation

unsigned int * Model3D::Model3D::get_indices ( ) const

This method returns a list of indices in the model

Returns
indices

Definition at line 402 of file model3d.cpp.

unsigned int Model3D::Model3D::get_indices_count ( ) const

This method returns the indices count in the model

Returns
indices count

Definition at line 372 of file model3d.cpp.

unsigned int Model3D::Model3D::get_keyframes_count ( ) const

This method returns the keyframes count in the model

Returns
keyframes count

Definition at line 377 of file model3d.cpp.

float * Model3D::Model3D::get_normals ( ) const

This method returns a list of 3D Normals in the model

Returns
3D normals

Definition at line 387 of file model3d.cpp.

float * Model3D::Model3D::get_positions ( ) const

This method returns a list of 3D Vertex Positions in the model

Returns
3D vertex positions

Definition at line 382 of file model3d.cpp.

float * Model3D::Model3D::get_tangents ( ) const

This method returns a list of 3D Tangents in the model

Returns
3D tangents

Definition at line 397 of file model3d.cpp.

float * Model3D::Model3D::get_texture_coordinates0 ( ) const

This method returns a list of 3D Texture Coordinates in the model

Returns
3D texture coordinates

Definition at line 392 of file model3d.cpp.

bool Model3D::Model3D::load ( const std::string &  a_path)

Use this method to load a 'geom' file from filesystem If the model has animation data. It will be automatically loaded from the '.anim' file. the '.anim' file is searched in the folder where the '.geom' resides.

Warning
Data written with model3d exporter should have all member variables properly aligned otherwise this will fail.
Parameters
a_pathfull path to the file containing the geometry data on the filesystem
Returns
true if loading was successfull, false otherwise and look for error messages in the console

Definition at line 183 of file model3d.cpp.

Friends And Related Function Documentation

friend class Model3DClientGL
friend

Definition at line 122 of file model3d.h.

Member Data Documentation

char* Model3D::Model3D::m_animation_buffer
protected

All the animation data is loaded in this buffer.

Definition at line 215 of file model3d.h.

unsigned int* Model3D::Model3D::m_bone_ids
protected

List of 4D Bone Ids in the model.

Definition at line 206 of file model3d.h.

unsigned int* Model3D::Model3D::m_bones_count
protected

Total number of bones in the model.

Definition at line 197 of file model3d.h.

float* Model3D::Model3D::m_bounding_box_maximum
protected

Bounding box maximum of the model.

Definition at line 218 of file model3d.h.

float* Model3D::Model3D::m_bounding_box_minimum
protected

Bounding box minimum of the model.

Definition at line 217 of file model3d.h.

char* Model3D::Model3D::m_geometry_buffer
protected

All the geometry data is loaded in this buffer.

Definition at line 213 of file model3d.h.

bool Model3D::Model3D::m_has_animation
protected

True if the model has animation data.

Definition at line 189 of file model3d.h.

bool Model3D::Model3D::m_has_indices
protected

True if the model has indexed data.

Definition at line 191 of file model3d.h.

bool Model3D::Model3D::m_has_materials
protected

True if the model has one or more materials.

Definition at line 190 of file model3d.h.

bool Model3D::Model3D::m_has_normals
protected

True if the model has normals.

Definition at line 192 of file model3d.h.

bool Model3D::Model3D::m_has_texture_coordinates0
protected

True if the model has texture coordinates 0.

Definition at line 193 of file model3d.h.

unsigned int* Model3D::Model3D::m_indices
protected

List of indices in the model.

Definition at line 209 of file model3d.h.

unsigned int* Model3D::Model3D::m_indices_count
protected

Total number of indices in the model.

Definition at line 196 of file model3d.h.

Keyframe** Model3D::Model3D::m_keyframes
protected

List of all keyframes for all bones.

Definition at line 211 of file model3d.h.

unsigned int* Model3D::Model3D::m_keyframes_count
protected

Total number of keyframes in the model.

Definition at line 198 of file model3d.h.

Material** Model3D::Model3D::m_materials
protected

List of all the materials in the model.

Definition at line 207 of file model3d.h.

unsigned int* Model3D::Model3D::m_materials_count
protected

Total number of materials in the model.

Definition at line 199 of file model3d.h.

float* Model3D::Model3D::m_normals
protected

List of 3D Normals in the model.

Definition at line 203 of file model3d.h.

float* Model3D::Model3D::m_positions
protected

List of 3D Vertex Positions in the model.

Definition at line 201 of file model3d.h.

char* Model3D::Model3D::m_tangent_buffer
protected

All the tangent data is loaded in this buffer.

Definition at line 214 of file model3d.h.

float* Model3D::Model3D::m_tangents
protected

List of 3D Tangents in the model.

Definition at line 204 of file model3d.h.

float* Model3D::Model3D::m_texture_coordinates0
protected

List of 3D Texture Coordinates in the model.

Definition at line 202 of file model3d.h.

unsigned int* Model3D::Model3D::m_vertices_count
protected

Total number of vertices in the model.

Definition at line 195 of file model3d.h.

float* Model3D::Model3D::m_weights
protected

List of 4D Weights in the model.

Definition at line 205 of file model3d.h.


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