-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNPC.h
55 lines (43 loc) · 1.27 KB
/
NPC.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "Drawable.h"
#include "GameEntity.h"
#include "PhysicsObject.h"
#include "Interactable.h"
#include "Vegetable.h"
class NPC : public Drawable, public GameEntity, public PhysicsObject, public Interactable {
public:
NPC(ModelEnum curr);
~NPC();
// current animation, no custom get/set logic so is set as public field
AniMode modelAnim = DANCE; // TODO, NPC has animation
// GameEntity
void FixedUpdate() override;
// Drawable
glm::mat4 GetParentTransform() override;
ModelEnum GetModelEnum() override;
AniMode GetAniMode() override;
// PhysicsObject
void OnCollide(PhysicsObject* object) override {};
void OnTrigger(PhysicsObject* object) override {};
std::vector<Collider*> GetColliders() override;
glm::vec2* GetWorldPosition() override;
// Information
glm::vec3 GetPosition() const;
void SetWorldPosition(glm::vec3 position);
// Interactable
bool CanInteract(Player* player) override;
void OnInteract(Player* player) override;
private:
// Transformations
glm::vec2* translate = nullptr;
glm::mat4 rotation{};
glm::vec3 scale;
// Current model to display
ModelEnum model;
// Current Collider
ColliderCircle* collider_;
// Get matrix transformationa
glm::mat4 GetRotation();
glm::mat4 GetTranslation();
glm::mat4 GetScale();
};