2
0

BsBounds.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "BsBounds.h"
  4. #include "BsRay.h"
  5. #include "BsPlane.h"
  6. #include "BsSphere.h"
  7. namespace BansheeEngine
  8. {
  9. Bounds::Bounds()
  10. { }
  11. Bounds::Bounds(const AABox& box, const Sphere& sphere)
  12. :mBox(box), mSphere(sphere)
  13. { }
  14. void Bounds::setBounds(const AABox& box, const Sphere& sphere)
  15. {
  16. mBox = box;
  17. mSphere = sphere;
  18. }
  19. void Bounds::merge(const Bounds& rhs)
  20. {
  21. mBox.merge(rhs.mBox);
  22. mSphere.merge(rhs.mSphere);
  23. }
  24. void Bounds::merge(const Vector3& point)
  25. {
  26. mBox.merge(point);
  27. mSphere.merge(point);
  28. }
  29. void Bounds::transform(const Matrix4& matrix)
  30. {
  31. mBox.transform(matrix);
  32. mSphere.transform(matrix);
  33. }
  34. void Bounds::transformAffine(const Matrix4& matrix)
  35. {
  36. mBox.transformAffine(matrix);
  37. mSphere.transform(matrix);
  38. }
  39. }