zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Model.hxx
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2  * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3  *
4  * zenilib is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * zenilib is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ZENI_MODEL_HXX
19 #define ZENI_MODEL_HXX
20 
21 #include <Zeni/Model.h>
22 #include <Zeni/Quaternion.h>
23 #include <Zeni/Vector3f.h>
24 
25 namespace Zeni {
26 
27 #ifndef TEMP_DISABLE
28  Lib3dsFile * const & Model::get_file() const {
29 // GUARANTEED_FINISHED_BEGIN(m_loader);
30  return m_file;
31 // GUARANTEED_FINISHED_END();
32  }
33 
34  Lib3dsFile * const & Model::thun_get_file() const {
35  return m_file;
36  }
37 
39 // GUARANTEED_FINISHED_BEGIN(m_loader);
40  return m_extents;
41 // GUARANTEED_FINISHED_END();
42  }
43 
44  const Vector3f & Model::get_scale() const {
45 // GUARANTEED_FINISHED_BEGIN(m_loader);
46  return m_scale;
47 // GUARANTEED_FINISHED_END();
48  }
49 
50  std::pair<Vector3f, float> Model::get_rotate() const {
51 // GUARANTEED_FINISHED_BEGIN(m_loader);
52  return std::make_pair(m_rotate, m_rotate_angle);
53 // GUARANTEED_FINISHED_END();
54  }
55 
56  const Point3f & Model::get_translate() const {
57 // GUARANTEED_FINISHED_BEGIN(m_loader);
58  return m_translate;
59 // GUARANTEED_FINISHED_END();
60  }
61 
62  const float & Model::get_keyframe() const {
63 // GUARANTEED_FINISHED_BEGIN(m_loader);
64  return m_keyframe;
65 // GUARANTEED_FINISHED_END();
66  }
67 
69  return m_align_normals;
70  }
71 
72  void Model::set_scale(const Vector3f &multiplier) {
73 // GUARANTEED_FINISHED_BEGIN(m_loader);
74  m_scale = multiplier;
75 // GUARANTEED_FINISHED_END();
76  }
77 
78  void Model::set_rotate(const float &angle, const Vector3f &ray) {
79 // GUARANTEED_FINISHED_BEGIN(m_loader);
80  m_rotate_angle = angle;
81  m_rotate = ray;
82 // GUARANTEED_FINISHED_END();
83  }
84 
85  void Model::set_rotate(const Quaternion &rotation) {
86  const std::pair<Vector3f, float> rayngel = rotation.get_rotation();
87  set_rotate(rayngel.second, rayngel.first);
88  }
89 
90  void Model::set_translate(const Point3f &vector) {
91 // GUARANTEED_FINISHED_BEGIN(m_loader);
92  m_translate = vector;
93 // GUARANTEED_FINISHED_END();
94  }
95 
96  void Model::do_normal_alignment(const bool align_normals_) {
97  m_align_normals = align_normals_;
98  }
99 #endif
100 
101 }
102 
103 #endif
const Point3f & get_translate() const
Get the Model translation.
Definition: Model.hxx:56
const float & get_keyframe() const
Get the current (key)frame.
Definition: Model.hxx:62
const Vector3f & get_scale() const
Get the Model scale.
Definition: Model.hxx:44
void set_rotate(const float &angle, const Vector3f &ray)
Rotate the Model.
Definition: Model.hxx:78
bool will_do_normal_alignment() const
Definition: Model.hxx:68
GLdouble angle
Definition: glew.h:8396
void set_scale(const Vector3f &multiplier)
Scale the Model.
Definition: Model.hxx:72
const Model_Extents & get_extents() const
Get the extents of the Model.
Definition: Model.hxx:38
A 3D Point represented with floats.
Definition: Coordinate.h:133
A Featureful 3-Space Vector Class.
Definition: Vector3f.h:58
std::pair< Vector3f, float > get_rotation() const
Get the rotation in radians left about an axis.
Definition: Quaternion.hxx:182
A Featureful Quaternion Class.
Definition: Quaternion.h:44
std::pair< Vector3f, float > get_rotate() const
Get the Model rotation.
Definition: Model.hxx:50
Lib3dsFile *const & thun_get_file() const
Get the full 3ds file info - Thread Unsafe Version.
Definition: Model.hxx:34
A visitor for determining the extents or bounds of a model.
Definition: Model.h:94
void set_translate(const Point3f &vector)
Translate the Model.
Definition: Model.hxx:90
void do_normal_alignment(const bool align_normals_=true)
Definition: Model.hxx:96
Lib3dsFile *const & get_file() const
Get the full 3ds file info.
Definition: Model.hxx:28