NPC code
This commit is contained in:
1 parent
2e4a7ab467
commit
995e2c8e5b
10 files changed
+923706
-167
No files matched your search
+3
-30
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "Character.h"
|
||||
#include "BoneAnimatedModel.h"
|
||||
#include "render/Renderer.h"
|
||||
#include "Environment.h"
|
||||
@@ -55,45 +56,17 @@ namespace ZL {
|
||||
std::shared_ptr<Texture> benchTexture;
|
||||
VertexRenderStruct benchMesh;
|
||||
|
||||
BoneSystem violaIdleModel;
|
||||
VertexRenderStruct violaIdleModelMutable;
|
||||
|
||||
BoneSystem violaWalkModel;
|
||||
VertexRenderStruct violaWalkModelMutable;
|
||||
|
||||
BoneSystem zombieModel;
|
||||
VertexRenderStruct zombieModelMutable;
|
||||
|
||||
std::shared_ptr<Texture> violaTexture;
|
||||
|
||||
float zombieCurrentIdleFrame = 0;
|
||||
int zombieLastIdleFrame = 0;
|
||||
|
||||
float violaCurrentIdleFrame = 0;
|
||||
float violaCurrentWalkFrame = 0;
|
||||
|
||||
int violaLastIdleFrame = 0;
|
||||
int violaLastWalkFrame = 0;
|
||||
|
||||
int violaCurrentAnimation = 0;
|
||||
std::unique_ptr<Character> player;
|
||||
std::vector<std::unique_ptr<Character>> npcs;
|
||||
|
||||
float cameraAzimuth = 0.0f;
|
||||
float cameraInclination = M_PI * 30.f / 180.f;
|
||||
|
||||
Eigen::Vector3f violaPosition = Eigen::Vector3f(0.f, 0.f, 0.f);
|
||||
Eigen::Vector3f violaTarget = Eigen::Vector3f(0.f, 0.f, 0.f);
|
||||
float violaFacingAngle = 0.0f;
|
||||
private:
|
||||
bool rightMouseDown = false;
|
||||
int lastMouseX = 0;
|
||||
int lastMouseY = 0;
|
||||
|
||||
static constexpr float CAMERA_FOV_Y = 1.0f / 1.5f;
|
||||
static constexpr float VIOLA_WALK_SPEED = 3.0f;
|
||||
static constexpr float VIOLA_WALK_THRESHOLD = 0.05f;
|
||||
static constexpr float VIOLA_ROTATION_SPEED = 8.0f; // radians per second
|
||||
|
||||
float violaTargetFacingAngle = 0.0f;
|
||||
|
||||
int64_t getSyncTimeMs();
|
||||
void processTickCount();
|
||||
|
||||
Reference in new issue
Block a user