| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
|---|---|
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #include "Math/BsBounds.h" |
| 4 | #include "Math/BsRay.h" |
| 5 | #include "Math/BsPlane.h" |
| 6 | #include "Math/BsSphere.h" |
| 7 | |
| 8 | namespace bs |
| 9 | { |
| 10 | Bounds::Bounds(const AABox& box, const Sphere& sphere) |
| 11 | :mBox(box), mSphere(sphere) |
| 12 | { } |
| 13 | |
| 14 | void Bounds::setBounds(const AABox& box, const Sphere& sphere) |
| 15 | { |
| 16 | mBox = box; |
| 17 | mSphere = sphere; |
| 18 | } |
| 19 | |
| 20 | void Bounds::merge(const Bounds& rhs) |
| 21 | { |
| 22 | mBox.merge(rhs.mBox); |
| 23 | mSphere.merge(rhs.mSphere); |
| 24 | } |
| 25 | |
| 26 | void Bounds::merge(const Vector3& point) |
| 27 | { |
| 28 | mBox.merge(point); |
| 29 | mSphere.merge(point); |
| 30 | } |
| 31 | |
| 32 | void Bounds::transform(const Matrix4& matrix) |
| 33 | { |
| 34 | mBox.transform(matrix); |
| 35 | mSphere.transform(matrix); |
| 36 | } |
| 37 | |
| 38 | void Bounds::transformAffine(const Matrix4& matrix) |
| 39 | { |
| 40 | mBox.transformAffine(matrix); |
| 41 | mSphere.transform(matrix); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 |