diff options
Diffstat (limited to 'src/common/Collision/Models/ModelInstance.cpp')
-rw-r--r-- | src/common/Collision/Models/ModelInstance.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/common/Collision/Models/ModelInstance.cpp b/src/common/Collision/Models/ModelInstance.cpp index b69918aee6..289763f2fb 100644 --- a/src/common/Collision/Models/ModelInstance.cpp +++ b/src/common/Collision/Models/ModelInstance.cpp @@ -14,10 +14,10 @@ using G3D::Ray; namespace VMAP { - ModelInstance::ModelInstance(const ModelSpawn &spawn, WorldModel* model): ModelSpawn(spawn), iModel(model) + ModelInstance::ModelInstance(const ModelSpawn& spawn, WorldModel* model): ModelSpawn(spawn), iModel(model) { - iInvRot = G3D::Matrix3::fromEulerAnglesZYX(G3D::pi()*iRot.y/180.f, G3D::pi()*iRot.x/180.f, G3D::pi()*iRot.z/180.f).inverse(); - iInvScale = 1.f/iScale; + iInvRot = G3D::Matrix3::fromEulerAnglesZYX(G3D::pi() * iRot.y / 180.f, G3D::pi() * iRot.x / 180.f, G3D::pi() * iRot.z / 180.f).inverse(); + iInvScale = 1.f / iScale; } bool ModelInstance::intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const @@ -30,16 +30,16 @@ namespace VMAP float time = pRay.intersectionTime(iBound); if (time == G3D::inf()) { -// std::cout << "Ray does not hit '" << name << "'\n"; + // std::cout << "Ray does not hit '" << name << "'\n"; return false; } -// std::cout << "Ray crosses bound of '" << name << "'\n"; -/* std::cout << "ray from:" << pRay.origin().x << ", " << pRay.origin().y << ", " << pRay.origin().z - << " dir:" << pRay.direction().x << ", " << pRay.direction().y << ", " << pRay.direction().z - << " t/tmax:" << time << '/' << pMaxDist; - std::cout << "\nBound lo:" << iBound.low().x << ", " << iBound.low().y << ", " << iBound.low().z << " hi: " - << iBound.high().x << ", " << iBound.high().y << ", " << iBound.high().z << std::endl; */ + // std::cout << "Ray crosses bound of '" << name << "'\n"; + /* std::cout << "ray from:" << pRay.origin().x << ", " << pRay.origin().y << ", " << pRay.origin().z + << " dir:" << pRay.direction().x << ", " << pRay.direction().y << ", " << pRay.direction().z + << " t/tmax:" << time << '/' << pMaxDist; + std::cout << "\nBound lo:" << iBound.low().x << ", " << iBound.low().y << ", " << iBound.low().z << " hi: " + << iBound.high().x << ", " << iBound.high().y << ", " << iBound.high().z << std::endl; */ // child bounds are defined in object space: Vector3 p = iInvRot * (pRay.origin() - iPos) * iInvScale; Ray modRay(p, iInvRot * pRay.direction()); @@ -53,7 +53,7 @@ namespace VMAP return hit; } - void ModelInstance::intersectPoint(const G3D::Vector3& p, AreaInfo &info) const + void ModelInstance::intersectPoint(const G3D::Vector3& p, AreaInfo& info) const { if (!iModel) { @@ -87,7 +87,7 @@ namespace VMAP } } - bool ModelInstance::GetLocationInfo(const G3D::Vector3& p, LocationInfo &info) const + bool ModelInstance::GetLocationInfo(const G3D::Vector3& p, LocationInfo& info) const { if (!iModel) { @@ -123,7 +123,7 @@ namespace VMAP return false; } - bool ModelInstance::GetLiquidLevel(const G3D::Vector3& p, LocationInfo &info, float &liqHeight) const + bool ModelInstance::GetLiquidLevel(const G3D::Vector3& p, LocationInfo& info, float& liqHeight) const { // child bounds are defined in object space: Vector3 pModel = iInvRot * (p - iPos) * iInvScale; @@ -139,7 +139,7 @@ namespace VMAP return false; } - bool ModelSpawn::readFromFile(FILE* rf, ModelSpawn &spawn) + bool ModelSpawn::readFromFile(FILE* rf, ModelSpawn& spawn) { uint32 check = 0, nameLen; check += fread(&spawn.flags, sizeof(uint32), 1, rf); @@ -185,9 +185,9 @@ namespace VMAP return true; } - bool ModelSpawn::writeToFile(FILE* wf, const ModelSpawn &spawn) + bool ModelSpawn::writeToFile(FILE* wf, const ModelSpawn& spawn) { - uint32 check=0; + uint32 check = 0; check += fwrite(&spawn.flags, sizeof(uint32), 1, wf); check += fwrite(&spawn.adtId, sizeof(uint16), 1, wf); check += fwrite(&spawn.ID, sizeof(uint32), 1, wf); |