1#ifndef CollisionVolumeOBB_H
2#define CollisionVolumeOBB_H
5#include "CollisionVolume.h"
22class CollisionVolumeOBB :
public CollisionVolume,
public Align16
26 CollisionVolumeOBB(
const CollisionVolumeOBB&) =
delete;
27 CollisionVolumeOBB& operator=(
const CollisionVolumeOBB&) =
delete;
28 virtual ~CollisionVolumeOBB() =
default;
38 void ComputeData(Model* mod,
const Matrix& mat)
override;
80 void DebugView(
const Vect& col)
const override;
108 bool IntersectVisit(
const CollisionVolumeOBB& other)
const override;
123 VolumeType
GetType()
const override {
return VolumeType::OBB; }
Definition Framework.h:1558
Represents an axis-aligned bounding box (AABB) collision volume.
Definition CollisionVolumeAABB.h:23
Represents a bounding sphere collision volume.
Definition CollisionVolumeBSphere.h:14
VolumeType GetType() const override
Gets the type of this collision volume.
Definition CollisionVolumeOBB.h:123
bool IntersectVisit(const CollisionVolumeBSphere &other) const override
Tests intersection with a bounding sphere.
Definition CollisionVolumeOBB.cpp:72
Vect localHalfDiagonal
Half-diagonal in local/model space.
Definition CollisionVolumeOBB.h:131
const Vect & GetHalfDiagonal() const
Gets the half-diagonal (half-extents) of the OBB in world space.
Definition CollisionVolumeOBB.cpp:33
Vect center
Center of the OBB in world space.
Definition CollisionVolumeOBB.h:126
void ComputeDataFromMinMax(const Vect ¢er, const Vect &halfDiagonal)
Sets the OBB data from a center and half-diagonal in world space.
Definition CollisionVolumeOBB.cpp:87
Model * pColModel
Pointer to the associated model.
Definition CollisionVolumeOBB.h:129
Matrix worldMatrix
World matrix for OBB orientation and position.
Definition CollisionVolumeOBB.h:128
void ComputeData(Model *mod, const Matrix &mat) override
Computes the OBB data from a model and transformation matrix.
Definition CollisionVolumeOBB.cpp:8
bool IntersectAccept(const CollisionVolume &other) const override
Accepts a collision test with another collision volume (double dispatch).
Definition CollisionVolumeOBB.cpp:67
const Vect & GetCenter() const
Gets the center of the OBB in world space.
Definition CollisionVolumeOBB.cpp:28
Model * GetModel() const
Gets the model associated with this OBB.
Definition CollisionVolumeOBB.cpp:57
Vect halfDiagonal
Half-diagonal (half-extents) of the OBB in world space.
Definition CollisionVolumeOBB.h:127
const Vect GetMax() const
Gets the maximum point of the OBB in world space.
Definition CollisionVolumeOBB.cpp:50
void DebugView(const Vect &col) const override
Visualizes the OBB for debugging purposes.
Definition CollisionVolumeOBB.cpp:62
const Matrix & GetWorldMatrix() const
Gets the world matrix representing the OBB's orientation and position.
Definition CollisionVolumeOBB.cpp:38
Vect localCenter
Center in local/model space.
Definition CollisionVolumeOBB.h:132
const Vect GetMin() const
Gets the minimum point of the OBB in world space.
Definition CollisionVolumeOBB.cpp:43