mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
Merge
This commit is contained in:
commit
9e5d1eec5f
34 changed files with 485 additions and 410 deletions
|
|
@ -15,15 +15,15 @@
|
|||
|
||||
#include "../core_defs.h"
|
||||
|
||||
#define CAM_SHAKE_OFFSET 0.025f
|
||||
#define CAM_SHAKE_OFFSET_Y 0.031f
|
||||
#define CAM_SHAKE_SPEED 1.6f
|
||||
#define CAM_SHAKE_DELTA_K 10.0f
|
||||
#define ZOOM_SPEED 16.0f
|
||||
#define CROUCH_ZOOM 0.9f
|
||||
#define RUN_ZOOM 1.1f
|
||||
#define C_ZOOM 0.1f
|
||||
#define CROUCH_SHIFT_Y -0.2f
|
||||
const float CAM_SHAKE_OFFSET = 0.025f;
|
||||
const float CAM_SHAKE_OFFSET_Y = 0.031f;
|
||||
const float CAM_SHAKE_SPEED = 1.6f;
|
||||
const float CAM_SHAKE_DELTA_K = 10.0f;
|
||||
const float ZOOM_SPEED = 16.0f;
|
||||
const float CROUCH_ZOOM = 0.9f;
|
||||
const float RUN_ZOOM = 1.1f;
|
||||
const float C_ZOOM = 0.1f;
|
||||
const float CROUCH_SHIFT_Y = -0.2f;
|
||||
|
||||
using glm::vec2;
|
||||
using glm::vec3;
|
||||
|
|
@ -110,6 +110,7 @@ vec3 PlayerController::selectedBlockPosition;
|
|||
vec3 PlayerController::selectedPointPosition;
|
||||
vec3 PlayerController::selectedBlockNormal;
|
||||
int PlayerController::selectedBlockId = -1;
|
||||
int PlayerController::selectedBlockStates = 0;
|
||||
|
||||
PlayerController::PlayerController(Level* level, const EngineSettings& settings)
|
||||
: level(level),
|
||||
|
|
@ -133,6 +134,7 @@ void PlayerController::update(float delta, bool input, bool pause) {
|
|||
updateInteraction();
|
||||
} else {
|
||||
selectedBlockId = -1;
|
||||
selectedBlockStates = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -207,6 +209,7 @@ void PlayerController::updateInteraction(){
|
|||
if (vox != nullptr){
|
||||
player->selectedVoxel = *vox;
|
||||
selectedBlockId = vox->id;
|
||||
selectedBlockStates = vox->states;
|
||||
selectedBlockPosition = iend;
|
||||
selectedPointPosition = end;
|
||||
selectedBlockNormal = norm;
|
||||
|
|
@ -248,5 +251,6 @@ void PlayerController::updateInteraction(){
|
|||
}
|
||||
} else {
|
||||
selectedBlockId = -1;
|
||||
selectedBlockStates = 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue