zenilib
0.5.3.0
|
An Abstraction of a 3D Model. More...
#include <Model.h>
Public Member Functions | |
Model (const String &filename, const bool align_normals_=false) | |
The only way to create a Model. More... | |
Model (const Model &rhs) | |
~Model () | |
void | do_normal_alignment (const bool align_normals_=true) |
const Model_Extents & | get_extents () const |
Get the extents of the Model. More... | |
Lib3dsFile *const & | get_file () const |
Get the full 3ds file info. More... | |
const float & | get_keyframe () const |
Get the current (key)frame. More... | |
float | get_keyframes () const |
Get the number of keyframes; may be higher than you expect. More... | |
Point3f | get_position () const |
Get the position of the Model. More... | |
std::pair< Vector3f, float > | get_rotate () const |
Get the Model rotation. More... | |
const Vector3f & | get_scale () const |
Get the Model scale. More... | |
const Point3f & | get_translate () const |
Get the Model translation. More... | |
Model & | operator= (const Model &rhs) |
void | render () const |
void | set_keyframe (const float &keyframe) |
Set the current (key)frame; interpolation is automatic. More... | |
void | set_rotate (const float &angle, const Vector3f &ray) |
Rotate the Model. More... | |
void | set_rotate (const Quaternion &quaternion) |
Rotate the Model. More... | |
void | set_scale (const Vector3f &multiplier) |
Scale the Model. More... | |
void | set_translate (const Point3f &vector) |
Translate the Model. More... | |
Lib3dsFile *const & | thun_get_file () const |
Get the full 3ds file info - Thread Unsafe Version. More... | |
void | visit_meshes (Model_Visitor &mv, Lib3dsNode *node=0, Lib3dsMesh *const &mesh=0) const |
Visit all meshes. More... | |
void | visit_nodes (Model_Visitor &mv, Lib3dsNode *node=0) const |
Visit all nodes. More... | |
bool | will_do_normal_alignment () const |
An Abstraction of a 3D Model.
The Model class is responsible for loading 3ds models into a Vertex_Buffer using lib3ds.
Contact: bazal d@ze nipex .com
The only way to create a Model.
Definition at line 173 of file Model.cpp.
Referenced by operator=().
Zeni::Model::~Model | ( | ) |
Definition at line 208 of file Model.cpp.
References lib3ds_file_free(), and visit_meshes().
|
inline |
|
inline |
|
inline |
float Zeni::Model::get_keyframes | ( | ) | const |
Get the number of keyframes; may be higher than you expect.
Definition at line 254 of file Model.cpp.
References Lib3dsFile::frames.
Point3f Zeni::Model::get_position | ( | ) | const |
Get the position of the Model.
Definition at line 248 of file Model.cpp.
References Zeni::Quaternion::Axis_Angle(), and Zeni::Vector3f::multiply_by().
|
inline |
void Zeni::Model::render | ( | ) | const |
Definition at line 319 of file Model.cpp.
References Zeni::get_Video(), Zeni::Video::pop_world_stack(), Zeni::Video::push_world_stack(), Zeni::Video::rotate_scene(), Zeni::Video::scale_scene(), Zeni::Video::translate_scene(), and visit_meshes().
Set the current (key)frame; interpolation is automatic.
Definition at line 260 of file Model.cpp.
References lib3ds_file_eval().
|
inline |
Rotate the Model.
Definition at line 85 of file Model.hxx.
References Zeni::Quaternion::get_rotation(), and set_rotate().
|
inline |
void Zeni::Model::visit_meshes | ( | Model_Visitor & | mv, |
Lib3dsNode * | node = 0 , |
||
Lib3dsMesh *const & | mesh = 0 |
||
) | const |
Visit all meshes.
Definition at line 280 of file Model.cpp.
References Lib3dsNode::childs, lib3ds_file_mesh_by_name(), LIB3DS_NODE_MESH_INSTANCE, Lib3dsFile::meshes, Lib3dsNode::name, Lib3dsNode::next, Lib3dsFile::nmeshes, Lib3dsFile::nodes, and Lib3dsNode::type.
void Zeni::Model::visit_nodes | ( | Model_Visitor & | mv, |
Lib3dsNode * | node = 0 |
||
) | const |
Visit all nodes.
Definition at line 267 of file Model.cpp.
References Lib3dsNode::childs, Lib3dsNode::next, and Lib3dsFile::nodes.
|
inline |