xoreos  0.0.5
location.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 NWN2 {
30 
31 Location::Location() : _area(0), _facing(0.0f) {
32  _position[0] = 0.0f;
33  _position[1] = 0.0f;
34  _position[2] = 0.0f;
35 }
36 
38 }
39 
41  return new Location(*this);
42 }
43 
45  return _area;
46 }
47 
48 void Location::setArea(Area *area) {
49  _area = area;
50 }
51 
52 void Location::getPosition(float &x, float &y, float &z) const {
53  x = _position[0];
54  y = _position[1];
55  z = _position[2];
56 }
57 
58 void Location::setPosition(float x, float y, float z) {
59  _position[0] = x;
60  _position[1] = y;
61  _position[2] = z;
62 }
63 
64 float Location::getFacing() const {
65  return _facing;
66 }
67 
68 void Location::setFacing(float facing) {
69  _facing = facing;
70 }
71 
72 } // End of namespace NWN2
73 
74 } // End of namespace Engines
float getFacing() const
Return the location&#39;s orientation.
Definition: location.cpp:64
An area in Neverwinter Nights 2, holding all objects, room tiles and terrain within, as well as general area properties like the current background music and ambient sounds.
Definition: area.h:65
Area * getArea() const
Return the location&#39;s area.
Definition: location.cpp:44
float _position[3]
The location&#39;s position.
Definition: location.h:62
A location within a Neverwinter Nights 2 area.
void getPosition(float &x, float &y, float &z) const
Return the location&#39;s position.
Definition: location.cpp:52
void setPosition(float x, float y, float z)
Set the location&#39;s position.
Definition: location.cpp:58
void setArea(Area *area)
Set the location&#39;s area.
Definition: location.cpp:48
Location * clone() const
Clone factory method.
Definition: location.cpp:40
void setFacing(float facing)
Set the location&#39;s orientation.
Definition: location.cpp:68
float _facing
The location&#39;s orientation.
Definition: location.h:63
Area * _area
The location&#39;s area.
Definition: location.h:60