Remove std::couts littered throughout the base (#1313)

This commit is contained in:
David Markowitz
2023-11-21 18:04:23 -08:00
committed by GitHub
parent 98dc291b57
commit 1a199151da
14 changed files with 29 additions and 91 deletions

View File

@@ -22,7 +22,7 @@ dpEntity::dpEntity(const LWOOBJID& objectID, dpShapeType shapeType, bool isStati
break;
default:
std::cout << "No shape for shapeType: " << (int)shapeType << std::endl;
LOG("No shape for shapeType: %d", static_cast<int32_t>(shapeType));
}
}
@@ -83,15 +83,9 @@ void dpEntity::CheckCollision(dpEntity* other) {
if (isColliding && !wasFound) {
m_CurrentlyCollidingObjects.emplace(other->GetObjectID(), other);
m_NewObjects.push_back(other);
//if (m_CollisionShape->GetShapeType() == dpShapeType::Sphere && other->GetShape()->GetShapeType() == dpShapeType::Sphere)
//std::cout << "started sphere col at: " << other->GetPosition().x << ", " << other->GetPosition().y << ", " << other->GetPosition().z << std::endl;
} else if (!isColliding && wasFound) {
m_CurrentlyCollidingObjects.erase(other->GetObjectID());
m_RemovedObjects.push_back(other);
//if (m_CollisionShape->GetShapeType() == dpShapeType::Sphere && other->GetShape()->GetShapeType() == dpShapeType::Sphere)
// std::cout << "stopped sphere col at: " << other->GetPosition().x << ", " << other->GetPosition().y << ", " << other->GetPosition().z << std::endl;
}
}

View File

@@ -8,8 +8,6 @@ dpGrid::dpGrid(int numCells, int cellSize) {
CELL_SIZE = cellSize;
m_DeleteGrid = true;
//dumb method but i can't be bothered
//fill x
for (int i = 0; i < NUM_CELLS; i++) {
m_Cells.push_back(std::vector<std::forward_list<dpEntity*>>());

View File

@@ -10,7 +10,7 @@ dpShapeBase::~dpShapeBase() {
}
bool dpShapeBase::IsColliding(dpShapeBase* other) {
std::cout << "Base shapes do not have any *shape* to them, and thus cannot be overlapping." << std::endl;
std::cout << "You should be using a shape class inherited from this base class." << std::endl;
LOG("Base shapes do not have any *shape* to them, and thus cannot be overlapping.");
LOG("You should be using a shape class inherited from this base class.");
return false;
}

View File

@@ -34,7 +34,7 @@ bool dpShapeBox::IsColliding(dpShapeBase* other) {
return dpCollisionChecks::CheckBoxes(m_ParentEntity, other->GetParentEntity());
default:
std::cout << "No collision detection for: " << (int)m_ShapeType << "-to-" << (int)other->GetShapeType() << " collision!" << std::endl;
LOG("No collision detection for: %i-to-%i collision!", static_cast<int32_t>(m_ShapeType), static_cast<int32_t>(other->GetShapeType()));
}
return false;
@@ -72,10 +72,7 @@ void dpShapeBox::SetScale(float scale) {
m_Height *= scale;
m_Depth *= scale;
//fuuuckkk yoouu
InitVertices();
//SetRotation(m_ParentEntity->GetRotation());
}
void dpShapeBox::SetRotation(const NiQuaternion& rotation) {

View File

@@ -1,5 +1,7 @@
#include "dpShapeSphere.h"
#include "dpCollisionChecks.h"
#include "Game.h"
#include "Logger.h"
#include <iostream>
dpShapeSphere::dpShapeSphere(dpEntity* parentEntity, float radius) :
@@ -22,7 +24,7 @@ bool dpShapeSphere::IsColliding(dpShapeBase* other) {
return dpCollisionChecks::CheckSphereBox(m_ParentEntity, other->GetParentEntity());
default:
std::cout << "No collision detection for: " << (int)m_ShapeType << "-to-" << (int)other->GetShapeType() << " collision!" << std::endl;
LOG("No collision detection for: %i-to-%i collision!", static_cast<int32_t>(m_ShapeType), static_cast<int32_t>(other->GetShapeType()));
}
return false;

View File

@@ -1,35 +0,0 @@
//This file included for reference only
/*#include <iostream>
#include <chrono>
#include <thread>
#include "dpWorld.h"
#include "NiQuaternion.hpp"
#include "NiPoint3.hpp"
int main() {
std::cout << "dPhysics test engine" << std::endl;
//Test rotation code:
NiPoint3 p(1.0f, 0.0f, 0.0f);
float angle = 45.0f;
NiQuaternion q = NiQuaternion::CreateFromAxisAngle(NiPoint3(0.0f, 0.0f, 1.0f), angle);
NiPoint3 rotated = p.RotateByQuaternion(q);
std::cout << "OG: " << p.x << ", " << p.y << ", " << p.z << std::endl;
std::cout << "Quater: " << q.x << ", " << q.y << ", " << q.z << ", " << q.w << " angle: " << angle << std::endl;
std::cout << "Rotated: " << rotated.x << ", " << rotated.y << ", " << rotated.z << std::endl;
//Test some collisions:
dpWorld::GetInstance().Initialize(1000);
while (true) {
dpWorld::GetInstance().StepWorld(1.0f/60.0f);
std::this_thread::sleep_for(std::chrono::milliseconds(16));
}
return 0;
}*/