zenilib: Zeni::Model Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
Zeni::Model Class Reference
Zenilib

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

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

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

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.

Referenced by render(), and ~Model().

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:

- zenilib/jni/external/zenilib/zeni_graphics/Zeni/Model.h
- zenilib/jni/external/zenilib/zeni_graphics/Model.cpp
- zenilib/jni/external/zenilib/zeni_graphics/Zeni/Model.hxx