Change Encyclo button name and macros icon
[ryzomcore.git] / nel / src / 3d / u_transformable.cpp
blob4561cce32f706a5f7cfb24eb22b6ec28b2d5e666
1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program 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 Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include "std3d.h"
19 #include "nel/3d/u_transformable.h"
20 #include "nel/3d/transformable.h"
22 #ifdef DEBUG_NEW
23 #define new DEBUG_NEW
24 #endif
26 namespace NL3D
29 // ***************************************************************************
31 const char *UTransformable::getPosValueName ()
33 return ITransformable::getPosValueName ();
36 // ***************************************************************************
38 const char *UTransformable::getRotEulerValueName()
40 return ITransformable::getRotEulerValueName();
43 // ***************************************************************************
45 const char *UTransformable::getRotQuatValueName()
47 return ITransformable::getRotQuatValueName();
50 // ***************************************************************************
52 const char *UTransformable::getScaleValueName()
54 return ITransformable::getScaleValueName();
57 // ***************************************************************************
59 const char *UTransformable::getPivotValueName()
61 return ITransformable::getPivotValueName();
64 // ***************************************************************************
66 void UTransformable::setMatrix(const CMatrix &mat)
68 _Object->setMatrix(mat);
71 // ***************************************************************************
73 const CMatrix &UTransformable::getMatrix() const
75 return _Object->getMatrix();
78 // ***************************************************************************
80 void UTransformable::setTransformMode(TTransformMode mode, CMatrix::TRotOrder ro)
82 _Object->setTransformMode((ITransformable::TTransformMode)(uint)mode, ro);
85 // ***************************************************************************
87 void UTransformable::setPos(const CVector &pos)
89 _Object->setPos(pos);
92 // ***************************************************************************
94 void UTransformable::setRotEuler(const CVector &rot)
96 _Object->setRotEuler(rot);
99 // ***************************************************************************
101 void UTransformable::setRotQuat(const CQuat &quat)
103 _Object->setRotQuat(quat);
106 // ***************************************************************************
108 void UTransformable::setRotQuat(const CVector &jdir)
110 CMatrix mat;
111 mat.setRot(CVector::I, jdir, CVector::K);
112 mat.normalize(CMatrix::YZX);
113 setRotQuat(mat.getRot());
116 // ***************************************************************************
118 void UTransformable::setRotQuat(const CVector &jdir, const CVector &vup)
120 CMatrix mat;
121 mat.setRot(CVector::I, jdir, vup);
122 mat.normalize(CMatrix::YZX);
123 setRotQuat(mat.getRot());
126 // ***************************************************************************
128 void UTransformable::setScale(const CVector &scale)
130 _Object->setScale(scale);
133 // ***************************************************************************
135 void UTransformable::setPivot(const CVector &pivot)
137 _Object->setPivot(pivot);
140 // ***************************************************************************
142 UTransformable::TTransformMode UTransformable::getTransformMode()
144 return (TTransformMode)(uint)_Object->getTransformMode();
147 // ***************************************************************************
149 CMatrix::TRotOrder UTransformable::getRotOrder()
151 return _Object->getRotOrder();
154 // ***************************************************************************
156 void UTransformable::getPos(CVector &pos)
158 _Object->getPos(pos);
161 // ***************************************************************************
163 void UTransformable::getRotEuler(CVector &rot)
165 _Object->getRotEuler(rot);
168 // ***************************************************************************
170 void UTransformable::getRotQuat(CQuat &quat)
172 _Object->getRotQuat(quat);
175 // ***************************************************************************
177 void UTransformable::getScale(CVector &scale)
179 _Object->getScale(scale);
182 // ***************************************************************************
184 void UTransformable::getPivot(CVector &pivot)
186 _Object->getPivot(pivot);
190 // ***************************************************************************
192 CVector UTransformable::getPos()
194 return _Object->getPos();
197 // ***************************************************************************
199 CVector UTransformable::getRotEuler()
201 return _Object->getRotEuler();
204 // ***************************************************************************
206 CQuat UTransformable::getRotQuat()
208 return _Object->getRotQuat();
211 // ***************************************************************************
213 CVector UTransformable::getScale()
215 return _Object->getScale();
218 // ***************************************************************************
220 CVector UTransformable::getPivot()
222 return _Object->getPivot();
225 // ***************************************************************************
227 void UTransformable::lookAt (const CVector& eye, const CVector& target, float roll)
229 _Object->lookAt(eye, target, roll);
232 // ***************************************************************************
235 } // NL3D