SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
CollisionVolumeAABB.h
1#ifndef CollisionVolumeAABB_H
2#define CollisionVolumeAABB_H
3
4#include "CollisionVolume.h"
5#include "Vect.h"
6#include "Model.h"
7
22class CollisionVolumeAABB : public CollisionVolume, public Align16
23{
24public:
25 CollisionVolumeAABB();
26 CollisionVolumeAABB(const CollisionVolumeAABB&);
27 CollisionVolumeAABB& operator=(const CollisionVolumeAABB&);
28 virtual ~CollisionVolumeAABB() = default;
29
38 void ComputeData(Model* mod, const Matrix& mat) override;
39
44 void ComputeData(const CollisionVolumeBSphere& bsphere);
45
51 void ComputeDataFromMinMax(const Vect& min, const Vect& max);
52
57 void Enclose(const CollisionVolumeAABB& other);
58
63 const Vect& GetMin() const;
64
69 const Vect& GetMax() const;
70
75 Model* GetModel() const;
76
81 void DebugView(const Vect& col) const override;
82
88 bool IntersectAccept(const CollisionVolume& other) const override;
89
95 bool IntersectVisit(const CollisionVolumeBSphere& other) const override;
96
102 bool IntersectVisit(const CollisionVolumeAABB& other) const override;
103
109 bool IntersectVisit(const CollisionVolumeOBB& other) const override;
110
115 VolumeType GetType() const override { return VolumeType::AABB; }
116
117private:
118 friend class CollidableGroup;
119
124
129
133 Model* pColModel; // Pointer to the model associated with this AABB
134};
135
136#endif
Definition Framework.h:1558
Manages a collection of collidable objects.
Definition CollidableGroup.h:17
void DebugView(const Vect &col) const override
Visualizes the AABB for debugging purposes.
Definition CollisionVolumeAABB.cpp:93
Vect minPoint
The minimum point of the AABB.
Definition CollisionVolumeAABB.h:123
bool IntersectAccept(const CollisionVolume &other) const override
Accepts a collision test with another collision volume (double dispatch).
Definition CollisionVolumeAABB.cpp:98
Vect maxPoint
The maximum point of the AABB.
Definition CollisionVolumeAABB.h:128
VolumeType GetType() const override
Gets the type of this collision volume.
Definition CollisionVolumeAABB.h:115
void ComputeDataFromMinMax(const Vect &min, const Vect &max)
Sets the AABB from explicit min and max points.
Definition CollisionVolumeAABB.cpp:61
Model * pColModel
Pointer to the model associated with this AABB.
Definition CollisionVolumeAABB.h:133
void Enclose(const CollisionVolumeAABB &other)
Expands this AABB to enclose another AABB.
Definition CollisionVolumeAABB.cpp:69
const Vect & GetMax() const
Gets the maximum point of the AABB.
Definition CollisionVolumeAABB.cpp:83
Model * GetModel() const
Gets the model associated with this AABB.
Definition CollisionVolumeAABB.cpp:88
void ComputeData(Model *mod, const Matrix &mat) override
Computes the collision data for the AABB from a model and transformation matrix.
Definition CollisionVolumeAABB.cpp:23
bool IntersectVisit(const CollisionVolumeBSphere &other) const override
Tests intersection with a bounding sphere.
Definition CollisionVolumeAABB.cpp:103
const Vect & GetMin() const
Gets the minimum point of the AABB.
Definition CollisionVolumeAABB.cpp:78
Represents a bounding sphere collision volume.
Definition CollisionVolumeBSphere.h:14
Represents an Oriented Bounding Box (OBB) collision volume.
Definition CollisionVolumeOBB.h:23