TrapazoidalPrismCollider.h
Go to the documentation of this file.
#pragma once
#include "Vector3.h"
#include "Collider.h"
#include <array>
namespace Eule
{
class TrapazoidalPrismCollider : public Collider
{
public:
TrapazoidalPrismCollider();
TrapazoidalPrismCollider(const TrapazoidalPrismCollider& other) = default;
TrapazoidalPrismCollider(TrapazoidalPrismCollider&& other) noexcept = default;
void operator=(const TrapazoidalPrismCollider& other);
void operator=(TrapazoidalPrismCollider&& other) noexcept;
const Vector3d& GetVertex(std::size_t index) const;
void SetVertex(std::size_t index, const Vector3d value);
bool Contains(const Vector3d& point) const override;
/* Vertex identifiers */
static constexpr std::size_t BACK = 0;
static constexpr std::size_t FRONT = 4;
static constexpr std::size_t LEFT = 0;
static constexpr std::size_t RIGHT = 2;
static constexpr std::size_t BOTTOM = 0;
static constexpr std::size_t TOP = 1;
private:
enum class FACE_NORMALS : std::size_t;
void GenerateNormalsFromVertices();
double FaceDot(FACE_NORMALS face, const Vector3d& point) const;
std::array<Vector3d, 8> vertices;
// Face normals
enum class FACE_NORMALS : std::size_t
{
LEFT = 0,
RIGHT = 1,
FRONT = 2,
BACK = 3,
TOP = 4,
BOTTOM = 5
};
std::array<Vector3d, 6> faceNormals;
};
}
Eule::TrapazoidalPrismCollider::RIGHT
static constexpr std::size_t RIGHT
Definition: TrapazoidalPrismCollider.h:35
Eule::Collider
Abstract class of a collider domain.
Definition: Collider.h:10
Eule::TrapazoidalPrismCollider::BACK
static constexpr std::size_t BACK
Definition: TrapazoidalPrismCollider.h:32
Eule::Vector3< double >
Eule::TrapazoidalPrismCollider::FRONT
static constexpr std::size_t FRONT
Definition: TrapazoidalPrismCollider.h:33
Eule::TrapazoidalPrismCollider::BOTTOM
static constexpr std::size_t BOTTOM
Definition: TrapazoidalPrismCollider.h:36
Eule::TrapazoidalPrismCollider::operator=
void operator=(const TrapazoidalPrismCollider &other)
Definition: TrapazoidalPrismCollider.cpp:10
Eule::TrapazoidalPrismCollider::LEFT
static constexpr std::size_t LEFT
Definition: TrapazoidalPrismCollider.h:34
Eule::TrapazoidalPrismCollider::SetVertex
void SetVertex(std::size_t index, const Vector3d value)
Will set the value of a specific vertex.
Definition: TrapazoidalPrismCollider.cpp:31
Eule::TrapazoidalPrismCollider::Contains
bool Contains(const Vector3d &point) const override
Tests, if this Collider contains a point.
Definition: TrapazoidalPrismCollider.cpp:103
Vector3.h
Eule::TrapazoidalPrismCollider
A collider describing a trapazoidal prism.
Definition: TrapazoidalPrismCollider.h:13
Eule::TrapazoidalPrismCollider::TrapazoidalPrismCollider
TrapazoidalPrismCollider()
Definition: TrapazoidalPrismCollider.cpp:5
Eule::TrapazoidalPrismCollider::GetVertex
const Vector3d & GetVertex(std::size_t index) const
Will return a specific vertex.
Definition: TrapazoidalPrismCollider.cpp:26
Collider.h
Eule::TrapazoidalPrismCollider::TOP
static constexpr std::size_t TOP
Definition: TrapazoidalPrismCollider.h:37
Eule
Definition: Collider.h:4