Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_COLLISION_CAPSULE_H__
00009 #define __SP_COLLISION_CAPSULE_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013 #include "SceneGraph/Collision/spCollisionLineBased.hpp"
00014
00015
00016 namespace sp
00017 {
00018 namespace scene
00019 {
00020
00021
00027 class SP_EXPORT CollisionCapsule : public CollisionLineBased
00028 {
00029
00030 public:
00031
00032 CollisionCapsule(CollisionMaterial* Material, SceneNode* Node, f32 Radius, f32 Height);
00033 ~CollisionCapsule();
00034
00035
00036
00037 s32 getSupportFlags() const;
00038
00039 bool checkIntersection(const dim::line3df &Line, SIntersectionContact &Contact) const;
00040 bool checkIntersection(const dim::line3df &Line, bool ExcludeCorners = false) const;
00041
00042 private:
00043
00044
00045
00046 bool checkCollisionToSphere (const CollisionSphere* Rival, SCollisionContact &Contact) const;
00047 bool checkCollisionToCapsule(const CollisionCapsule* Rival, SCollisionContact &Contact) const;
00048 bool checkCollisionToBox (const CollisionBox* Rival, SCollisionContact &Contact) const;
00049 bool checkCollisionToPlane (const CollisionPlane* Rival, SCollisionContact &Contact) const;
00050 bool checkCollisionToMesh (const CollisionMesh* Rival, SCollisionContact &Contact) const;
00051
00052 bool checkAnyCollisionToMesh(const CollisionMesh* Rival) const;
00053
00054 void performCollisionResolvingToSphere (const CollisionSphere* Rival);
00055 void performCollisionResolvingToCapsule (const CollisionCapsule* Rival);
00056 void performCollisionResolvingToBox (const CollisionBox* Rival);
00057 void performCollisionResolvingToPlane (const CollisionPlane* Rival);
00058 void performCollisionResolvingToMesh (const CollisionMesh* Rival);
00059
00060 bool setupCollisionContact(
00061 const dim::vector3df &PointP, const dim::vector3df &PointQ,
00062 f32 MaxRadius, f32 RivalRadius, SCollisionContact &Contact
00063 ) const;
00064
00065 };
00066
00067
00068 }
00069
00070 }
00071
00072
00073 #endif
00074
00075
00076
00077