Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Volume.hpp
1#pragma once
2
3#include <Infinity/api.h>
4#include <Infinity/Types/Core/Value.hpp>
5#include <Infinity/Types/Containers/Array.hpp>
6#include <Infinity/Types/Math/Vector3.hpp>
7
9{
10
70 struct INFINITY_API_PUBLIC Volume
71 {
78 float width;
79
86 float height;
87
94 float depth;
95
103
110
124 Volume(float w, float h, float d, Math::Vector3 position = Math::Vector3(0.0f, 0.0f, 0.0f));
125
133 float leftBound();
134
142 float rightBound();
143
151 float topBound();
152
160 float bottomBound();
161
169 float frontBound();
170
178 float backBound();
179
194 float volume();
195 };
196
207 inline INFINITY_API_PUBLIC std::ostream& operator<<(std::ostream& out, const Volume& v)
208 {
209 out << v.width << " " << v.height << " " << v.depth << " " << v.position;
210 return out;
211 }
212
223 inline INFINITY_API_PUBLIC std::istream& operator>>(std::istream& in, Volume& v)
224 {
225 in >> v.width >> v.height >> v.depth >> v.position;
226 return in;
227 }
228}
229
Dynamic contiguous container for homogeneous elements in the Infinity type system.
Definition Array.hpp:77
Template wrapper for primitive types to integrate with the Infinity type system.
Definition Value.hpp:89
Definition Point.hpp:11
INFINITY_API_TEMPLATE std::istream & operator>>(std::istream &in, Transform &t)
Stream input operator for Transform.
Definition Transform.hpp:145
INFINITY_API_TEMPLATE std::ostream & operator<<(std::ostream &out, const Transform &t)
Stream output operator for Transform.
Definition Transform.hpp:129
Template structure representing a 3-component vector.
Definition Vector3.hpp:82
Axis-aligned bounding box (AABB) representing a rectangular 3D region.
Definition Volume.hpp:71
float topBound()
Gets the maximum Y coordinate (top edge).
float height
Total height of the volume along the Y-axis.
Definition Volume.hpp:86
float depth
Total depth of the volume along the Z-axis.
Definition Volume.hpp:94
float backBound()
Gets the maximum Z coordinate (back edge).
float rightBound()
Gets the maximum X coordinate (right edge).
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 frontBound()
Gets the minimum Z coordinate (front edge).
float leftBound()
Gets the minimum X coordinate (left edge).
Math::Vector3 position
Center position of the volume in world space.
Definition Volume.hpp:102
float width
Total width of the volume along the X-axis.
Definition Volume.hpp:78
Volume()
Default constructor.
float volume()
Calculates the total volume (cubic units).
float bottomBound()
Gets the minimum Y coordinate (bottom edge).