:godmode: ENFIN SANT-CALISSE DE CRISS

This commit is contained in:
MarcEricMartel
2023-11-19 16:46:13 -05:00
parent 82cfc2d1b1
commit 8860593740
9 changed files with 106 additions and 78 deletions

View File

@@ -16,8 +16,8 @@
#define SEED 0
#define COUNTDOWN 300
#define WORLD_SIZE_X 8
#define WORLD_SIZE_Y 8
#define WORLD_SIZE_X 64
#define WORLD_SIZE_Y 64
#define FRAMES_RENDER_CHUNKS 1
#define FRAMES_UPDATE_CHUNKS 1

View File

@@ -186,10 +186,14 @@ Player::Sound Player::ApplyPhysics(Vector3f input, World* world, float elapsedTi
return snd;
}
void Player::ApplyTransformation(Transformation& transformation, bool rel) const {
void Player::ApplyTransformation(Transformation& transformation, bool rel, bool rot) const {
transformation.ApplyRotation(-m_rotX, 1, 0, 0);
transformation.ApplyRotation(-m_rotY, 0, 1, 0);
if (rel) transformation.ApplyTranslation(-GetPOV());
if (!rot) {
transformation.ApplyRotation(-m_rotX, 1, 0, 0);
transformation.ApplyRotation(-m_rotY, 0, 1, 0);
}
}
void Player::SetDirection(Vector3f dir) { m_direction = dir; }

View File

@@ -19,7 +19,7 @@ public:
void TurnTopBottom(float value);
Vector3f GetInput(bool front, bool back, bool left, bool right, bool jump, bool dash, float elapsedTime);
Sound ApplyPhysics(Vector3f input, World* world, float elapsedTime);
void ApplyTransformation(Transformation& transformation, bool rel = true) const;
void ApplyTransformation(Transformation& transformation, bool rel = true, bool rot = true) const;
void SetDirection(Vector3f dir);
Vector3f GetPosition() const;