![]() |
Botcraft 1.21.4
|
#include <AABB.hpp>
Public Member Functions | |
AABB (const Vector3< double > ¢er_, const Vector3< double > &half_size_) | |
~AABB () | |
Vector3< double > | GetMin () const |
Vector3< double > | GetMax () const |
const Vector3< double > & | GetCenter () const |
const Vector3< double > & | GetHalfSize () const |
Vector3< double > | GetClosestPoint (const Vector3< double > &pos) const |
Get the closest point in the AABB from a given point. | |
double | GetVolume () const |
Get the volume of this AABB. | |
bool | Collide (const AABB &b) const |
bool | Intersect (const Vector3< double > &origin, const Vector3< double > &direction) const |
AABB & | Inflate (const double d) |
AABB & | Translate (const Vector3< double > &t) |
bool | operator< (const AABB &other) const |
bool | operator== (const AABB &other) const |
Private Attributes | |
Vector3< double > | center |
Vector3< double > | half_size |
Friends | |
template<typename T > | |
AABB | operator+ (AABB box, const Vector3< T > &offset) |
bool Botcraft::AABB::Collide | ( | const AABB & | b | ) | const |
Definition at line 60 of file AABB.cpp.
References center, half_size, Botcraft::Vector3< T >::x, Botcraft::Vector3< T >::y, and Botcraft::Vector3< T >::z.
Referenced by Botcraft::World::GetSupportingBlockPos(), and Botcraft::World::IsFree().
const Vector3< double > & Botcraft::AABB::GetCenter | ( | ) | const |
Definition at line 28 of file AABB.cpp.
References center.
Referenced by Botcraft::PhysicsManager::ApplyMovement(), Botcraft::World::GetColliders(), and Botcraft::World::GetSupportingBlockPos().
const Vector3< double > & Botcraft::AABB::GetHalfSize | ( | ) | const |
Definition at line 33 of file AABB.cpp.
References half_size.
Referenced by Botcraft::PhysicsManager::ApplyMovement(), and Botcraft::World::GetColliders().
Vector3< double > Botcraft::AABB::GetMax | ( | ) | const |
Definition at line 23 of file AABB.cpp.
References center, and half_size.
Referenced by Botcraft::PhysicsManager::CheckInsideBlocks(), Botcraft::PhysicsManager::CollideOneAxis(), Botcraft::PhysicsManager::FluidPhysics(), GetClosestPoint(), Botcraft::World::GetColliders(), Botcraft::World::GetSupportingBlockPos(), and Botcraft::World::IsFree().
Vector3< double > Botcraft::AABB::GetMin | ( | ) | const |
Definition at line 18 of file AABB.cpp.
References center, and half_size.
Referenced by Botcraft::PhysicsManager::CheckInsideBlocks(), Botcraft::PhysicsManager::CollideOneAxis(), Botcraft::PhysicsManager::FluidPhysics(), GetClosestPoint(), Botcraft::World::GetColliders(), Botcraft::World::GetSupportingBlockPos(), and Botcraft::World::IsFree().
double Botcraft::AABB::GetVolume | ( | ) | const |
Get the volume of this AABB.
Definition at line 55 of file AABB.cpp.
References half_size, Botcraft::Vector3< T >::x, Botcraft::Vector3< T >::y, and Botcraft::Vector3< T >::z.
AABB & Botcraft::AABB::Inflate | ( | const double | d | ) |
Definition at line 92 of file AABB.cpp.
References half_size.
Referenced by Botcraft::PhysicsManager::CheckInsideBlocks(), and Botcraft::PhysicsManager::FluidPhysics().
bool Botcraft::AABB::operator< | ( | const AABB & | other | ) | const |
bool Botcraft::AABB::operator== | ( | const AABB & | other | ) | const |
Definition at line 98 of file AABB.cpp.
References center.
Referenced by Botcraft::PhysicsManager::CollideOneAxis().
|
private |
Definition at line 47 of file AABB.hpp.
Referenced by AABB(), Collide(), GetCenter(), GetMax(), GetMin(), Intersect(), operator<(), operator==(), and Translate().
|
private |
Definition at line 48 of file AABB.hpp.
Referenced by AABB(), Collide(), GetHalfSize(), GetMax(), GetMin(), GetVolume(), Inflate(), Intersect(), operator<(), and operator==().