zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Model Class Reference

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_Extentsget_extents () const
 Get the extents of the Model. More...
 
Lib3dsFile *constget_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 Vector3fget_scale () const
 Get the Model scale. More...
 
const Point3fget_translate () const
 Get the Model translation. More...
 
Modeloperator= (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 *constthun_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
 

Detailed Description

An Abstraction of a 3D Model.

The Model class is responsible for loading 3ds models into a Vertex_Buffer using lib3ds.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 105 of file Model.h.

Constructor & Destructor Documentation

Zeni::Model::Model ( const String filename,
const bool  align_normals_ = false 
)

The only way to create a Model.

Definition at line 173 of file Model.cpp.

Referenced by operator=().

Zeni::Model::Model ( const Model rhs)

Definition at line 189 of file Model.cpp.

Zeni::Model::~Model ( )

Definition at line 208 of file Model.cpp.

References lib3ds_file_free(), and visit_meshes().

Member Function Documentation

void Zeni::Model::do_normal_alignment ( const bool  align_normals_ = true)
inline

Definition at line 96 of file Model.hxx.

const Model_Extents & Zeni::Model::get_extents ( ) const
inline

Get the extents of the Model.

Definition at line 38 of file Model.hxx.

Lib3dsFile *const & Zeni::Model::get_file ( ) const
inline

Get the full 3ds file info.

Definition at line 28 of file Model.hxx.

const float & Zeni::Model::get_keyframe ( ) const
inline

Get the current (key)frame.

Definition at line 62 of file Model.hxx.

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().

std::pair< Vector3f, float > Zeni::Model::get_rotate ( ) const
inline

Get the Model rotation.

Definition at line 50 of file Model.hxx.

const Vector3f & Zeni::Model::get_scale ( ) const
inline

Get the Model scale.

Definition at line 44 of file Model.hxx.

const Point3f & Zeni::Model::get_translate ( ) const
inline

Get the Model translation.

Definition at line 56 of file Model.hxx.

Model & Zeni::Model::operator= ( const Model rhs)

Definition at line 217 of file Model.cpp.

References Model(), and swap().

void Zeni::Model::set_keyframe ( const float &  keyframe)

Set the current (key)frame; interpolation is automatic.

Definition at line 260 of file Model.cpp.

References lib3ds_file_eval().

void Zeni::Model::set_rotate ( const float &  angle,
const Vector3f ray 
)
inline

Rotate the Model.

Definition at line 78 of file Model.hxx.

Referenced by set_rotate().

void Zeni::Model::set_rotate ( const Quaternion quaternion)
inline

Rotate the Model.

Definition at line 85 of file Model.hxx.

References Zeni::Quaternion::get_rotation(), and set_rotate().

void Zeni::Model::set_scale ( const Vector3f multiplier)
inline

Scale the Model.

Definition at line 72 of file Model.hxx.

void Zeni::Model::set_translate ( const Point3f vector)
inline

Translate the Model.

Definition at line 90 of file Model.hxx.

Lib3dsFile *const & Zeni::Model::thun_get_file ( ) const
inline

Get the full 3ds file info - Thread Unsafe Version.

Definition at line 34 of file Model.hxx.

void Zeni::Model::visit_meshes ( Model_Visitor mv,
Lib3dsNode node = 0,
Lib3dsMesh *const mesh = 0 
) const
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.

bool Zeni::Model::will_do_normal_alignment ( ) const
inline

Definition at line 68 of file Model.hxx.


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