FPSActor.h 911 B

12345678910111213141516171819202122232425262728293031323334353637
  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 "Actor.h"
  10. #include "SoundEvent.h"
  11. class FPSActor : public Actor
  12. {
  13. public:
  14. FPSActor(class Game* game);
  15. void UpdateActor(float deltaTime) override;
  16. void ActorInput(const uint8_t* keys) override;
  17. void Shoot();
  18. void SetFootstepSurface(float value);
  19. void SetVisible(bool visible);
  20. void FixCollisions();
  21. private:
  22. class MoveComponent* mMoveComp;
  23. class AudioComponent* mAudioComp;
  24. class MeshComponent* mMeshComp;
  25. class FPSCamera* mCameraComp;
  26. class BoxComponent* mBoxComp;
  27. class Actor* mFPSModel;
  28. SoundEvent mFootstep;
  29. float mLastFootstep;
  30. };