Isle
Loading...
Searching...
No Matches
legobox.h
Go to the documentation of this file.
1#ifndef __LEGOBOX_H
2#define __LEGOBOX_H
3
4#include "legovertex.h"
5
6// SIZE 0x18
11class LegoBox {
12public:
17 LegoVertex& GetMin() { return m_min; }
18
23 void SetMin(LegoVertex& p_min) { m_min = p_min; }
24
29 LegoVertex& GetMax() { return m_max; }
30
35 void SetMax(LegoVertex& p_max) { m_max = p_max; }
36
37 // LegoVertex GetCenter()
38 // {
39 // return LegoVertex(
40 // (m_min.GetX() + m_max.GetX()) / 2,
41 // (m_min.GetY() + m_max.GetY()) / 2,
42 // (m_min.GetZ() + m_max.GetZ()) / 2
43 // );
44 // }
45
50 LegoFloat GetDX() { return m_max.GetX() - m_min.GetX(); }
51
56 LegoFloat GetDY() { return m_max.GetY() - m_min.GetY(); }
57
62 LegoFloat GetDZ() { return m_max.GetZ() - m_min.GetZ(); }
63
70
77 LegoResult Read(LegoStorage* p_storage);
78
79protected:
84
89};
90
91#endif // __LEGOBOX_H
[AI] Represents an axis-aligned 3D bounding box, defined by minimum and maximum corners.
Definition: legobox.h:11
LegoFloat GetDY()
[AI] Calculates the length of the box along the Y axis.
Definition: legobox.h:56
LegoBool IsEmpty()
[AI] Checks if both min and max vertices are set to the origin.
Definition: legobox.h:69
LegoVertex m_min
[AI] Minimum corner of the bounding box.
Definition: legobox.h:83
LegoResult Read(LegoStorage *p_storage)
[AI] Reads the bounding box data from a LegoStorage stream.
Definition: legobox.cpp:10
void SetMax(LegoVertex &p_max)
[AI] Sets the maximum vertex of the box.
Definition: legobox.h:35
void SetMin(LegoVertex &p_min)
[AI] Sets the minimum vertex of the box.
Definition: legobox.h:23
LegoVertex & GetMax()
[AI] Returns a reference to the maximum vertex of the box.
Definition: legobox.h:29
LegoFloat GetDX()
[AI] Calculates the length of the box along the X axis.
Definition: legobox.h:50
LegoVertex & GetMin()
[AI] Returns a reference to the minimum vertex of the box.
Definition: legobox.h:17
LegoVertex m_max
[AI] Maximum corner of the bounding box.
Definition: legobox.h:88
LegoFloat GetDZ()
[AI] Calculates the length of the box along the Z axis.
Definition: legobox.h:62
Abstract base class providing an interface for file-like storage with binary and text read/write oper...
Definition: legostorage.h:16
[AI] Represents a 3D vertex with floating point coordinates.
Definition: legovertex.h:11
LegoFloat GetZ()
[AI] Gets the Z coordinate.
Definition: legovertex.h:41
LegoBool IsOrigin()
[AI] Checks whether the vertex is located at the origin (0,0,0).
Definition: legovertex.h:50
LegoFloat GetX()
[AI] Gets the X coordinate.
Definition: legovertex.h:27
LegoFloat GetY()
[AI] Gets the Y coordinate.
Definition: legovertex.h:34
LegoS32 LegoResult
[AI] Function result type (return code): typically SUCCESS (0) or FAILURE (-1).
Definition: legotypes.h:101
float LegoFloat
[AI] Floating point type used throughout LEGO Island.
Definition: legotypes.h:77
LegoU8 LegoBool
[AI] Boolean value used throughout the codebase.
Definition: legotypes.h:89