24 #include "../Math_LIB/MMatrix3x3.h"
26 namespace OpenSkyNet {
81 Sphere(
const float& boundingRadius_) :
Shape(boundingRadius_) {}
89 Box(
const float& boundingRadius_,
const float& width_,
const float& height_,
const float& depth_) :
Shape(boundingRadius_),
138 #define COL_GROUP_HIT_ALL_HIT_BY_ALL 0xFFFFFFFF
139 #define COL_GROUP_HIT_ALL_HIT_BY_NONE 0xFFFF0000
140 #define COL_GROUP_HIT_NONE_HIT_BY_ALL 0x0000FFFF
141 #define COL_GROUP_HIT_NONE_HIT_BY_NONE 0x00000000
142 #define COL_GROUP_HIT_NONE_HIT_BY_1 0x00000001
143 #define COL_GROUP_HIT_ALL_BUT_1_HIT_BY_NONE 0xFFFE0000
144 #define COL_GROUP_HITTABLE_MASK 0x0000FFFF
154 _nonCollidingCenter(center_), _rot(
rot_), _userPointer(userPointer_), _colGroup(colGroup_) {}
170 _nonCollidingCenter = center_;
171 _nonCollidingRot =
rot_;
215 otherCollidable_->
getCenter(), otherCollidable_->
getRot(), otherVel_, hitInfo_);
Sphere(const float &boundingRadius_)
Definition: CDVolume.h:81
#define COL_GROUP_HIT_ALL_HIT_BY_ALL
Definition: CDVolume.h:138
virtual ~Shape()
Definition: CDVolume.h:59
Definition: CDVolume.h:36
Definition: CDVolume.h:106
virtual SHAPE_TYPE getType() const
Definition: CDVolume.h:92
#define UNUSED(var)
Definition: UTypes.h:35
Definition: CDVolume.h:54
Math::Point _colliderStartCenter
Definition: CDVolume.h:46
Definition: CDVolume.h:31
void setColGroup(Utils::uint colGroup_)
Definition: CDVolume.h:200
virtual SHAPE_TYPE getType() const
Definition: CDVolume.h:206
Math::Point getCenter() const
Definition: CDVolume.h:162
virtual float getDist(const Collidable *aCollidable_) const
Definition: CDVolume.h:208
void setCenter(const Math::Point<> ¢er_)
Definition: CDVolume.h:160
virtual ~Collidable()
Definition: CDVolume.h:156
Volume(Shape *shape_, const Math::Point<> ¢er_=Math::g_origin, const Math::Matrix3x3 &rot_=Math::g_identityMatrix3x3, void *userPointer_=0, Utils::uint colGroup_=COL_GROUP_HIT_ALL_HIT_BY_ALL)
Definition: CDVolume.h:228
Math::Point _collideeVel
Definition: CDVolume.h:45
void setRot(const Math::Matrix3x3 &rot_)
Definition: CDVolume.h:178
Math::Point _collideeStartCenter
Definition: CDVolume.h:45
Volume * _collider
Definition: CDVolume.h:38
virtual bool getFirstIntersection(const Math::Point<> &thisCenter_, const Math::Matrix3x3 &thisRot_, const Math::Point<> &thisVel_, const Shape *otherShape_, const Math::Point<> &otherCenter_, const Math::Matrix3x3 &otherRot_, const Math::Point<> &otherVel_, HitInfo &hitInfo_) const
Definition: CDVolume.cpp:14
Definition: CDVolume.h:107
const Matrix3x3 g_identityMatrix3x3
Definition: MMatrix3x3.cpp:5
Plane(const Math::Point<> &n_)
Definition: CDVolume.h:111
AXIS_ALIGNMENT
Definition: CDVolume.h:107
const Point g_yAxis(0.0f, 1.0f, 0.0f)
Definition: MPoint.h:216
HitInfo(Volume *collider_=0)
Definition: CDVolume.h:48
virtual bool getFirstIntersection(const Math::Point<> &thisCenter_, const Math::Matrix3x3 &thisRot_, const Math::Point<> &thisVel_, const Shape *otherShape_, const Math::Point<> &otherCenter_, const Math::Matrix3x3 &otherRot_, const Math::Point<> &otherVel_, HitInfo &hitInfo_) const
Definition: CDVolume.cpp:165
Definition: CDVolume.h:225
Definition: CDVolume.h:107
Collidable(const Math::Point<> ¢er_=Math::g_origin, const Math::Matrix3x3 &rot_=Math::g_identityMatrix3x3, void *userPointer_=0, Utils::uint colGroup_=COL_GROUP_HIT_ALL_HIT_BY_ALL)
Definition: CDVolume.h:152
void setNonColTransform(const Math::Point<> ¢er_, const Math::Matrix3x3 &rot_)
Definition: CDVolume.h:169
void translate(const Math::Point<> &delta_)
Definition: CDVolume.h:158
#define COL_GROUP_HITTABLE_MASK
Definition: CDVolume.h:144
float _depthDiv2
Definition: CDVolume.h:87
virtual float getDist(const Math::Point<> &thisCenter_, const Math::Matrix3x3 &thisRot_, const Shape *otherShape_, const Math::Point<> &otherCenter_, const Math::Matrix3x3 &otherRot_) const
Definition: CDVolume.cpp:101
Definition: CDVolume.h:107
const Point g_origin
Definition: MPoint.cpp:5
bool equals(const Point< T > &rhs_, T radiusSqrd_) const
Definition: MPoint.h:152
virtual void scale(const Math::Point<> &factor_)
Definition: CDVolume.cpp:360
virtual float getDist(const Math::Point<> &thisCenter_, const Math::Matrix3x3 &thisRot_, const Shape *otherShape_, const Math::Point<> &otherCenter_, const Math::Matrix3x3 &otherRot_) const
Definition: CDVolume.cpp:7
Definition: CDVolume.h:31
Shape(const float &boundingRadius_=0.0f)
Definition: CDVolume.h:57
virtual float getDist(const Math::Point<> &thisCenter_, const Math::Matrix3x3 &thisRot_, const Shape *otherShape_, const Math::Point<> &otherCenter_, const Math::Matrix3x3 &otherRot_) const
Definition: CDVolume.h:80
float _heightDiv2
Definition: CDVolume.h:87
float getBoundingRadius() const
Definition: CDVolume.h:234
Math::Point _hitNormal
Definition: CDVolume.h:42
void setBoundingRadius(const float &boundingRadius_)
Definition: CDVolume.h:232
Utils::uint canGroupHitMe(Utils::uint colGroup_) const
Definition: CDVolume.h:195
const float PSEUDO_INFINITY(1000000.0f)
virtual void scale(const Math::Point<> &factor_)
Definition: CDVolume.h:77
Box(const float &boundingRadius_, const float &width_, const float &height_, const float &depth_)
Definition: CDVolume.h:89
unsigned int uint
Definition: UTypes.h:39
Math::Point _hitPos
Definition: CDVolume.h:42
virtual Shape * getShape()
Definition: CDVolume.h:236
Definition: CDVolume.h:107
virtual SHAPE_TYPE getType() const =0
virtual SHAPE_TYPE getType() const
Definition: CDVolume.h:113
virtual SHAPE_TYPE getType() const
Definition: CDVolume.h:83
virtual bool getClosestRayIntersection(const Math::Point<> &rayOrigin_, const Math::Point<> &rayDir_, Math::Point<> &hitPos_, float &t_, Math::Point<> &hitNormal_) const
Definition: CDVolume.h:219
Definition: CDVolume.h:107
Definition: CDVolume.h:31
Math::Point _colliderVel
Definition: CDVolume.h:46
const Point g_xAxis(1.0f, 0.0f, 0.0f)
Definition: MPoint.h:215
float _hitSecs
Definition: CDVolume.h:40
Math::Point _n
Definition: CDVolume.h:109
Utils::uint getColGroup() const
Definition: CDVolume.h:198
virtual bool getClosestRayIntersection(const Math::Point<> &thisCenter_, const Math::Matrix3x3 &thisRot_, const Math::Point<> &rayOrigin_, const Math::Point<> &rayDir_, Math::Point<> &hitPos_, float &t_, Math::Point<> &hitNormal_) const
Definition: CDVolume.cpp:62
float _boundingRadius
Definition: CDVolume.h:55
AXIS_ALIGNMENT getAxisAlignment() const
Definition: CDVolume.h:126
SHAPE_TYPE
Definition: CDVolume.h:31
void * getUserPointer() const
Definition: CDVolume.h:186
virtual Shape * getShape()=0
const Math::Point & getNonColCenter() const
Definition: CDVolume.h:175
Definition: MMatrix3x3.h:32
const Point g_zAxis(0.0f, 0.0f, 1.0f)
Definition: MPoint.h:217
T getDot3(const Point< T > &rhs_) const
Definition: MPoint.h:202
Math::Point getDimensions() const
Definition: CDVolume.h:94
Definition: CDVolume.h:146
const Math::Matrix3x3 & getNonColRot() const
Definition: CDVolume.h:176
void setUserPointer(void *userPointer_)
Definition: CDVolume.h:183
virtual bool getFirstIntersection(const Math::Point<> &thisVel_, const Collidable *otherCollidable_, const Math::Point<> &otherVel_, HitInfo &hitInfo_) const
Definition: CDVolume.h:212
const float CLOSE_TO_ZERO(0.00001f)
float float rot_[3]
Definition: ViewerApp.h:31
Math::Matrix3x3 getRot() const
Definition: CDVolume.h:180
float getDist(const Math::Point<> &thisP_, const Math::Point<> &otherP_) const
Definition: CDVolume.h:121
float _widthDiv2
Definition: CDVolume.h:87
Definition: CDVolume.h:86
Definition: CDVolume.h:107
virtual const Shape * getShape() const
Definition: CDVolume.h:238
Definition: CDVolume.h:107