|
|
|
@ -21,6 +21,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include "AbstractShape.h" |
|
|
|
#include "AbstractShape.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "Line.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace Magnum { namespace Physics { |
|
|
|
namespace Magnum { namespace Physics { |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Infinite plane, defined by position and normal */ |
|
|
|
/** @brief Infinite plane, defined by position and normal */ |
|
|
|
@ -31,6 +33,8 @@ class PHYSICS_EXPORT Plane: public AbstractShape { |
|
|
|
|
|
|
|
|
|
|
|
void applyTransformation(const Matrix4& transformation); |
|
|
|
void applyTransformation(const Matrix4& transformation); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool collides(const AbstractShape* other) const; |
|
|
|
|
|
|
|
|
|
|
|
/** @brief Position */ |
|
|
|
/** @brief Position */ |
|
|
|
inline Vector3 position() const { return _position; } |
|
|
|
inline Vector3 position() const { return _position; } |
|
|
|
|
|
|
|
|
|
|
|
@ -57,6 +61,9 @@ class PHYSICS_EXPORT Plane: public AbstractShape { |
|
|
|
return _transformedNormal; |
|
|
|
return _transformedNormal; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @brief Collision with line */ |
|
|
|
|
|
|
|
bool operator%(const Line& other) const; |
|
|
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
protected: |
|
|
|
inline Type type() const { return Type::Plane; } |
|
|
|
inline Type type() const { return Type::Plane; } |
|
|
|
|
|
|
|
|
|
|
|
@ -65,6 +72,10 @@ class PHYSICS_EXPORT Plane: public AbstractShape { |
|
|
|
_normal, _transformedNormal; |
|
|
|
_normal, _transformedNormal; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DOXYGEN_GENERATING_OUTPUT |
|
|
|
|
|
|
|
inline bool operator%(const Line& a, const Plane& b) { return b % a; } |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
|
}} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|