This commit is contained in:
MihailRis
2024-05-19 08:40:43 +03:00
parent c5f663b7cb
commit 47c6e35a0b
6 changed files with 54 additions and 48 deletions
+20 -16
View File
@@ -1,10 +1,11 @@
#ifndef PHYSICS_PHYSICSSOLVER_HPP_
#define PHYSICS_PHYSICSSOLVER_HPP_
#include <glm/glm.hpp>
#include "../typedefs.hpp"
#include "../voxels/Block.hpp"
#include <glm/glm.hpp>
class Block;
class Hitbox;
class Chunks;
@@ -12,22 +13,25 @@ class PhysicsSolver {
glm::vec3 gravity;
public:
PhysicsSolver(glm::vec3 gravity);
void step(Chunks* chunks,
Hitbox* hitbox,
float delta,
uint substeps,
bool shifting,
float gravityScale,
bool collisions);
void step(
Chunks* chunks,
Hitbox* hitbox,
float delta,
uint substeps,
bool shifting,
float gravityScale,
bool collisions
);
void colisionCalc(
Chunks* chunks,
Hitbox* hitbox,
glm::vec3& vel,
glm::vec3& pos,
const glm::vec3 half,
float stepHeight);
Chunks* chunks,
Hitbox* hitbox,
glm::vec3& vel,
glm::vec3& pos,
const glm::vec3 half,
float stepHeight
);
bool isBlockInside(int x, int y, int z, Hitbox* hitbox);
bool isBlockInside(int x, int y, int z, Block* def, blockstate_t states, Hitbox* hitbox);
};
#endif /* PHYSICS_PHYSICSSOLVER_HPP_ */
#endif // PHYSICS_PHYSICSSOLVER_HPP_