BsBounds.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #include "BsBounds.h"
  5. #include "BsRay.h"
  6. #include "BsPlane.h"
  7. #include "BsSphere.h"
  8. namespace BansheeEngine
  9. {
  10. Bounds::Bounds()
  11. { }
  12. Bounds::Bounds(const AABox& box, const Sphere& sphere)
  13. :mBox(box), mSphere(sphere)
  14. { }
  15. void Bounds::setBounds(const AABox& box, const Sphere& sphere)
  16. {
  17. mBox = box;
  18. mSphere = sphere;
  19. }
  20. void Bounds::merge(const Bounds& rhs)
  21. {
  22. mBox.merge(rhs.mBox);
  23. mSphere.merge(rhs.mSphere);
  24. }
  25. void Bounds::merge(const Vector3& point)
  26. {
  27. mBox.merge(point);
  28. mSphere.merge(point);
  29. }
  30. void Bounds::transform(const Matrix4& matrix)
  31. {
  32. mBox.transform(matrix);
  33. mSphere.transform(matrix);
  34. }
  35. void Bounds::transformAffine(const Matrix4& matrix)
  36. {
  37. mBox.transformAffine(matrix);
  38. mSphere.transform(matrix);
  39. }
  40. }