-
Notifications
You must be signed in to change notification settings - Fork 0
/
DynamicCharacter.h
48 lines (35 loc) · 886 Bytes
/
DynamicCharacter.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
#pragma once
#include <Urho3D/Scene/LogicComponent.h>
#include <Urho3D/Graphics/AnimatedModel.h>
#include <Urho3D/Graphics/AnimationController.h>
using namespace Urho3D;
namespace bust
{
enum class BodyPart
{
Head,
Body,
Eyes,
Mouth,
FaceDetail,
Shirt,
Pants,
Hat,
};
class DynamicCharacter : public LogicComponent
{
URHO3D_OBJECT(DynamicCharacter, LogicComponent);
public:
explicit DynamicCharacter (Context *context);
static void RegisterObject (Context *context);
void OnNodeSet (Node *node) override;
void FixedUpdate (float time_step) override;
protected:
AnimationController *anim_;
AnimatedModel *head_, *body_, *eyes_, *face_detail_, *mouth_;
AnimatedModel *shirt_, *pants_, *hat_;
void SetModel (String model_file_path,
BodyPart part,
String material_file_path = "");
};
};