17 #ifndef GZ_MATH_ORIENTEDBOX_HH_
18 #define GZ_MATH_ORIENTEDBOX_HH_
27 #include <gz/math/config.hh>
32 inline namespace GZ_MATH_VERSION_NAMESPACE {
49 : size(_size.Abs()), pose(_pose)
60 : size(_size.Abs()), pose(_pose), material(_mat)
68 : size(_size.Abs()), pose(
Pose3<T>::Zero)
78 : size(_size.Abs()), pose(
Pose3<T>::Zero), material(_mat)
93 return this->size.X();
100 return this->size.Y();
107 return this->size.Z();
130 this->size = _size.
Abs();
150 return this->size == _b.size && this->pose == _b.pose &&
151 this->material == _b.material;
159 return this->size != _b.size || this->pose != _b.pose ||
160 this->material != _b.material;
170 _out <<
"Size[" << _b.
Size() <<
"] Pose[" << _b.
Pose() <<
"] "
171 <<
"Material[" << _b.
Material().Name() <<
"]";
184 return p.
X() >= -this->size.X()*0.5 && p.X() <= this->size.X()*0.5 &&
185 p.Y() >= -this->size.Y()*0.5 && p.Y() <= this->size.Y()*0.5 &&
186 p.Z() >= -this->size.Z()*0.5 && p.Z() <= this->size.Z()*0.5;
193 return this->material;
200 this->material = _mat;
207 return this->size.X() * this->size.Y() * this->size.Z();
220 if (this->size.Min() <= 0|| _mass <= 0)
223 return _mass / this->Volume();
240 T newDensity = this->DensityFromMass(_mass);
242 this->material.SetDensity(newDensity);
243 return newDensity > 0;
254 return _massMat.
SetFromBox(this->material, this->size);
271 #endif // GZ_MATH_ORIENTEDBOX_HH_