TargetComponent.cpp 729 B

123456789101112131415161718192021222324252627
  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. #include "BoxComponent.h"
  9. #include "Actor.h"
  10. #include "Game.h"
  11. #include "PhysWorld.h"
  12. #include "TargetComponent.h"
  13. #include "Math.h"
  14. #include "Game.h"
  15. #include "HUD.h"
  16. TargetComponent::TargetComponent(Actor * owner)
  17. :Component(owner)
  18. {
  19. mOwner->GetGame()->GetHUD()->AddTargetComponent(this);
  20. }
  21. TargetComponent::~TargetComponent()
  22. {
  23. mOwner->GetGame()->GetHUD()->RemoveTargetComponent(this);
  24. }