-
Notifications
You must be signed in to change notification settings - Fork 1
/
Flyer.h
77 lines (53 loc) · 1.54 KB
/
Flyer.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef __FLYER_H__
#define __FLYER_H__
#if _MSC_VER > 1000
#pragma once
#endif
#include "Player.h"
class CFlyer : public CPlayer
{
public:
struct SMovementRequestParams
{
Vec3 vLookTargetPos;
Vec3 vMoveDir;
float fDesiredSpeed;
explicit SMovementRequestParams(CMovementRequest& movementRequest) :
vLookTargetPos(movementRequest.HasLookTarget() ? movementRequest.GetLookTarget() : Vec3Constants<float>::fVec3_Zero),
vMoveDir(ZERO),
fDesiredSpeed(movementRequest.HasDesiredSpeed() ? movementRequest.GetDesiredSpeed() : 1.f)
{
}
};
struct SBodyInfo
{
Vec3 vEyePos;
Vec3 velocity;
EStance eStance;
const SStanceInfo* pStanceInfo;
SBodyInfo() :
vEyePos(ZERO),
velocity(ZERO),
eStance(STANCE_NULL),
pStanceInfo(NULL)
{
}
};
CFlyer();
virtual void GetMemoryUsage(ICrySizer* pCrySizer) const { pCrySizer->Add(*this); }
virtual void FullSerialize(TSerialize ser);
virtual void PrePhysicsUpdate();
virtual void Revive(bool bFromInit = false);
void GetActorInfo(SBodyInfo& bodyInfo);
void SetActorMovement(SMovementRequestParams& movementRequestParam);
protected:
virtual IActorMovementController* CreateMovementController();
private:
void ProcessMovement(float frameTime); // Ad-hoc
void SetDesiredVelocity(const Vec3& vDesiredVelocity);
void SetDesiredDirection(const Vec3& vDesiredDir);
Vec3 m_vDesiredVelocity;
Quat m_qDesiredRotation;
SCharacterMoveRequest m_moveRequest;
};
#endif // #ifndef __FLYER_H__