|
Infinity Engine v0.6.20
C++ API Documentation
|
Axis-aligned bounding box (AABB) representing a rectangular 3D region. More...
#include <Volume.hpp>
Public Member Functions | |
| Volume () | |
| Default constructor. | |
| Volume (float w, float h, float d, Math::Vector3 position=Math::Vector3(0.0f, 0.0f, 0.0f)) | |
| Constructs a volume with specified dimensions and position. | |
| float | leftBound () |
| Gets the minimum X coordinate (left edge). | |
| float | rightBound () |
| Gets the maximum X coordinate (right edge). | |
| float | topBound () |
| Gets the maximum Y coordinate (top edge). | |
| float | bottomBound () |
| Gets the minimum Y coordinate (bottom edge). | |
| float | frontBound () |
| Gets the minimum Z coordinate (front edge). | |
| float | backBound () |
| Gets the maximum Z coordinate (back edge). | |
| float | volume () |
| Calculates the total volume (cubic units). | |
Public Attributes | |
| float | width |
| Total width of the volume along the X-axis. | |
| float | height |
| Total height of the volume along the Y-axis. | |
| float | depth |
| Total depth of the volume along the Z-axis. | |
| Math::Vector3 | position |
| Center position of the volume in world space. | |
Axis-aligned bounding box (AABB) representing a rectangular 3D region.
Volume defines a three-dimensional rectangular region in world space, specified by its dimensions (width, height, depth) and center position. This is the standard representation for axis-aligned bounding volumes throughout the Infinity Engine's procedural generation systems.
The volume is always axis-aligned (cannot be rotated), making it efficient for spatial queries, collision detection, and region-based generation. All dimensions extend equally from the center position in both positive and negative directions.
Common use cases in procedural generation:
Example usage:
| Infinity::Types::Spatial::Volume::Volume | ( | ) |
Default constructor.
Creates a volume with zero dimensions at the origin.
| Infinity::Types::Spatial::Volume::Volume | ( | float | w, |
| float | h, | ||
| float | d, | ||
| Math::Vector3 | position = Math::Vector3(0.0f, 0.0f, 0.0f) |
||
| ) |
Constructs a volume with specified dimensions and position.
| w | Width (X-axis extent). |
| h | Height (Y-axis extent). |
| d | Depth (Z-axis extent). |
| position | Center position in world space (default: origin). |
| float Infinity::Types::Spatial::Volume::backBound | ( | ) |
Gets the maximum Z coordinate (back edge).
Calculates position.z + depth/2.
| float Infinity::Types::Spatial::Volume::bottomBound | ( | ) |
Gets the minimum Y coordinate (bottom edge).
Calculates position.y - height/2.
| float Infinity::Types::Spatial::Volume::frontBound | ( | ) |
Gets the minimum Z coordinate (front edge).
Calculates position.z - depth/2.
| float Infinity::Types::Spatial::Volume::leftBound | ( | ) |
Gets the minimum X coordinate (left edge).
Calculates position.x - width/2.
| float Infinity::Types::Spatial::Volume::rightBound | ( | ) |
Gets the maximum X coordinate (right edge).
Calculates position.x + width/2.
| float Infinity::Types::Spatial::Volume::topBound | ( | ) |
Gets the maximum Y coordinate (top edge).
Calculates position.y + height/2.
| float Infinity::Types::Spatial::Volume::volume | ( | ) |
Calculates the total volume (cubic units).
Computes width × height × depth.
| float Infinity::Types::Spatial::Volume::depth |
Total depth of the volume along the Z-axis.
Full extent from front to back. The volume extends depth/2 in both positive and negative Z directions from the center position.
| float Infinity::Types::Spatial::Volume::height |
Total height of the volume along the Y-axis.
Full extent from bottom to top. The volume extends height/2 in both positive and negative Y directions from the center position.
| Math::Vector3 Infinity::Types::Spatial::Volume::position |
Center position of the volume in world space.
The volume is centered at this position, with dimensions extending equally in all directions.
| float Infinity::Types::Spatial::Volume::width |
Total width of the volume along the X-axis.
Full extent from left to right. The volume extends width/2 in both positive and negative X directions from the center position.