BoxComponent.h 807 B

1234567891011121314151617181920212223242526272829
  1. // ----------------------------------------------------------------
  2. // From Game Programming in C++ by Sanjay Madhav
  3. // Copyright (C) 2017 Sanjay Madhav. All rights reserved.
  4. //
  5. // Released under the BSD License
  6. // See LICENSE in root directory for full details.
  7. // ----------------------------------------------------------------
  8. #pragma once
  9. #include "Component.h"
  10. #include "Collision.h"
  11. class BoxComponent : public Component
  12. {
  13. public:
  14. BoxComponent(class Actor* owner, int updateOrder = 100);
  15. ~BoxComponent();
  16. void OnUpdateWorldTransform() override;
  17. void SetObjectBox(const AABB& model) { mObjectBox = model; }
  18. const AABB& GetWorldBox() const { return mWorldBox; }
  19. void SetShouldRotate(bool value) { mShouldRotate = value; }
  20. private:
  21. AABB mObjectBox;
  22. AABB mWorldBox;
  23. bool mShouldRotate;
  24. };