mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Introducing Oriented bounding box for GeometryView selection
First implementation of MixingView selection manipulation (scale and rotate)
This commit is contained in:
25
GlmToolkit.h
25
GlmToolkit.h
@@ -17,13 +17,10 @@ void inverse_transform(glm::mat4 M, glm::vec3 &translation, glm::vec3 &rotation,
|
||||
|
||||
class AxisAlignedBoundingBox
|
||||
{
|
||||
glm::vec3 mMin;
|
||||
glm::vec3 mMax;
|
||||
|
||||
public:
|
||||
AxisAlignedBoundingBox();
|
||||
|
||||
void operator = (const AxisAlignedBoundingBox &D ) {
|
||||
inline void operator = (const AxisAlignedBoundingBox &D ) {
|
||||
mMin = D.mMin;
|
||||
mMax = D.mMax;
|
||||
}
|
||||
@@ -46,8 +43,28 @@ public:
|
||||
AxisAlignedBoundingBox translated(glm::vec3 t) const;
|
||||
AxisAlignedBoundingBox scaled(glm::vec3 s) const;
|
||||
AxisAlignedBoundingBox transformed(glm::mat4 m) const;
|
||||
|
||||
friend bool operator<(const AxisAlignedBoundingBox& A, const AxisAlignedBoundingBox& B );
|
||||
|
||||
protected:
|
||||
glm::vec3 mMin;
|
||||
glm::vec3 mMax;
|
||||
};
|
||||
|
||||
// a bbox A is < from bbox B if its diagonal is shorter
|
||||
bool operator< (const AxisAlignedBoundingBox& A, const AxisAlignedBoundingBox& B );
|
||||
|
||||
|
||||
class OrientedBoundingBox
|
||||
{
|
||||
public:
|
||||
OrientedBoundingBox() : orientation(glm::vec3(0.f,0.f,0.f)) {}
|
||||
|
||||
AxisAlignedBoundingBox aabb;
|
||||
glm::vec3 orientation;
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const char* aspect_ratio_names[6] = { "1:1", "4:3", "3:2", "16:10", "16:9", "21:9" };
|
||||
static const char* height_names[10] = { "16", "64", "200", "320", "480", "576", "720p", "1080p", "1440", "4K" };
|
||||
|
||||
Reference in New Issue
Block a user