xoreos  0.0.5
object.cpp
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
26 
27 namespace Engines {
28 
29 namespace Sonic {
30 
31 Object::Object(ObjectType type) : _type(type), _modelID(0xFFFFFFFF) {
32  _id = 0xFFFFFFFF;
33 
34  _position [0] = 0.0f;
35  _position [1] = 0.0f;
36  _position [2] = 0.0f;
37  _orientation[0] = 0.0f;
38  _orientation[1] = 0.0f;
39  _orientation[2] = 0.0f;
40  _orientation[3] = 0.0f;
41 }
42 
44 }
45 
47  return _type;
48 }
49 
50 void Object::show() {
51 }
52 
53 void Object::hide() {
54 }
55 
57  return _modelID;
58 }
59 
60 void Object::getPosition(float &x, float &y, float &z) const {
61  x = _position[0];
62  y = _position[1];
63  z = _position[2];
64 }
65 
66 void Object::getOrientation(float &x, float &y, float &z, float &angle) const {
67  x = _orientation[0];
68  y = _orientation[1];
69  z = _orientation[2];
70 
71  angle = _orientation[3];
72 }
73 
74 void Object::setPosition(float x, float y, float z) {
75  _position[0] = x;
76  _position[1] = y;
77  _position[2] = z;
78 }
79 
80 void Object::setOrientation(float x, float y, float z, float angle) {
81  _orientation[0] = x;
82  _orientation[1] = y;
83  _orientation[2] = z;
84  _orientation[3] = angle;
85 }
86 
87 void Object::enter() {
88 }
89 
90 void Object::leave() {
91 }
92 
93 void Object::highlight(bool UNUSED(enabled)) {
94 }
95 
96 } // End of namespace Sonic
97 
98 } // End of namespace Engines
virtual void getOrientation(float &x, float &y, float &z, float &angle) const
Return the object&#39;s orientation.
Definition: object.cpp:66
virtual void enter()
The cursor entered the object.
Definition: object.cpp:87
uint32 getModelID() const
Return the ID of the object&#39;s model.
Definition: object.cpp:56
virtual void getPosition(float &x, float &y, float &z) const
Return the object&#39;s position within its area.
Definition: object.cpp:60
float _orientation[4]
The object&#39;s orientation.
Definition: object.h:84
#define UNUSED(x)
Definition: system.h:170
ObjectType getType() const
Return the exact type of the object.
Definition: object.cpp:46
virtual void highlight(bool enabled)
(Un)Highlight the object.
Definition: object.cpp:93
ObjectType _type
The object&#39;s type.
Definition: object.h:79
float _position[3]
The object&#39;s position.
Definition: object.h:83
virtual void setOrientation(float x, float y, float z, float angle)
Set the object&#39;s orientation.
Definition: object.cpp:80
virtual void leave()
The cursor left the object.
Definition: object.cpp:90
virtual void show()
Show the object&#39;s model.
Definition: object.cpp:50
uint32_t uint32
Definition: types.h:204
virtual void setPosition(float x, float y, float z)
Set the object&#39;s position within its area.
Definition: object.cpp:74
virtual void hide()
Hide the object&#39;s model.
Definition: object.cpp:53
An object in a Sonic Chronicles: The Dark Brotherhood area.
uint32 _modelID
The ID of the object&#39;s model.
Definition: object.h:81