xoreos  0.0.5
object.h
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 
25 #ifndef ENGINES_SONIC_OBJECT_H
26 #define ENGINES_SONIC_OBJECT_H
27 
28 #include "src/common/types.h"
29 #include "src/common/ustring.h"
30 
32 
34 
35 namespace Engines {
36 
37 namespace Sonic {
38 
41 public:
43  virtual ~Object();
44 
46  ObjectType getType() const;
47 
48  // Basic visuals
49 
50  virtual void show();
51  virtual void hide();
52 
53  // Basic properties
54 
56  uint32 getModelID() const;
57 
58  // Positioning
59 
61  virtual void getPosition(float &x, float &y, float &z) const;
63  virtual void getOrientation(float &x, float &y, float &z, float &angle) const;
64 
66  virtual void setPosition(float x, float y, float z);
68  virtual void setOrientation(float x, float y, float z, float angle);
69 
70  // Object/Cursor interactions
71 
72  virtual void enter();
73  virtual void leave();
74 
76  virtual void highlight(bool enabled);
77 
78 protected:
80 
82 
83  float _position[3];
84  float _orientation[4];
85 };
86 
87 } // End of namespace Sonic
88 
89 } // End of namespace Engines
90 
91 #endif // ENGINES_SONIC_OBJECT_H
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
Basic Sonic Chronicles: The Dark Brotherhood types and defines.
virtual void getPosition(float &x, float &y, float &z) const
Return the object&#39;s position within its area.
Definition: object.cpp:60
An object within a Sonic area.
Definition: object.h:40
float _orientation[4]
The object&#39;s orientation.
Definition: object.h:84
ObjectType getType() const
Return the exact type of the object.
Definition: object.cpp:46
Low-level type definitions to handle fixed width types portably.
virtual void highlight(bool enabled)
(Un)Highlight the object.
Definition: object.cpp:93
ObjectType _type
The object&#39;s type.
Definition: object.h:79
Unicode string handling.
float _position[3]
The object&#39;s position.
Definition: object.h:83
An NWScript object.
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
uint32 _modelID
The ID of the object&#39;s model.
Definition: object.h:81