Browse Source

Physics: fixed cyclic header dependency.

pull/7/head
Vladimír Vondruš 13 years ago
parent
commit
4cda770f4f
  1. 8
      src/Physics/ObjectShape.cpp
  2. 12
      src/Physics/ObjectShape.h
  3. 5
      src/Physics/ObjectShapeGroup.h

8
src/Physics/ObjectShape.cpp

@ -30,6 +30,14 @@ template<std::uint8_t dimensions> ObjectShape<dimensions>::~ObjectShape() {
delete _shape;
}
template<std::uint8_t dimensions> ObjectShapeGroup<dimensions>* ObjectShape<dimensions>::group() {
return static_cast<ObjectShapeGroup<dimensions>*>(SceneGraph::AbstractGroupedFeature<dimensions, ObjectShape<dimensions>>::group());
}
template<std::uint8_t dimensions> const ObjectShapeGroup<dimensions>* ObjectShape<dimensions>::group() const {
return static_cast<const ObjectShapeGroup<dimensions>*>(SceneGraph::AbstractGroupedFeature<dimensions, ObjectShape<dimensions>>::group());
}
template<std::uint8_t dimensions> void ObjectShape<dimensions>::markDirty() {
group()->setDirty();
}

12
src/Physics/ObjectShape.h

@ -20,7 +20,7 @@
*/
#include "SceneGraph/AbstractGroupedFeature.h"
#include "ObjectShapeGroup.h"
#include "Physics/Physics.h"
#include "magnumPhysicsVisibility.h"
@ -106,14 +106,8 @@ template<std::uint8_t dimensions> class MAGNUM_PHYSICS_EXPORT ObjectShape: publi
*
* If the shape doesn't belong to any group, returns `nullptr`.
*/
inline ObjectShapeGroup<dimensions>* group() {
return static_cast<ObjectShapeGroup<dimensions>*>(SceneGraph::AbstractGroupedFeature<dimensions, ObjectShape<dimensions>>::group());
}
/** @overload */
inline const ObjectShapeGroup<dimensions>* group() const {
return static_cast<const ObjectShapeGroup<dimensions>*>(SceneGraph::AbstractGroupedFeature<dimensions, ObjectShape<dimensions>>::group());
}
ObjectShapeGroup<dimensions>* group();
const ObjectShapeGroup<dimensions>* group() const; /**< @overload */
protected:
/** Marks also the group as dirty */

5
src/Physics/ObjectShapeGroup.h

@ -22,8 +22,8 @@
#include <cstdint>
#include <vector>
#include "Physics/ObjectShape.h"
#include "SceneGraph/FeatureGroup.h"
#include "Physics.h"
#include "magnumPhysicsVisibility.h"
@ -93,7 +93,4 @@ typedef ObjectShapeGroup<3> ObjectShapeGroup3D;
}}
/* Make the definition complete */
#include "ObjectShape.h"
#endif

Loading…
Cancel
Save