FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
object.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006-2012 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 // Standard C++ library includes
23 
24 // 3rd party library includes
25 
26 // FIFE includes
27 // These includes are split up in two parts, separated by one empty line
28 // First block: files included from the FIFE root src directory
29 // Second block: files included from the same folder
30 #include "util/base/exception.h"
31 
32 #include "object.h"
33 #include "action.h"
34 #include "ipather.h"
35 
36 namespace FIFE {
37 
39  m_area(""),
40  m_actions(NULL),
41  m_defaultAction(NULL),
42  m_blocking(false),
43  m_static(false),
44  m_cellStack(0) {
45  }
47  if (m_actions) {
48  std::map<std::string, Action*>::const_iterator i(m_actions->begin());
49  while (i != m_actions->end()) {
50  delete i->second;
51  ++i;
52  }
53  delete m_actions;
54  }
55  }
56 
58  m_pather(NULL),
59  m_costId(""),
60  m_cost(1.0),
61  m_speed(1.0),
62  m_zRange(0) {
63  }
65  }
66 
68  m_multiPart(false),
69  m_restrictedRotation(false) {
70  }
72  }
73 
74  Object::Object(const std::string& identifier, const std::string& name_space, Object* inherited):
75  m_id(identifier),
76  m_namespace(name_space),
77  m_filename(""),
78  m_inherited(inherited),
79  m_visual(NULL),
80  m_basicProperty(NULL),
81  m_moveProperty(NULL),
82  m_multiProperty(NULL) {
83  }
84 
86  delete m_visual;
87  delete m_basicProperty;
88  delete m_moveProperty;
89  delete m_multiProperty;
90  }
91 
92  Action* Object::createAction(const std::string& identifier, bool is_default) {
93  std::map<std::string, Action*>* actions;
94  if (!m_basicProperty) {
96  }
97 
98  if (!m_basicProperty->m_actions) {
99  m_basicProperty->m_actions = new std::map<std::string, Action*>;
100  }
101  actions = m_basicProperty->m_actions;
102 
103  std::map<std::string, Action*>::const_iterator it = actions->begin();
104  for(; it != actions->end(); ++it) {
105  if(identifier == it->second->getId()) {
106  throw NameClash(identifier);
107  }
108  }
109 
110  Action* a = getAction(identifier, false);
111  if (!a) {
112  a = new Action(identifier);
113  (*actions)[identifier] = a;
114  if (is_default || (!m_basicProperty->m_defaultAction)) {
116  }
117  }
118  return a;
119  }
120 
121  Action* Object::getAction(const std::string& identifier, bool deepsearch) const {
122  std::map<std::string, Action*>* actions = NULL;
123  if (m_basicProperty) {
124  actions = m_basicProperty->m_actions;
125  }
126 
127  std::map<std::string, Action*>::const_iterator i;
128  if (actions) {
129  i = actions->find(identifier);
130  }
131  if ((!actions) || (i == actions->end())) {
132  if (m_inherited && deepsearch) {
133  return m_inherited->getAction(identifier);
134  }
135  return NULL;
136  }
137  return i->second;
138  }
139 
140  std::list<std::string> Object::getActionIds() const {
141  std::map<std::string, Action*>* actions = NULL;
142  if (m_basicProperty) {
143  actions = m_basicProperty->m_actions;
144  }
145  std::list<std::string> action_ids;
146  if (actions) {
147  std::map<std::string, Action*>::const_iterator actions_it = actions->begin();
148  for(; actions_it != actions->end(); ++actions_it) {
149  action_ids.push_back(actions_it->first);
150  }
151  }
152  return action_ids;
153  }
154 
155  void Object::setDefaultAction(const std::string& identifier) {
156  std::map<std::string, Action*>::const_iterator i;
157  Action* action = NULL;
158  std::map<std::string, Action*>* actions = NULL;
159  if (m_basicProperty) {
160  actions = m_basicProperty->m_actions;
161  }
162  if (actions) {
163  i = actions->find(identifier);
164  }
165  if ((!actions) || (i == actions->end())) {
166  if (m_inherited) {
167  action = m_inherited->getAction(identifier);
168  }
169  } else {
170  action = i->second;
171  }
172 
173  if (action && m_basicProperty) {
175  }
176  }
177 
179  if (m_basicProperty) {
181  }
182  if (m_inherited) {
183  return m_inherited->getDefaultAction();
184  }
185  return NULL;
186  }
187 
188  void Object::setPather(IPather* pather) {
189  if (!m_moveProperty) {
191  }
192  m_moveProperty->m_pather = pather;
193  }
194 
196  if (m_moveProperty) {
197  return m_moveProperty->m_pather;
198  }
199  if (m_inherited) {
200  return m_inherited->getPather();
201  }
202  return NULL;
203  }
204 
206  return m_inherited;
207  }
208 
209  void Object::adoptVisual(IVisual* visual) {
210  if (m_visual && m_visual != visual) {
211  delete m_visual;
212  }
213  m_visual = visual;
214  }
215 
216  void Object::setBlocking(bool blocking) {
217  if (!m_basicProperty) {
219  }
220  m_basicProperty->m_blocking = blocking;
221  }
222 
223  bool Object::isBlocking() const {
224  if (m_basicProperty) {
225  return m_basicProperty->m_blocking;
226  }
227  if (m_inherited) {
228  return m_inherited->isBlocking();
229  }
230  return false;
231  }
232 
233  void Object::setStatic(bool stat) {
234  if (!m_basicProperty) {
236  }
237  m_basicProperty->m_static = stat;
238  }
239 
240  bool Object::isStatic() const {
241  if (!m_basicProperty) {
242  if (m_inherited) {
243  return m_inherited->isStatic();
244  }
245  return false;
246  }
247  return m_basicProperty->m_static;
248  }
249 
250  void Object::setFilename(const std::string& file) {
251  m_filename = file;
252  }
253 
254  const std::string& Object::getFilename() const {
255  return m_filename;
256  }
257 
259  if (!m_basicProperty) {
261  }
262  m_basicProperty->m_cellStack = position;
263  }
264 
266  if (m_basicProperty) {
268  }
269  if (m_inherited) {
271  }
272  return 0;
273  }
274 
275  bool Object::isSpecialCost() const {
276  if (m_moveProperty) {
277  return m_moveProperty->m_costId != "";
278  }
279  if (m_inherited) {
280  return m_inherited->isSpecialCost();
281  }
282  return false;
283  }
284 
285  void Object::setCostId(const std::string& cost) {
286  if (!m_moveProperty) {
288  }
289  m_moveProperty->m_costId = cost;
290  }
291 
292  std::string Object::getCostId() const {
293  if (m_moveProperty) {
294  return m_moveProperty->m_costId;
295  }
296  if (m_inherited) {
297  return m_inherited->getCostId();
298  }
299  return "";
300  }
301 
302  void Object::setCost(double cost) {
303  if (!m_moveProperty) {
305  }
306  m_moveProperty->m_cost = cost;
307  }
308 
309  double Object::getCost() const {
310  if (m_moveProperty) {
311  return m_moveProperty->m_cost;
312  }
313  if (m_inherited) {
314  return m_inherited->getCost();
315  }
316  return 1.0;
317  }
318 
319  bool Object::isSpecialSpeed() const {
320  if (m_moveProperty) {
321  return !Mathd::Equal(m_moveProperty->m_speed, 1.0);
322  }
323  if (m_inherited) {
324  return m_inherited->isSpecialSpeed();
325  }
326  return false;
327  }
328 
329  void Object::setSpeed(double speed) {
330  if (!m_moveProperty) {
332  }
333  m_moveProperty->m_speed = speed;
334  }
335 
336  double Object::getSpeed() const {
337  if (m_moveProperty) {
338  return m_moveProperty->m_speed;
339  }
340  if (m_inherited) {
341  return m_inherited->getSpeed();
342  }
343  return 1.0;
344  }
345 
346  bool Object::isMultiObject() const {
347  if (m_multiProperty) {
348  return !m_multiProperty->m_multiPartIds.empty();
349  }
350  if (m_inherited) {
351  return m_inherited->isMultiObject();
352  }
353  return false;
354  }
355 
356  void Object::addMultiPartId(const std::string& partId) {
357  if (!m_multiProperty) {
359  }
360  m_multiProperty->m_multiPartIds.push_back(partId);
361  }
362 
363  std::list<std::string> Object::getMultiPartIds() const {
364  if (m_multiProperty) {
366  }
367  if (m_inherited) {
368  return m_inherited->getMultiPartIds();
369  }
370  return std::list<std::string>();
371  }
372 
373  void Object::removeMultiPartId(const std::string& partId) {
374  if (!m_multiProperty) {
375  return;
376  }
377  std::list<std::string>::iterator it = m_multiProperty->m_multiPartIds.begin();
378  for (; it != m_multiProperty->m_multiPartIds.end(); ++it) {
379  if (*it == partId) {
380  m_multiProperty->m_multiPartIds.erase(it);
381  break;
382  }
383  }
384  }
385 
387  if (!m_multiProperty) {
388  return;
389  }
391  }
392 
393  bool Object::isMultiPart() const {
394  if (m_multiProperty) {
396  }
397  if (m_inherited) {
398  return m_inherited->isMultiPart();
399  }
400  return false;
401  }
402 
403  void Object::setMultiPart(bool part) {
404  if (!m_multiProperty) {
406  }
408  }
409 
411  if (!m_multiProperty) {
413  }
414  m_multiProperty->m_multiParts.insert(obj);
415  }
416 
417  std::set<Object*> Object::getMultiParts() const {
418  if (m_multiProperty) {
420  }
421  if (m_inherited) {
422  return m_inherited->getMultiParts();
423  }
424  return std::set<Object*>();
425  }
426 
428  if (!m_multiProperty) {
429  return;
430  }
431  m_multiProperty->m_multiParts.erase(obj);
432 
433  }
434 
436  if (!m_multiProperty) {
437  return;
438  }
439  m_multiProperty->m_multiParts.clear();
440  }
441 
442  void Object::addMultiPartCoordinate(int32_t rotation, ModelCoordinate coord) {
443  if (!m_multiProperty) {
445  }
446  m_multiProperty->m_multiPartCoordinates.insert(std::pair<int32_t, ModelCoordinate>(rotation, coord));
447  m_multiProperty->m_partAngleMap[rotation] = rotation;
448  }
449 
450  std::multimap<int32_t, ModelCoordinate> Object::getMultiPartCoordinates() const {
451  if (m_multiProperty) {
453  }
454  if (m_inherited) {
456  }
457  return std::multimap<int32_t, ModelCoordinate>();
458  }
459 
460  std::vector<ModelCoordinate> Object::getMultiPartCoordinates(int32_t rotation) const {
461  std::vector<ModelCoordinate> coordinates;
462 
463  if (m_multiProperty) {
464  int32_t closest = 0;
465  getIndexByAngle(rotation, m_multiProperty->m_partAngleMap, closest);
466  std::pair<std::multimap<int32_t, ModelCoordinate>::iterator,
467  std::multimap<int32_t, ModelCoordinate>::iterator> result = m_multiProperty->m_multiPartCoordinates.equal_range(closest);
468  std::multimap<int32_t, ModelCoordinate>::iterator it = result.first;
469  for (; it != result.second; ++it) {
470  coordinates.push_back((*it).second);
471  }
472  } else if (m_inherited) {
473  return m_inherited->getMultiPartCoordinates(rotation);
474  }
475  return coordinates;
476  }
477 
478  std::vector<ModelCoordinate> Object::getMultiObjectCoordinates(int32_t rotation) const {
479  std::vector<ModelCoordinate> coordinates;
480  if (m_multiProperty) {
482  std::set<Object*>::iterator subit = m_multiProperty->m_multiParts.begin();
483  for (; subit != m_multiProperty->m_multiParts.end(); ++subit) {
484  const std::multimap<int32_t, ModelCoordinate>& subcoords = (*subit)->getMultiPartCoordinates();
485  m_multiProperty->m_multiObjectCoordinates.insert(subcoords.begin(), subcoords.end());
486  }
487  std::multimap<int32_t, ModelCoordinate>::iterator it = m_multiProperty->m_multiObjectCoordinates.begin();
488  for (; it != m_multiProperty->m_multiObjectCoordinates.end(); ++it) {
489  m_multiProperty->m_multiAngleMap[(*it).first] = (*it).first;
490  }
491  }
492  int32_t closest = 0;
493  getIndexByAngle(rotation, m_multiProperty->m_multiAngleMap, closest);
494  std::pair<std::multimap<int32_t, ModelCoordinate>::iterator,
495  std::multimap<int32_t, ModelCoordinate>::iterator> result = m_multiProperty->m_multiObjectCoordinates.equal_range(closest);
496  std::multimap<int32_t, ModelCoordinate>::iterator it = result.first;
497  ModelCoordinate parent(0,0);
498  coordinates.push_back(parent);
499  for (; it != result.second; ++it) {
500  coordinates.push_back((*it).second);
501  }
502  } else if (m_inherited) {
503  return m_inherited->getMultiObjectCoordinates(rotation);
504  }
505  return coordinates;
506  }
507 
509  if (!m_multiProperty) {
511  }
513  }
514 
516  if (m_multiProperty) {
518  }
519  if (m_inherited) {
520  return m_inherited->getRotationAnchor();
521  }
522  return ExactModelCoordinate();
523  }
524 
525  void Object::setRestrictedRotation(bool restrict) {
526  if (!m_multiProperty) {
528  }
530  }
531 
533  if (m_multiProperty) {
535  }
536  if (m_inherited) {
538  }
539  return false;
540  }
541 
542  int32_t Object::getRestrictedRotation(int32_t rotation) {
543  int32_t closest = rotation;
544  if (m_multiProperty) {
545  if (!m_multiProperty->m_multiAngleMap.empty()) {
546  getIndexByAngle(rotation, m_multiProperty->m_multiAngleMap, closest);
547  } else if (!m_multiProperty->m_partAngleMap.empty()) {
548  getIndexByAngle(rotation, m_multiProperty->m_partAngleMap, closest);
549  }
550  } else if (m_inherited) {
551  return m_inherited->getRestrictedRotation(rotation);
552  }
553  return closest;
554  }
555 
556  void Object::setZStepRange(int32_t zRange) {
557  if (!m_moveProperty) {
559  }
560  m_moveProperty->m_zRange = zRange;
561  }
562 
563  int32_t Object::getZStepRange() const {
564  if (m_moveProperty) {
565  return m_moveProperty->m_zRange;
566  }
567  if (m_inherited) {
568  return m_inherited->getZStepRange();
569  }
570  return 0;
571  }
572 
573  void Object::setArea(const std::string& id) {
574  if (!m_basicProperty) {
576  }
577  m_basicProperty->m_area = id;
578  }
579 
580  std::string Object::getArea() const {
581  if (m_basicProperty) {
582  return m_basicProperty->m_area;
583  }
584  if (m_inherited) {
585  return m_inherited->getArea();
586  }
587  return "";
588  }
589 
590  void Object::addWalkableArea(const std::string& id) {
591  if (!m_moveProperty) {
593  }
594  m_moveProperty->m_walkableAreas.push_back(id);
597  }
598 
599  void Object::removeWalkableArea(const std::string& id) {
600  if (!m_moveProperty) {
601  return;
602  }
603  m_moveProperty-> m_walkableAreas.remove(id);
604  }
605 
606  std::list<std::string> Object::getWalkableAreas() const {
607  if (m_moveProperty) {
609  }
610  if (m_inherited) {
611  return m_inherited->getWalkableAreas();
612  }
613  return std::list<std::string>();
614  }
615 
616  bool Object::operator==(const Object& obj) const {
617  return m_id == obj.getId() && m_namespace == obj.getNamespace();
618  }
619 
620  bool Object::operator!=(const Object& obj) const {
621  return m_id != obj.getId() || m_namespace != obj.getNamespace();
622  }
623 
624 }
double m_speed
speed modifier, default 1.0
Definition: object.h:406
MultiObjectProperty()
Constructor.
Definition: object.cpp:67
std::list< std::string > getWalkableAreas() const
Returns a list that contains all walkable area ids.
Definition: object.cpp:606
bool operator==(const Object &obj) const
Compares equality of two objects.
Definition: object.cpp:616
const std::string & getFilename() const
Definition: object.cpp:254
Action * getAction(const std::string &identifier, bool deepsearch=true) const
Gets action with given id.
Definition: object.cpp:121
void setDefaultAction(const std::string &identifier)
Sets default action assigned to this object.
Definition: object.cpp:155
std::string getCostId() const
Returns the cost id.
Definition: object.cpp:292
MovableObjectProperty()
Constructor.
Definition: object.cpp:57
void removeMultiPart(Object *obj)
Removes a multi part object.
Definition: object.cpp:427
IPather * getPather() const
Gets associated pather.
Definition: object.cpp:195
~Object()
Destructor.
Definition: object.cpp:85
void removeWalkableArea(const std::string &id)
Removes an area id from walkable areas.
Definition: object.cpp:599
std::vector< ModelCoordinate > getMultiObjectCoordinates(int32_t rotation) const
Returns all multi object coordinates for the given rotation.
Definition: object.cpp:478
double getSpeed() const
Returns the speed modifier.
Definition: object.cpp:336
void setArea(const std::string &id)
Sets the area id that the instances of this object adds to their cells.
Definition: object.cpp:573
void adoptVisual(IVisual *visual)
Sets visualization to be used.
Definition: object.cpp:209
Object class.
Definition: object.h:51
void setRotationAnchor(const ExactModelCoordinate &anchor)
Sets the rotation anchor for this multi object.
Definition: object.cpp:508
Action * m_defaultAction
pointer to default action
Definition: object.h:375
IPather * m_pather
pointer to pathfinder
Definition: object.h:397
void setCellStackPosition(uint8_t position)
Sets the cell stack position.
Definition: object.cpp:258
int32_t m_zRange
z range value
Definition: object.h:409
uint8_t m_cellStack
position on cellstack
Definition: object.h:385
~BasicObjectProperty()
Destructor.
Definition: object.cpp:46
void setZStepRange(int32_t zRange)
Sets z-step range for object.
Definition: object.cpp:556
Object(const std::string &identifier, const std::string &name_space, Object *inherited=NULL)
Constructor An object may optionally inherit default attributes from another object.
Definition: object.cpp:74
void setFilename(const std::string &file)
Definition: object.cpp:250
std::list< std::string > m_multiPartIds
list with part identifiers
Definition: object.h:430
std::string m_namespace
namespace
Definition: object.h:349
type_angle2id m_multiAngleMap
multi object angles
Definition: object.h:442
std::string m_area
area id
Definition: object.h:369
const std::string & getId() const
Definition: object.h:68
bool m_blocking
indicates if object blocks
Definition: object.h:378
std::string getArea() const
Gets the area id that the instances of this object adds to their cells.
Definition: object.cpp:580
double getCost() const
Returns the cost.
Definition: object.cpp:309
std::string m_costId
cost identifier
Definition: object.h:400
void removeAllMultiPartIds()
Removes all multi part identifiers.
Definition: object.cpp:386
void removeMultiPartId(const std::string &partId)
Removes a multi part identifier.
Definition: object.cpp:373
uint8_t getCellStackPosition() const
Returns cell stack position.
Definition: object.cpp:265
MovableObjectProperty * m_moveProperty
Definition: object.h:452
unsigned char uint8_t
Definition: core.h:38
bool isStatic() const
Gets if object moves.
Definition: object.cpp:240
void setMultiPart(bool part)
Sets the object as a part of a multi object.
Definition: object.cpp:403
std::string m_id
identifier
Definition: object.h:346
bool operator!=(const Object &obj) const
Compares unequality of two objects.
Definition: object.cpp:620
static bool Equal(T _val1, T _val2)
Definition: fife_math.h:287
std::set< Object * > m_multiParts
set contains part objects
Definition: object.h:436
const std::string & getNamespace() const
Definition: object.h:69
void setRestrictedRotation(bool restrict)
Sets the rotation to restricted.
Definition: object.cpp:525
void addMultiPartCoordinate(int32_t rotation, ModelCoordinate coord)
Adds rotationally dependent coordinates for this object part.
Definition: object.cpp:442
std::multimap< int32_t, ModelCoordinate > m_multiObjectCoordinates
multi object coordinates
Definition: object.h:448
BasicObjectProperty * m_basicProperty
Definition: object.h:451
std::list< std::string > getActionIds() const
Gets all available action ids of the object and packs them into a list.
Definition: object.cpp:140
bool isRestrictedRotation() const
Gets if object uses restricted rotations.
Definition: object.cpp:532
bool isBlocking() const
Gets if object blocks movement.
Definition: object.cpp:223
bool isMultiObject() const
Gets if object uses special cost.
Definition: object.cpp:346
type_angle2id m_partAngleMap
part object angles
Definition: object.h:439
Object * m_inherited
pointer to inherited object
Definition: object.h:355
void setCost(double cost)
Sets the cost.
Definition: object.cpp:302
ExactModelCoordinate getRotationAnchor() const
Returns the rotation anchor for this multi object.
Definition: object.cpp:515
void removeMultiParts()
Removes all multi part objects.
Definition: object.cpp:435
Object * getInherited() const
Gets an object where this object was inherited from.
Definition: object.cpp:205
Action * createAction(const std::string &identifier, bool is_default=false)
Adds new action with given id.
Definition: object.cpp:92
MultiObjectProperty * m_multiProperty
Definition: object.h:453
std::multimap< int32_t, ModelCoordinate > getMultiPartCoordinates() const
Returns all rotationally dependent coordinates from this object part.
Definition: object.cpp:450
std::string m_filename
filename
Definition: object.h:352
void addMultiPart(Object *obj)
Adds a object as a part of a multi object.
Definition: object.cpp:410
std::list< std::string > m_walkableAreas
list contains walkable area ids
Definition: object.h:412
double m_cost
cost value, default 1.0
Definition: object.h:403
DoublePoint3D ExactModelCoordinate
Definition: modelcoords.h:37
void addMultiPartId(const std::string &partId)
Adds a multi part identifier.
Definition: object.cpp:356
std::multimap< int32_t, ModelCoordinate > m_multiPartCoordinates
part object coordinates
Definition: object.h:445
void setStatic(bool stat)
Set to true, if object is such that it doesn&#39;t move.
Definition: object.cpp:233
std::list< std::string > getMultiPartIds() const
Returns all multi part identifiers.
Definition: object.cpp:363
A 3D Point.
Definition: point.h:205
Action * getDefaultAction() const
Gets default action assigned to this object.
Definition: object.cpp:178
int32_t getZStepRange() const
Returns z-step range from object.
Definition: object.cpp:563
std::map< std::string, Action * > * m_actions
holds action ids and assigned actions
Definition: object.h:372
int32_t getIndexByAngle(int32_t angle, const type_angle2id &angle2id, int32_t &closestMatchingAngle)
Returns id for given angle from angle2id map in case there are no elements in the map...
Definition: angles.cpp:37
bool m_multiPart
indicates if object is part of multi object
Definition: object.h:424
void addWalkableArea(const std::string &id)
Adds an area id to walkable area.
Definition: object.cpp:590
std::set< Object * > getMultiParts() const
Returns all multi part objects.
Definition: object.cpp:417
void setPather(IPather *pather)
Sets pather used by instances created out of this object.
Definition: object.cpp:188
bool m_restrictedRotation
indicates if object uses only restricted rotations
Definition: object.h:427
bool m_static
indicates if object is static
Definition: object.h:382
void setBlocking(bool blocking)
Sets if object blocks movement.
Definition: object.cpp:216
bool isSpecialSpeed() const
Gets if object uses special speed modifier.
Definition: object.cpp:319
BasicObjectProperty()
Constructor.
Definition: object.cpp:38
void setSpeed(double cost)
Sets the speed modifier.
Definition: object.cpp:329
~MovableObjectProperty()
Destructor.
Definition: object.cpp:64
bool isSpecialCost() const
Gets if object uses special cost.
Definition: object.cpp:275
int32_t getRestrictedRotation(int32_t rotation)
Returns the most obvious rotation, based on multi coordinates.
Definition: object.cpp:542
ExactModelCoordinate m_rotationAnchor
rotation anchor
Definition: object.h:433
void setCostId(const std::string &cost)
Sets the cost id.
Definition: object.cpp:285
bool isMultiPart() const
Gets if object is a part of a multi object.
Definition: object.cpp:393
~MultiObjectProperty()
Destructor.
Definition: object.cpp:71
IVisual * m_visual
pointer to object visual
Definition: object.h:358