|
|
|
@ -20,6 +20,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#include "AbstractShape.h" |
|
|
|
#include "AbstractShape.h" |
|
|
|
|
|
|
|
#include "Point.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace Magnum { namespace Physics { |
|
|
|
namespace Magnum { namespace Physics { |
|
|
|
|
|
|
|
|
|
|
|
@ -36,6 +37,8 @@ class PHYSICS_EXPORT Sphere: 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; } |
|
|
|
|
|
|
|
|
|
|
|
@ -58,6 +61,9 @@ class PHYSICS_EXPORT Sphere: public AbstractShape { |
|
|
|
return _transformedRadius; |
|
|
|
return _transformedRadius; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @brief Collision with point */ |
|
|
|
|
|
|
|
bool operator%(const Point& other) const; |
|
|
|
|
|
|
|
|
|
|
|
protected: |
|
|
|
protected: |
|
|
|
inline Type type() const { return Type::Sphere; } |
|
|
|
inline Type type() const { return Type::Sphere; } |
|
|
|
|
|
|
|
|
|
|
|
@ -66,6 +72,10 @@ class PHYSICS_EXPORT Sphere: public AbstractShape { |
|
|
|
float _radius, _transformedRadius; |
|
|
|
float _radius, _transformedRadius; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DOXYGEN_GENERATING_OUTPUT |
|
|
|
|
|
|
|
inline bool operator%(const Point& a, const Sphere& b) { return b % a; } |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
|
}} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|