mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
remove debug logging
This commit is contained in:
parent
b0d231c927
commit
5ea8df0743
1 changed files with 0 additions and 11 deletions
|
|
@ -18,8 +18,6 @@ static debug::Logger logger("physics-solver");
|
||||||
|
|
||||||
PhysicsSolver::PhysicsSolver(glm::vec3 gravity) : gravity(gravity) {}
|
PhysicsSolver::PhysicsSolver(glm::vec3 gravity) : gravity(gravity) {}
|
||||||
|
|
||||||
static int samples_count = 0;
|
|
||||||
|
|
||||||
void PhysicsSolver::step(
|
void PhysicsSolver::step(
|
||||||
const GlobalChunks& chunks,
|
const GlobalChunks& chunks,
|
||||||
Hitbox& hitbox,
|
Hitbox& hitbox,
|
||||||
|
|
@ -27,7 +25,6 @@ void PhysicsSolver::step(
|
||||||
uint substeps,
|
uint substeps,
|
||||||
entityid_t entity
|
entityid_t entity
|
||||||
) {
|
) {
|
||||||
samples_count = 0;
|
|
||||||
float dt = delta / static_cast<float>(substeps);
|
float dt = delta / static_cast<float>(substeps);
|
||||||
float linearDamping = hitbox.linearDamping * hitbox.friction;
|
float linearDamping = hitbox.linearDamping * hitbox.friction;
|
||||||
|
|
||||||
|
|
@ -61,7 +58,6 @@ void PhysicsSolver::step(
|
||||||
float x = (px-half.x+E) + ix;
|
float x = (px-half.x+E) + ix;
|
||||||
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++){
|
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++){
|
||||||
float z = (pos.z-half.z+E) + iz;
|
float z = (pos.z-half.z+E) + iz;
|
||||||
samples_count++;
|
|
||||||
if (chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half))){
|
if (chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half))){
|
||||||
hitbox.grounded = true;
|
hitbox.grounded = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -77,7 +73,6 @@ void PhysicsSolver::step(
|
||||||
float x = (pos.x-half.x+E) + ix;
|
float x = (pos.x-half.x+E) + ix;
|
||||||
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++){
|
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++){
|
||||||
float z = (pz-half.z+E) + iz;
|
float z = (pz-half.z+E) + iz;
|
||||||
samples_count++;
|
|
||||||
if (chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half))){
|
if (chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half))){
|
||||||
hitbox.grounded = true;
|
hitbox.grounded = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -124,7 +119,6 @@ void PhysicsSolver::step(
|
||||||
sensor.nextEntered.insert(entity);
|
sensor.nextEntered.insert(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info() << "total samples: " << samples_count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static float calc_step_height(
|
static float calc_step_height(
|
||||||
|
|
@ -139,7 +133,6 @@ static float calc_step_height(
|
||||||
float x = (pos.x-half.x+E) + ix;
|
float x = (pos.x-half.x+E) + ix;
|
||||||
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++) {
|
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++) {
|
||||||
float z = (pos.z-half.z+E) + iz;
|
float z = (pos.z-half.z+E) + iz;
|
||||||
samples_count++;
|
|
||||||
if (chunks.isObstacleAt(x, pos.y+half.y+stepHeight, z, aabb)) {
|
if (chunks.isObstacleAt(x, pos.y+half.y+stepHeight, z, aabb)) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +160,6 @@ static bool calc_collision_neg(
|
||||||
for (int iz = 0; iz <= glm::ceil((half[nz]-E)*2); iz++){
|
for (int iz = 0; iz <= glm::ceil((half[nz]-E)*2); iz++){
|
||||||
coord[nz] = (pos[nz]-half[nz]+E) + iz;
|
coord[nz] = (pos[nz]-half[nz]+E) + iz;
|
||||||
coord[nx] = (pos[nx]-half[nx]-E);
|
coord[nx] = (pos[nx]-half[nx]-E);
|
||||||
samples_count++;
|
|
||||||
|
|
||||||
auto boxAABB = AABB(pos - half, pos + half);
|
auto boxAABB = AABB(pos - half, pos + half);
|
||||||
glm::vec3 scale(1.0f);
|
glm::vec3 scale(1.0f);
|
||||||
|
|
@ -205,7 +197,6 @@ static void calc_collision_pos(
|
||||||
for (int iz = 0; iz <= glm::ceil((half[nz]-E)*2); iz++) {
|
for (int iz = 0; iz <= glm::ceil((half[nz]-E)*2); iz++) {
|
||||||
coord[nz] = (pos[nz]-half[nz]+E) + iz;
|
coord[nz] = (pos[nz]-half[nz]+E) + iz;
|
||||||
coord[nx] = (pos[nx]+half[nx]+E);
|
coord[nx] = (pos[nx]+half[nx]+E);
|
||||||
samples_count++;
|
|
||||||
|
|
||||||
auto boxAABB = AABB(pos - half, pos + half);
|
auto boxAABB = AABB(pos - half, pos + half);
|
||||||
glm::vec3 scale(1.0f);
|
glm::vec3 scale(1.0f);
|
||||||
|
|
@ -252,7 +243,6 @@ void PhysicsSolver::colisionCalc(
|
||||||
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++) {
|
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++) {
|
||||||
float z = (pos.z-half.z+E) + iz;
|
float z = (pos.z-half.z+E) + iz;
|
||||||
float y = (pos.y-half.y+E);
|
float y = (pos.y-half.y+E);
|
||||||
samples_count++;
|
|
||||||
if ((aabb = chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half)))){
|
if ((aabb = chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half)))){
|
||||||
vel.y = 0.0f;
|
vel.y = 0.0f;
|
||||||
float newy = std::floor(y) + aabb->max().y + half.y;
|
float newy = std::floor(y) + aabb->max().y + half.y;
|
||||||
|
|
@ -270,7 +260,6 @@ void PhysicsSolver::colisionCalc(
|
||||||
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++) {
|
for (int iz = 0; iz <= glm::ceil((half.z-E)*2); iz++) {
|
||||||
float z = (pos.z-half.z+E) + iz;
|
float z = (pos.z-half.z+E) + iz;
|
||||||
float y = (pos.y+half.y+E);
|
float y = (pos.y+half.y+E);
|
||||||
samples_count++;
|
|
||||||
if ((aabb = chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half)))){
|
if ((aabb = chunks.isObstacleAt(x,y,z, AABB(pos - half, pos + half)))){
|
||||||
vel.y = 0.0f;
|
vel.y = 0.0f;
|
||||||
float newy = std::floor(y) - half.y + aabb->min().y - E;
|
float newy = std::floor(y) - half.y + aabb->min().y - E;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue