mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
add more reason to physics simulation substeps
This commit is contained in:
parent
794ce07bd5
commit
4b4f2439c0
5 changed files with 119 additions and 114 deletions
|
|
@ -18,10 +18,8 @@ public:
|
|||
PhysicsSolver(glm::vec3 gravity);
|
||||
void step(
|
||||
const GlobalChunks& chunks,
|
||||
Hitbox& hitbox,
|
||||
float delta,
|
||||
uint substeps,
|
||||
entityid_t entity
|
||||
uint substeps
|
||||
);
|
||||
|
||||
auto& getSensorsWriteable() {
|
||||
|
|
@ -32,11 +30,16 @@ public:
|
|||
return solidHitboxes;
|
||||
}
|
||||
|
||||
auto& getHitboxesWriteable() {
|
||||
return hitboxes;
|
||||
}
|
||||
|
||||
void removeSensor(Sensor* sensor);
|
||||
private:
|
||||
glm::vec3 gravity;
|
||||
std::vector<Sensor*> sensors;
|
||||
std::vector<Hitbox*> solidHitboxes;
|
||||
std::vector<Hitbox*> hitboxes;
|
||||
|
||||
void calcCollisions(
|
||||
const GlobalChunks& chunks,
|
||||
|
|
@ -52,7 +55,6 @@ private:
|
|||
Hitbox& hitbox,
|
||||
glm::vec3& vel,
|
||||
glm::vec3& pos,
|
||||
bool prevGrounded,
|
||||
float dt,
|
||||
int substeps
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue