diff --git a/src/object/motion/motion.cpp b/src/object/motion/motion.cpp index fb3191e0..80dda912 100644 --- a/src/object/motion/motion.cpp +++ b/src/object/motion/motion.cpp @@ -57,9 +57,9 @@ CMotion::CMotion(COldObject* object) m_actionTime = 0.0f; m_progress = 0.0f; - m_linVibration = Math::Vector(0.0f, 0.0f, 0.0f); - m_cirVibration = Math::Vector(0.0f, 0.0f, 0.0f); - m_inclinaison = Math::Vector(0.0f, 0.0f, 0.0f); + m_linVibration = glm::vec3(0.0f, 0.0f, 0.0f); + m_cirVibration = glm::vec3(0.0f, 0.0f, 0.0f); + m_inclinaison = glm::vec3(0.0f, 0.0f, 0.0f); } // Object's destructor. @@ -77,7 +77,7 @@ void CMotion::SetPhysics(CPhysics* physics) bool CMotion::EventProcess(const Event &event) { - Math::Vector pos, dir; + glm::vec3 pos, dir; float time; if ( m_object->GetType() != OBJECT_TOTO && @@ -181,36 +181,36 @@ bool CMotion::Read(CLevelParserLine* line) // Getes the linear vibration. -void CMotion::SetLinVibration(Math::Vector dir) +void CMotion::SetLinVibration(glm::vec3 dir) { m_linVibration = dir; } -Math::Vector CMotion::GetLinVibration() +glm::vec3 CMotion::GetLinVibration() { return m_linVibration; } // Getes the circular vibration. -void CMotion::SetCirVibration(Math::Vector dir) +void CMotion::SetCirVibration(glm::vec3 dir) { m_cirVibration = dir; } -Math::Vector CMotion::GetCirVibration() +glm::vec3 CMotion::GetCirVibration() { return m_cirVibration; } // Getes the tilt. -void CMotion::SetTilt(Math::Vector dir) +void CMotion::SetTilt(glm::vec3 dir) { m_inclinaison = dir; } -Math::Vector CMotion::GetTilt() +glm::vec3 CMotion::GetTilt() { return m_inclinaison; } diff --git a/src/object/motion/motion.h b/src/object/motion/motion.h index 7ed32ae1..1a4a7aa3 100644 --- a/src/object/motion/motion.h +++ b/src/object/motion/motion.h @@ -25,6 +25,8 @@ #include "object/object_type.h" +#include + namespace Gfx { class CEngine; @@ -53,7 +55,7 @@ public: void SetPhysics(CPhysics* physics); virtual void DeleteObject(bool bAll=false) = 0; - virtual void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) = 0; + virtual void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) = 0; virtual bool EventProcess(const Event &event); virtual Error SetAction(int action, float time=0.2f); virtual int GetAction(); @@ -64,12 +66,12 @@ public: virtual bool Write(CLevelParserLine* line); virtual bool Read(CLevelParserLine* line); - virtual void SetLinVibration(Math::Vector dir); - virtual Math::Vector GetLinVibration(); - virtual void SetCirVibration(Math::Vector dir); - virtual Math::Vector GetCirVibration(); - virtual void SetTilt(Math::Vector dir); - virtual Math::Vector GetTilt(); + virtual void SetLinVibration(glm::vec3 dir); + virtual glm::vec3 GetLinVibration(); + virtual void SetCirVibration(glm::vec3 dir); + virtual glm::vec3 GetCirVibration(); + virtual void SetTilt(glm::vec3 dir); + virtual glm::vec3 GetTilt(); protected: CApplication* m_app; @@ -87,7 +89,7 @@ protected: float m_actionTime; float m_progress; - Math::Vector m_linVibration; // linear vibration - Math::Vector m_cirVibration; // circular vibration - Math::Vector m_inclinaison; // tilt + glm::vec3 m_linVibration = { 0, 0, 0 }; // linear vibration + glm::vec3 m_cirVibration = { 0, 0, 0 }; // circular vibration + glm::vec3 m_inclinaison = { 0, 0, 0 }; // tilt }; diff --git a/src/object/motion/motionant.cpp b/src/object/motion/motionant.cpp index 514d552a..a34c5406 100644 --- a/src/object/motion/motionant.cpp +++ b/src/object/motion/motionant.cpp @@ -68,7 +68,7 @@ void CMotionAnt::DeleteObject(bool bAll) // Creates a vehicle poses some rolling on the floor. -void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionAnt::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank; @@ -85,8 +85,8 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, // A vehicle must have necessarily a collision //with a sphere of center (0, y, 0) (see GetCrashSphere). - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-0.5f, 1.0f, 0.0f), 4.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(-0.5f, 1.0f, 0.0f), 4.0f)); // Creates the head. rank = m_engine->CreateObject(); @@ -94,7 +94,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("ant2.mod", false, rank); - m_object->SetPartPosition(1, Math::Vector(2.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(2.0f, 0.0f, 0.0f)); // Creates the tail. rank = m_engine->CreateObject(); @@ -102,7 +102,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("ant3.mod", false, rank); - m_object->SetPartPosition(2, Math::Vector(-1.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(-1.0f, 0.0f, 0.0f)); // Creates a right-back thigh. rank = m_engine->CreateObject(); @@ -110,7 +110,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(3, Math::Vector(-0.4f, -0.1f, -0.3f)); + m_object->SetPartPosition(3, glm::vec3(-0.4f, -0.1f, -0.3f)); // Creates a right-back leg. rank = m_engine->CreateObject(); @@ -118,7 +118,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 3); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(4, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(4, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates a right-back foot. rank = m_engine->CreateObject(); @@ -126,7 +126,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 4); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(5, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates two middle-right thighs. rank = m_engine->CreateObject(); @@ -134,7 +134,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(6, Math::Vector(0.1f, -0.1f, -0.4f)); + m_object->SetPartPosition(6, glm::vec3(0.1f, -0.1f, -0.4f)); // Creates two middle-right legs. rank = m_engine->CreateObject(); @@ -142,7 +142,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 6); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(7, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates two middle-right foots. rank = m_engine->CreateObject(); @@ -150,7 +150,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 7); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(8, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(8, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates the right front thigh. rank = m_engine->CreateObject(); @@ -158,7 +158,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(9, Math::Vector(1.4f, -0.1f, -0.6f)); + m_object->SetPartPosition(9, glm::vec3(1.4f, -0.1f, -0.6f)); // Creates the right front leg. rank = m_engine->CreateObject(); @@ -166,7 +166,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(10, rank); m_object->SetObjectParent(10, 9); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(10, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(10, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates the right front foot. rank = m_engine->CreateObject(); @@ -174,7 +174,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(11, rank); m_object->SetObjectParent(11, 10); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(11, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates a left-back thigh. rank = m_engine->CreateObject(); @@ -182,7 +182,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(12, rank); m_object->SetObjectParent(12, 0); modelManager->AddModelReference("ant4.mod", true, rank); - m_object->SetPartPosition(12, Math::Vector(-0.4f, -0.1f, 0.3f)); + m_object->SetPartPosition(12, glm::vec3(-0.4f, -0.1f, 0.3f)); // Creates a left-back leg. rank = m_engine->CreateObject(); @@ -190,7 +190,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(13, rank); m_object->SetObjectParent(13, 12); modelManager->AddModelReference("ant5.mod", true, rank); - m_object->SetPartPosition(13, Math::Vector(0.0f, 0.0f, 1.0f)); + m_object->SetPartPosition(13, glm::vec3(0.0f, 0.0f, 1.0f)); // Creates a left-back foot. rank = m_engine->CreateObject(); @@ -198,7 +198,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(14, rank); m_object->SetObjectParent(14, 13); modelManager->AddModelReference("ant6.mod", true, rank); - m_object->SetPartPosition(14, Math::Vector(0.0f, 0.0f, 2.0f)); + m_object->SetPartPosition(14, glm::vec3(0.0f, 0.0f, 2.0f)); // Creates two middle-left thighs. rank = m_engine->CreateObject(); @@ -206,7 +206,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(15, rank); m_object->SetObjectParent(15, 0); modelManager->AddModelReference("ant4.mod", true, rank); - m_object->SetPartPosition(15, Math::Vector(0.1f, -0.1f, 0.4f)); + m_object->SetPartPosition(15, glm::vec3(0.1f, -0.1f, 0.4f)); // Creates two middle-left legs. rank = m_engine->CreateObject(); @@ -214,7 +214,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(16, rank); m_object->SetObjectParent(16, 15); modelManager->AddModelReference("ant5.mod", true, rank); - m_object->SetPartPosition(16, Math::Vector(0.0f, 0.0f, 1.0f)); + m_object->SetPartPosition(16, glm::vec3(0.0f, 0.0f, 1.0f)); // Creates two middle-left foot. rank = m_engine->CreateObject(); @@ -222,7 +222,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(17, rank); m_object->SetObjectParent(17, 16); modelManager->AddModelReference("ant6.mod", true, rank); - m_object->SetPartPosition(17, Math::Vector(0.0f, 0.0f, 2.0f)); + m_object->SetPartPosition(17, glm::vec3(0.0f, 0.0f, 2.0f)); // Creates the left front thigh. rank = m_engine->CreateObject(); @@ -230,7 +230,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(18, rank); m_object->SetObjectParent(18, 0); modelManager->AddModelReference("ant4.mod", true, rank); - m_object->SetPartPosition(18, Math::Vector(1.4f, -0.1f, 0.6f)); + m_object->SetPartPosition(18, glm::vec3(1.4f, -0.1f, 0.6f)); // Creates the left front leg. rank = m_engine->CreateObject(); @@ -238,7 +238,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(19, rank); m_object->SetObjectParent(19, 18); modelManager->AddModelReference("ant5.mod", true, rank); - m_object->SetPartPosition(19, Math::Vector(0.0f, 0.0f, 1.0f)); + m_object->SetPartPosition(19, glm::vec3(0.0f, 0.0f, 1.0f)); // Creates the left front foot. rank = m_engine->CreateObject(); @@ -246,7 +246,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(20, rank); m_object->SetObjectParent(20, 19); modelManager->AddModelReference("ant6.mod", true, rank); - m_object->SetPartPosition(20, Math::Vector(0.0f, 0.0f, 2.0f)); + m_object->SetPartPosition(20, glm::vec3(0.0f, 0.0f, 2.0f)); m_object->CreateShadowCircle(4.0f, 0.5f); @@ -391,7 +391,7 @@ bool CMotionAnt::EventProcess(const Event &event) bool CMotionAnt::EventFrame(const Event &event) { - Math::Vector dir, pos, speed; + glm::vec3 dir, pos, speed; glm::vec2 dim; float s, a, prog = 0.0f, time; float tSt[9], tNd[9]; @@ -575,11 +575,11 @@ bool CMotionAnt::EventFrame(const Event &event) } else if ( m_actionType == MAS_BURN ) // burning? { - dir = Math::Vector(Math::PI, 0.0f, 0.0f); + dir = glm::vec3(Math::PI, 0.0f, 0.0f); SetCirVibration(dir); - dir = Math::Vector(0.0f, -1.5f, 0.0f); + dir = glm::vec3(0.0f, -1.5f, 0.0f); SetLinVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); time = event.rTime*1.0f; @@ -588,7 +588,7 @@ bool CMotionAnt::EventFrame(const Event &event) } else if ( m_actionType == MAS_RUIN ) // destroyed? { - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetLinVibration(dir); SetCirVibration(dir); SetTilt(dir); @@ -627,7 +627,7 @@ bool CMotionAnt::EventFrame(const Event &event) dir.z = 0.0f; SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); if ( m_progress >= 1.0f ) @@ -656,7 +656,7 @@ bool CMotionAnt::EventFrame(const Event &event) } } - dir = Math::Vector(0.0f, -1.0f, 0.0f); + dir = glm::vec3(0.0f, -1.0f, 0.0f); SetLinVibration(dir); dir.x = sinf(m_armTimeAbs* 4.0f)*0.10f+ sinf(m_armTimeAbs* 7.0f)*0.20f+ @@ -671,7 +671,7 @@ bool CMotionAnt::EventFrame(const Event &event) sinf(m_armTimeAbs* 9.0f)*0.04f+ sinf(m_armTimeAbs*23.0f)*0.03f; SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); m_object->SetPartRotationY(1, sinf(m_armTimeAbs*8.0f)*0.7f); // head @@ -718,7 +718,7 @@ bool CMotionAnt::EventFrame(const Event &event) dir.z = 0.0f; SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); if ( m_progress >= 1.0f ) @@ -737,7 +737,7 @@ bool CMotionAnt::EventFrame(const Event &event) { m_object->SetPartRotationZ(2, sinf(m_armTimeAbs*1.7f)*0.15f); // tail - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetLinVibration(dir); SetTilt(dir); } @@ -776,7 +776,7 @@ bool CMotionAnt::EventFrame(const Event &event) SetLinVibration(dir); } - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetCirVibration(dir); m_object->SetPartRotationZ(1, sinf(m_armTimeAbs*1.4f)*0.20f); // head diff --git a/src/object/motion/motionant.h b/src/object/motion/motionant.h index b9476b6c..00978f8e 100644 --- a/src/object/motion/motionant.h +++ b/src/object/motion/motionant.h @@ -51,7 +51,7 @@ public: ~CMotionAnt(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; protected: diff --git a/src/object/motion/motionbee.cpp b/src/object/motion/motionbee.cpp index 1f4b7770..40f72588 100644 --- a/src/object/motion/motionbee.cpp +++ b/src/object/motion/motionbee.cpp @@ -63,7 +63,7 @@ void CMotionBee::DeleteObject(bool bAll) // Creates a vehicle traveling any lands on the ground. -void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionBee::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank; @@ -80,8 +80,8 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, // A vehicle must have an obligatory collision // with a sphere of center (0, y, 0) (see GetCrashSphere). - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-1.0f, 1.0f, 0.0f), 5.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(-1.0f, 1.0f, 0.0f), 5.0f)); // Creates the head. rank = m_engine->CreateObject(); @@ -89,7 +89,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("bee2.mod", false, rank); - m_object->SetPartPosition(1, Math::Vector(1.6f, 0.3f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(1.6f, 0.3f, 0.0f)); // Creates the tail. rank = m_engine->CreateObject(); @@ -97,7 +97,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("bee3.mod", false, rank); - m_object->SetPartPosition(2, Math::Vector(-0.8f, 0.0f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(-0.8f, 0.0f, 0.0f)); // Creates a right-back thigh. rank = m_engine->CreateObject(); @@ -105,7 +105,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(3, Math::Vector(-0.3f, -0.1f, -0.2f)); + m_object->SetPartPosition(3, glm::vec3(-0.3f, -0.1f, -0.2f)); // Creates a right-back leg. rank = m_engine->CreateObject(); @@ -113,7 +113,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 3); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(4, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(4, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates a right-back foot. rank = m_engine->CreateObject(); @@ -121,7 +121,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 4); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(5, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates two middle-right thighs. rank = m_engine->CreateObject(); @@ -129,7 +129,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(6, Math::Vector(0.3f, -0.1f, -0.4f)); + m_object->SetPartPosition(6, glm::vec3(0.3f, -0.1f, -0.4f)); // Creates two middle-right legs. rank = m_engine->CreateObject(); @@ -137,7 +137,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 6); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(7, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates two middle-right feet. rank = m_engine->CreateObject(); @@ -145,7 +145,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 7); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(8, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(8, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates the right front thigh. rank = m_engine->CreateObject(); @@ -153,7 +153,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(9, Math::Vector(1.0f, -0.1f, -0.7f)); + m_object->SetPartPosition(9, glm::vec3(1.0f, -0.1f, -0.7f)); // Creates the right front leg. rank = m_engine->CreateObject(); @@ -161,7 +161,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(10, rank); m_object->SetObjectParent(10, 9); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(10, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(10, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates the right front foot. rank = m_engine->CreateObject(); @@ -169,7 +169,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(11, rank); m_object->SetObjectParent(11, 10); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(11, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates a left-back thigh. rank = m_engine->CreateObject(); @@ -177,7 +177,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(12, rank); m_object->SetObjectParent(12, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(12, Math::Vector(-0.3f, -0.1f, 0.2f)); + m_object->SetPartPosition(12, glm::vec3(-0.3f, -0.1f, 0.2f)); m_object->SetPartRotationY(12, Math::PI); // Creates a left-back leg. @@ -186,7 +186,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(13, rank); m_object->SetObjectParent(13, 12); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(13, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(13, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates a left-back foot. rank = m_engine->CreateObject(); @@ -194,7 +194,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(14, rank); m_object->SetObjectParent(14, 13); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(14, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(14, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates two middle-left thigh. rank = m_engine->CreateObject(); @@ -202,7 +202,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(15, rank); m_object->SetObjectParent(15, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(15, Math::Vector(0.3f, -0.1f, 0.4f)); + m_object->SetPartPosition(15, glm::vec3(0.3f, -0.1f, 0.4f)); m_object->SetPartRotationY(15, Math::PI); // Creates two middle-left legs. @@ -211,7 +211,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(16, rank); m_object->SetObjectParent(16, 15); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(16, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(16, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates two middle-left feet. rank = m_engine->CreateObject(); @@ -219,7 +219,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(17, rank); m_object->SetObjectParent(17, 16); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(17, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(17, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates front-left thigh. rank = m_engine->CreateObject(); @@ -227,7 +227,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(18, rank); m_object->SetObjectParent(18, 0); modelManager->AddModelReference("ant4.mod", false, rank); - m_object->SetPartPosition(18, Math::Vector(1.0f, -0.1f, 0.7f)); + m_object->SetPartPosition(18, glm::vec3(1.0f, -0.1f, 0.7f)); m_object->SetPartRotationY(18, Math::PI); // Creates front-left leg. @@ -236,7 +236,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(19, rank); m_object->SetObjectParent(19, 18); modelManager->AddModelReference("ant5.mod", false, rank); - m_object->SetPartPosition(19, Math::Vector(0.0f, 0.0f, -1.0f)); + m_object->SetPartPosition(19, glm::vec3(0.0f, 0.0f, -1.0f)); // Creates front-left foot. rank = m_engine->CreateObject(); @@ -244,7 +244,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(20, rank); m_object->SetObjectParent(20, 19); modelManager->AddModelReference("ant6.mod", false, rank); - m_object->SetPartPosition(20, Math::Vector(0.0f, 0.0f, -2.0f)); + m_object->SetPartPosition(20, glm::vec3(0.0f, 0.0f, -2.0f)); // Creates the right wing. rank = m_engine->CreateObject(); @@ -252,7 +252,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(21, rank); m_object->SetObjectParent(21, 0); modelManager->AddModelReference("bee7.mod", false, rank); - m_object->SetPartPosition(21, Math::Vector(0.8f, 0.4f, -0.5f)); + m_object->SetPartPosition(21, glm::vec3(0.8f, 0.4f, -0.5f)); // Creates the left wing. rank = m_engine->CreateObject(); @@ -260,7 +260,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(22, rank); m_object->SetObjectParent(22, 0); modelManager->AddModelReference("bee7.mod", true, rank); - m_object->SetPartPosition(22, Math::Vector(0.8f, 0.4f, 0.5f)); + m_object->SetPartPosition(22, glm::vec3(0.8f, 0.4f, 0.5f)); m_object->CreateShadowCircle(6.0f, 0.5f); @@ -370,7 +370,7 @@ bool CMotionBee::EventProcess(const Event &event) bool CMotionBee::EventFrame(const Event &event) { - Math::Vector dir; + glm::vec3 dir; float s, a, prog = 0.0f; int action, i, st, nd; bool bStop; diff --git a/src/object/motion/motionbee.h b/src/object/motion/motionbee.h index 31d2cbc8..764eeada 100644 --- a/src/object/motion/motionbee.h +++ b/src/object/motion/motionbee.h @@ -45,7 +45,7 @@ public: ~CMotionBee(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; protected: diff --git a/src/object/motion/motionhuman.cpp b/src/object/motion/motionhuman.cpp index a83960fa..e59063b9 100644 --- a/src/object/motion/motionhuman.cpp +++ b/src/object/motion/motionhuman.cpp @@ -105,7 +105,7 @@ Error CMotionHuman::SetAction(int action, float time) // Creates cosmonaut on the ground. -void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionHuman::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { char filename[100]; @@ -158,8 +158,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetRotationY(angle); // A vehicle must have an obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere). - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 2.0f, SOUND_AIE, 0.20f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 1.0f, 0.0f), 4.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 0.0f, 0.0f), 2.0f, SOUND_AIE, 0.20f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 1.0f, 0.0f), 4.0f)); // Creates the head. rank = m_engine->CreateObject(); @@ -188,11 +188,11 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, modelManager->AddModelReference("human2t.mod", false, rank); } - m_object->SetPartPosition(1, Math::Vector(0.0f, 2.7f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 2.7f, 0.0f)); if (option == 1 || // head without helmet? option == 2) // without a backpack? { - m_object->SetPartScale(1, Math::Vector(1.0f, 1.05f, 1.0f)); + m_object->SetPartScale(1, glm::vec3(1.0f, 1.05f, 1.0f)); } // Creates the glasses. @@ -213,8 +213,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("human3.mod", false, rank); - m_object->SetPartPosition(2, Math::Vector(0.0f, 2.3f, -1.2f)); - m_object->SetPartRotation(2, Math::Vector(90.0f*Math::PI/180.0f, 90.0f*Math::PI/180.0f, -50.0f*Math::PI/180.0f)); + m_object->SetPartPosition(2, glm::vec3(0.0f, 2.3f, -1.2f)); + m_object->SetPartRotation(2, glm::vec3(90.0f*Math::PI/180.0f, 90.0f*Math::PI/180.0f, -50.0f*Math::PI/180.0f)); // Creates the right forearm. rank = m_engine->CreateObject(); @@ -222,8 +222,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 2); modelManager->AddModelReference("human4r.mod", false, rank); - m_object->SetPartPosition(3, Math::Vector(1.3f, 0.0f, 0.0f)); - m_object->SetPartRotation(3, Math::Vector(0.0f*Math::PI/180.0f, -20.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f)); + m_object->SetPartPosition(3, glm::vec3(1.3f, 0.0f, 0.0f)); + m_object->SetPartRotation(3, glm::vec3(0.0f*Math::PI/180.0f, -20.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f)); // Creates right hand. rank = m_engine->CreateObject(); @@ -231,7 +231,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 3); modelManager->AddModelReference("human5.mod", false, rank); - m_object->SetPartPosition(4, Math::Vector(1.2f, 0.0f, 0.0f)); + m_object->SetPartPosition(4, glm::vec3(1.2f, 0.0f, 0.0f)); // Creates the right thigh. rank = m_engine->CreateObject(); @@ -239,8 +239,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 0); modelManager->AddModelReference("human6.mod", false, rank); - m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -0.7f)); - m_object->SetPartRotation(5, Math::Vector(10.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); + m_object->SetPartPosition(5, glm::vec3(0.0f, 0.0f, -0.7f)); + m_object->SetPartRotation(5, glm::vec3(10.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); // Creates the right leg. rank = m_engine->CreateObject(); @@ -248,8 +248,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 5); modelManager->AddModelReference("human7.mod", false, rank); - m_object->SetPartPosition(6, Math::Vector(0.0f, -1.5f, 0.0f)); - m_object->SetPartRotation(6, Math::Vector(0.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, -10.0f*Math::PI/180.0f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, -1.5f, 0.0f)); + m_object->SetPartRotation(6, glm::vec3(0.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, -10.0f*Math::PI/180.0f)); // Creates the right foot. rank = m_engine->CreateObject(); @@ -257,8 +257,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 6); modelManager->AddModelReference("human8.mod", false, rank); - m_object->SetPartPosition(7, Math::Vector(0.0f, -1.5f, 0.0f)); - m_object->SetPartRotation(7, Math::Vector(-10.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, -1.5f, 0.0f)); + m_object->SetPartRotation(7, glm::vec3(-10.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); // Creates the left arm. rank = m_engine->CreateObject(); @@ -266,8 +266,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 0); modelManager->AddModelReference("human3.mod", true, rank); - m_object->SetPartPosition(8, Math::Vector(0.0f, 2.3f, 1.2f)); - m_object->SetPartRotation(8, Math::Vector(-90.0f*Math::PI/180.0f, -90.0f*Math::PI/180.0f, -50.0f*Math::PI/180.0f)); + m_object->SetPartPosition(8, glm::vec3(0.0f, 2.3f, 1.2f)); + m_object->SetPartRotation(8, glm::vec3(-90.0f*Math::PI/180.0f, -90.0f*Math::PI/180.0f, -50.0f*Math::PI/180.0f)); // Creates the left forearm. rank = m_engine->CreateObject(); @@ -275,8 +275,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 8); modelManager->AddModelReference("human4l.mod", true, rank); - m_object->SetPartPosition(9, Math::Vector(1.3f, 0.0f, 0.0f)); - m_object->SetPartRotation(9, Math::Vector(0.0f*Math::PI/180.0f, 20.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f)); + m_object->SetPartPosition(9, glm::vec3(1.3f, 0.0f, 0.0f)); + m_object->SetPartRotation(9, glm::vec3(0.0f*Math::PI/180.0f, 20.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f)); // Creates left hand. rank = m_engine->CreateObject(); @@ -284,7 +284,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(10, rank); m_object->SetObjectParent(10, 9); modelManager->AddModelReference("human5.mod", true, rank); - m_object->SetPartPosition(10, Math::Vector(1.2f, 0.0f, 0.0f)); + m_object->SetPartPosition(10, glm::vec3(1.2f, 0.0f, 0.0f)); // Creates the left thigh. rank = m_engine->CreateObject(); @@ -292,8 +292,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(11, rank); m_object->SetObjectParent(11, 0); modelManager->AddModelReference("human6.mod", true, rank); - m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, 0.7f)); - m_object->SetPartRotation(11, Math::Vector(-10.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); + m_object->SetPartPosition(11, glm::vec3(0.0f, 0.0f, 0.7f)); + m_object->SetPartRotation(11, glm::vec3(-10.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); // Creates the left leg. rank = m_engine->CreateObject(); @@ -301,8 +301,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(12, rank); m_object->SetObjectParent(12, 11); modelManager->AddModelReference("human7.mod", true, rank); - m_object->SetPartPosition(12, Math::Vector(0.0f, -1.5f, 0.0f)); - m_object->SetPartRotation(12, Math::Vector(0.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, -10.0f*Math::PI/180.0f)); + m_object->SetPartPosition(12, glm::vec3(0.0f, -1.5f, 0.0f)); + m_object->SetPartRotation(12, glm::vec3(0.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, -10.0f*Math::PI/180.0f)); // Creates the left foot. rank = m_engine->CreateObject(); @@ -310,8 +310,8 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(13, rank); m_object->SetObjectParent(13, 12); modelManager->AddModelReference("human8.mod", true, rank); - m_object->SetPartPosition(13, Math::Vector(0.0f, -1.5f, 0.0f)); - m_object->SetPartRotation(13, Math::Vector(10.0f*Math::PI/180.0f, -5.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); + m_object->SetPartPosition(13, glm::vec3(0.0f, -1.5f, 0.0f)); + m_object->SetPartRotation(13, glm::vec3(10.0f*Math::PI/180.0f, -5.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f)); // Creates the neutron gun. if ( option != 2 && !m_main->GetPlusExplorer()) // with backpack? @@ -321,7 +321,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(14, rank); m_object->SetObjectParent(14, 0); modelManager->AddModelReference("human9.mod", false, rank); - m_object->SetPartPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f)); + m_object->SetPartPosition(14, glm::vec3(-1.5f, 0.3f, -1.35f)); m_object->SetPartRotationZ(14, Math::PI); } @@ -613,7 +613,7 @@ bool CMotionHuman::EventProcess(const Event &event) bool CMotionHuman::EventFrame(const Event &event) { Math::Matrix* mat; - Math::Vector dir, actual, pos, speed, pf; + glm::vec3 dir, actual, pos, speed, pf; glm::vec2 center, dim, p2; float s, a, prog, rTime[2], lTime[2], time, rot, hr, hl; float al, ar, af; @@ -644,13 +644,13 @@ bool CMotionHuman::EventFrame(const Event &event) if ( m_bDisplayPerso && m_main->GetGamerOnlyHead() ) { m_time += event.rTime; - m_object->SetLinVibration(Math::Vector(0.0f, -0.55f, 0.0f)); - m_object->SetCirVibration(Math::Vector(0.0f, m_main->GetPersoAngle(), 0.0f)); + m_object->SetLinVibration(glm::vec3(0.0f, -0.55f, 0.0f)); + m_object->SetCirVibration(glm::vec3(0.0f, m_main->GetPersoAngle(), 0.0f)); return true; } if ( m_bDisplayPerso ) { - m_object->SetCirVibration(Math::Vector(0.0f, m_main->GetPersoAngle()+0.2f, 0.0f)); + m_object->SetCirVibration(glm::vec3(0.0f, m_main->GetPersoAngle()+0.2f, 0.0f)); } if ( m_glassesRank != -1 ) @@ -1181,7 +1181,7 @@ bool CMotionHuman::EventFrame(const Event &event) pos.x += (Math::Rand()-0.5f)*4.0f; pos.z += (Math::Rand()-0.5f)*4.0f; m_terrain->AdjustToFloor(pos); - speed = Math::Vector(0.0f, 0.0f, 0.0f); + speed = glm::vec3(0.0f, 0.0f, 0.0f); dim.x = 1.2f+Math::Rand()*1.2f; dim.y = dim.x; m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f, 0.0f, 0.0f); @@ -1251,7 +1251,7 @@ bool CMotionHuman::EventFrame(const Event &event) pos.x += (Math::Rand()-0.5f)*8.0f; pos.z += (Math::Rand()-0.5f)*8.0f; m_terrain->AdjustToFloor(pos); - speed = Math::Vector(0.0f, 0.0f, 0.0f); + speed = glm::vec3(0.0f, 0.0f, 0.0f); dim.x = 2.0f+Math::Rand()*1.5f; dim.y = dim.x; m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f, 0.0f, 0.0f); @@ -1352,7 +1352,7 @@ bool CMotionHuman::EventFrame(const Event &event) dir.z = Math::Smooth(actual.z, dir.z, time); m_object->SetTilt(dir); - m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f)); + m_object->SetCirVibration(glm::vec3(0.0f, 0.0f, 0.0f)); } else if ( m_actionType == MHS_LOST ) // lost? { @@ -1374,7 +1374,7 @@ bool CMotionHuman::EventFrame(const Event &event) SetLinVibration(dir); mat = m_object->GetWorldMatrix(0); - pos = Math::Vector(0.5f, 3.7f, 0.0f); + pos = glm::vec3(0.5f, 3.7f, 0.0f); pos.x += (Math::Rand()-0.5f)*1.0f; pos.y += (Math::Rand()-0.5f)*1.0f; pos.z += (Math::Rand()-0.5f)*1.0f; @@ -1388,9 +1388,9 @@ bool CMotionHuman::EventFrame(const Event &event) } else if ( m_actionType == MHS_SATCOM ) // look at the SatCom? { - SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f)); - SetLinVibration(Math::Vector(0.0f, 0.0f, 0.0f)); - SetTilt(Math::Vector(0.0f, 0.0f, 0.0f)); + SetCirVibration(glm::vec3(0.0f, 0.0f, 0.0f)); + SetLinVibration(glm::vec3(0.0f, 0.0f, 0.0f)); + SetTilt(glm::vec3(0.0f, 0.0f, 0.0f)); } else { diff --git a/src/object/motion/motionhuman.h b/src/object/motion/motionhuman.h index 450f275b..93e069cc 100644 --- a/src/object/motion/motionhuman.h +++ b/src/object/motion/motionhuman.h @@ -63,7 +63,7 @@ public: ~CMotionHuman(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; Error SetAction(int action, float time=0.2f) override; diff --git a/src/object/motion/motionlevelcontroller.cpp b/src/object/motion/motionlevelcontroller.cpp index c94ae759..39057cd8 100644 --- a/src/object/motion/motionlevelcontroller.cpp +++ b/src/object/motion/motionlevelcontroller.cpp @@ -46,7 +46,7 @@ void CMotionLevelController::DeleteObject(bool bAll) // Creates a LevelController motion -void CMotionLevelController::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionLevelController::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager*) { m_object->SetType(type); diff --git a/src/object/motion/motionlevelcontroller.h b/src/object/motion/motionlevelcontroller.h index 28c57862..ccc1bbe6 100644 --- a/src/object/motion/motionlevelcontroller.h +++ b/src/object/motion/motionlevelcontroller.h @@ -29,5 +29,5 @@ public: ~CMotionLevelController(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; }; diff --git a/src/object/motion/motionqueen.cpp b/src/object/motion/motionqueen.cpp index 88efa296..f037c8dc 100644 --- a/src/object/motion/motionqueen.cpp +++ b/src/object/motion/motionqueen.cpp @@ -63,7 +63,7 @@ void CMotionQueen::DeleteObject(bool bAll) // Creates a vehicle traveling any lands on the ground. -void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionQueen::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank; @@ -80,8 +80,8 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, // A vehicle must have a obligatory collision //with a sphere of center (0, y, 0) (see GetCrashSphere). - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 20.0f, SOUND_BOUM, 0.20f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-2.0f, 10.0f, 0.0f), 25.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 0.0f, 0.0f), 20.0f, SOUND_BOUM, 0.20f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(-2.0f, 10.0f, 0.0f), 25.0f)); // Creates the head. rank = m_engine->CreateObject(); @@ -89,7 +89,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("mother2.mod", false, rank); - m_object->SetPartPosition(1, Math::Vector(16.0f, 3.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(16.0f, 3.0f, 0.0f)); // Creates a right-back leg. rank = m_engine->CreateObject(); @@ -97,7 +97,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("mother3.mod", false, rank); - m_object->SetPartPosition(2, Math::Vector(-5.0f, -1.0f, -12.0f)); + m_object->SetPartPosition(2, glm::vec3(-5.0f, -1.0f, -12.0f)); // Creates a right-back foot. rank = m_engine->CreateObject(); @@ -105,7 +105,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 2); modelManager->AddModelReference("mother4.mod", false, rank); - m_object->SetPartPosition(3, Math::Vector(0.0f, 0.0f, -8.5f)); + m_object->SetPartPosition(3, glm::vec3(0.0f, 0.0f, -8.5f)); // Creates a middle-right leg. rank = m_engine->CreateObject(); @@ -113,7 +113,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 0); modelManager->AddModelReference("mother3.mod", false, rank); - m_object->SetPartPosition(4, Math::Vector(3.5f, -1.0f, -12.0f)); + m_object->SetPartPosition(4, glm::vec3(3.5f, -1.0f, -12.0f)); // Creates a middle-right foot. rank = m_engine->CreateObject(); @@ -121,7 +121,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 4); modelManager->AddModelReference("mother4.mod", false, rank); - m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -8.5f)); + m_object->SetPartPosition(5, glm::vec3(0.0f, 0.0f, -8.5f)); // Creates a right-front leg. rank = m_engine->CreateObject(); @@ -129,7 +129,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("mother3.mod", false, rank); - m_object->SetPartPosition(6, Math::Vector(10.0f, -1.0f, -10.0f)); + m_object->SetPartPosition(6, glm::vec3(10.0f, -1.0f, -10.0f)); // Creates a right-front foot. rank = m_engine->CreateObject(); @@ -137,7 +137,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 6); modelManager->AddModelReference("mother4.mod", false, rank); - m_object->SetPartPosition(7, Math::Vector(0.0f, 0.0f, -8.5f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 0.0f, -8.5f)); // Creates a left-back leg. rank = m_engine->CreateObject(); @@ -145,7 +145,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 0); modelManager->AddModelReference("mother3.mod", false, rank); - m_object->SetPartPosition(8, Math::Vector(-5.0f, -1.0f, 12.0f)); + m_object->SetPartPosition(8, glm::vec3(-5.0f, -1.0f, 12.0f)); m_object->SetPartRotationY(8, Math::PI); // Creates a left-back foot. @@ -154,7 +154,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 8); modelManager->AddModelReference("mother4.mod", false, rank); - m_object->SetPartPosition(9, Math::Vector(0.0f, 0.0f, -8.5f)); + m_object->SetPartPosition(9, glm::vec3(0.0f, 0.0f, -8.5f)); // Creates a middle-left leg. rank = m_engine->CreateObject(); @@ -162,7 +162,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(10, rank); m_object->SetObjectParent(10, 0); modelManager->AddModelReference("mother3.mod", false, rank); - m_object->SetPartPosition(10, Math::Vector(3.5f, -1.0f, 12.0f)); + m_object->SetPartPosition(10, glm::vec3(3.5f, -1.0f, 12.0f)); m_object->SetPartRotationY(10, Math::PI); // Creates a middle-left foot. @@ -171,7 +171,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(11, rank); m_object->SetObjectParent(11, 10); modelManager->AddModelReference("mother4.mod", false, rank); - m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, -8.5f)); + m_object->SetPartPosition(11, glm::vec3(0.0f, 0.0f, -8.5f)); // Creates a left-front leg. rank = m_engine->CreateObject(); @@ -179,7 +179,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(12, rank); m_object->SetObjectParent(12, 0); modelManager->AddModelReference("mother3.mod", false, rank); - m_object->SetPartPosition(12, Math::Vector(10.0f, -1.0f, 10.0f)); + m_object->SetPartPosition(12, glm::vec3(10.0f, -1.0f, 10.0f)); m_object->SetPartRotationY(12, Math::PI); // Creates a left-front foot. @@ -188,7 +188,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(13, rank); m_object->SetObjectParent(13, 12); modelManager->AddModelReference("mother4.mod", false, rank); - m_object->SetPartPosition(13, Math::Vector(0.0f, 0.0f, -8.5f)); + m_object->SetPartPosition(13, glm::vec3(0.0f, 0.0f, -8.5f)); // Creates the right antenna. rank = m_engine->CreateObject(); @@ -196,14 +196,14 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(14, rank); m_object->SetObjectParent(14, 1); modelManager->AddModelReference("mother5.mod", false, rank); - m_object->SetPartPosition(14, Math::Vector(6.0f, 1.0f, -2.5f)); + m_object->SetPartPosition(14, glm::vec3(6.0f, 1.0f, -2.5f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(15, rank); m_object->SetObjectParent(15, 14); modelManager->AddModelReference("mother6.mod", false, rank); - m_object->SetPartPosition(15, Math::Vector(8.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(15, glm::vec3(8.0f, 0.0f, 0.0f)); // Creates the left antenna. rank = m_engine->CreateObject(); @@ -211,14 +211,14 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(16, rank); m_object->SetObjectParent(16, 1); modelManager->AddModelReference("mother5.mod", false, rank); - m_object->SetPartPosition(16, Math::Vector(6.0f, 1.0f, 2.5f)); + m_object->SetPartPosition(16, glm::vec3(6.0f, 1.0f, 2.5f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(17, rank); m_object->SetObjectParent(17, 16); modelManager->AddModelReference("mother6.mod", false, rank); - m_object->SetPartPosition(17, Math::Vector(8.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(17, glm::vec3(8.0f, 0.0f, 0.0f)); // Creates the right claw. rank = m_engine->CreateObject(); @@ -226,7 +226,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(18, rank); m_object->SetObjectParent(18, 1); modelManager->AddModelReference("mother7.mod", false, rank); - m_object->SetPartPosition(18, Math::Vector(-4.0f, -3.5f, -8.0f)); + m_object->SetPartPosition(18, glm::vec3(-4.0f, -3.5f, -8.0f)); m_object->SetPartScaleX(18, 1.2f); // Creates the left claw. @@ -235,7 +235,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(19, rank); m_object->SetObjectParent(19, 1); modelManager->AddModelReference("mother7.mod", true, rank); - m_object->SetPartPosition(19, Math::Vector(-4.0f, -3.5f, 8.0f)); + m_object->SetPartPosition(19, glm::vec3(-4.0f, -3.5f, 8.0f)); m_object->SetPartScaleX(19, 1.2f); m_object->CreateShadowCircle(18.0f, 0.8f); @@ -321,7 +321,7 @@ bool CMotionQueen::EventProcess(const Event &event) bool CMotionQueen::EventFrame(const Event &event) { - Math::Vector dir; + glm::vec3 dir; float s, a, prog; int i, st, nd; bool bStop; diff --git a/src/object/motion/motionqueen.h b/src/object/motion/motionqueen.h index 8baa9c25..4eb36187 100644 --- a/src/object/motion/motionqueen.h +++ b/src/object/motion/motionqueen.h @@ -31,7 +31,7 @@ public: ~CMotionQueen(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; protected: diff --git a/src/object/motion/motionspider.cpp b/src/object/motion/motionspider.cpp index 81d49841..4be81fe8 100644 --- a/src/object/motion/motionspider.cpp +++ b/src/object/motion/motionspider.cpp @@ -67,7 +67,7 @@ void CMotionSpider::DeleteObject(bool bAll) // Creates a vehicle traveling any lands on the ground. -void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionSpider::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank, i, j, parent; @@ -109,8 +109,8 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type, // A vehicle must have a obligatory collision // with a sphere of center (0, y, 0) (see GetCrashSphere). - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-0.5f, 1.0f, 0.0f), 4.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(-0.5f, 1.0f, 0.0f), 4.0f)); // Creates the abdomen. rank = m_engine->CreateObject(); @@ -118,7 +118,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("spider1.mod", false, rank); - m_object->SetPartPosition(1, Math::Vector(1.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(1.0f, 0.0f, 0.0f)); // Creates the head. rank = m_engine->CreateObject(); @@ -126,7 +126,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("spider2.mod", false, rank); - m_object->SetPartPosition(2, Math::Vector(1.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(1.0f, 0.0f, 0.0f)); // Creates legs. for ( i=0 ; i<4 ; i++ ) @@ -169,7 +169,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(35, rank); m_object->SetObjectParent(35, 1); modelManager->AddModelReference("spider7.mod", false, rank); - m_object->SetPartPosition(35, Math::Vector(0.0f, 0.0f, -0.3f)); + m_object->SetPartPosition(35, glm::vec3(0.0f, 0.0f, -0.3f)); // Creates the left mandible. rank = m_engine->CreateObject(); @@ -177,7 +177,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(36, rank); m_object->SetObjectParent(36, 1); modelManager->AddModelReference("spider7.mod", true, rank); - m_object->SetPartPosition(36, Math::Vector(0.0f, 0.0f, 0.3f)); + m_object->SetPartPosition(36, glm::vec3(0.0f, 0.0f, 0.3f)); m_object->CreateShadowCircle(4.0f, 0.5f); @@ -326,7 +326,7 @@ bool CMotionSpider::EventProcess(const Event &event) bool CMotionSpider::EventFrame(const Event &event) { - Math::Vector dir, pos, speed; + glm::vec3 dir, pos, speed; glm::vec2 dim; float s, a, prog = 0.0f, time; float tSt[12], tNd[12]; @@ -490,9 +490,9 @@ bool CMotionSpider::EventFrame(const Event &event) if ( m_actionType == MSS_BURN ) // burning? { - dir = Math::Vector(Math::PI, 0.0f, 0.0f); + dir = glm::vec3(Math::PI, 0.0f, 0.0f); SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetLinVibration(dir); SetTilt(dir); @@ -501,7 +501,7 @@ bool CMotionSpider::EventFrame(const Event &event) } else if ( m_actionType == MSS_RUIN ) // destroyed? { - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetLinVibration(dir); SetCirVibration(dir); SetTilt(dir); @@ -551,7 +551,7 @@ bool CMotionSpider::EventFrame(const Event &event) dir.z = 0.0f; SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); if ( m_progress >= 1.0f ) @@ -580,7 +580,7 @@ bool CMotionSpider::EventFrame(const Event &event) } } - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetLinVibration(dir); dir.x = sinf(m_armTimeAbs* 3.0f)*0.20f+ sinf(m_armTimeAbs* 6.0f)*0.20f+ @@ -595,7 +595,7 @@ bool CMotionSpider::EventFrame(const Event &event) sinf(m_armTimeAbs*13.0f)*0.02f+ sinf(m_armTimeAbs*15.0f)*0.03f; SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); m_object->SetPartRotationY(1, sinf(m_armTimeAbs*5.0f)*0.05f); // tail @@ -642,7 +642,7 @@ bool CMotionSpider::EventFrame(const Event &event) dir.z = 0.0f; SetCirVibration(dir); - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); if ( m_progress >= 1.0f ) @@ -655,7 +655,7 @@ bool CMotionSpider::EventFrame(const Event &event) { if ( bStop ) { - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetTilt(dir); } else @@ -674,7 +674,7 @@ bool CMotionSpider::EventFrame(const Event &event) SetTilt(dir); } - dir = Math::Vector(0.0f, 0.0f, 0.0f); + dir = glm::vec3(0.0f, 0.0f, 0.0f); SetLinVibration(dir); SetCirVibration(dir); diff --git a/src/object/motion/motionspider.h b/src/object/motion/motionspider.h index 5ce0cfcd..f3d0a1a5 100644 --- a/src/object/motion/motionspider.h +++ b/src/object/motion/motionspider.h @@ -49,7 +49,7 @@ public: ~CMotionSpider(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; protected: diff --git a/src/object/motion/motiontoto.cpp b/src/object/motion/motiontoto.cpp index 6573194a..bcef27a7 100644 --- a/src/object/motion/motiontoto.cpp +++ b/src/object/motion/motiontoto.cpp @@ -81,7 +81,7 @@ void CMotionToto::DeleteObject(bool bAll) // Creates a vehicle traveling any lands on the ground. -void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionToto::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank; @@ -103,7 +103,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("toto2.mod", false, rank); - m_object->SetPartPosition(1, Math::Vector(1.00f, 0.17f, 0.00f)); + m_object->SetPartPosition(1, glm::vec3(1.00f, 0.17f, 0.00f)); // Creates the left eye. rank = m_engine->CreateObject(); @@ -111,7 +111,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("toto3.mod", true, rank); - m_object->SetPartPosition(2, Math::Vector(0.85f, 1.04f, 0.25f)); + m_object->SetPartPosition(2, glm::vec3(0.85f, 1.04f, 0.25f)); m_object->SetPartRotationY(2, -20.0f*Math::PI/180.0f); // Creates the right eye. @@ -120,7 +120,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 0); modelManager->AddModelReference("toto3.mod", false, rank); - m_object->SetPartPosition(3, Math::Vector(0.85f, 1.04f, -0.25f)); + m_object->SetPartPosition(3, glm::vec3(0.85f, 1.04f, -0.25f)); m_object->SetPartRotationY(3, 20.0f*Math::PI/180.0f); // Creates left antenna. @@ -129,7 +129,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 0); modelManager->AddModelReference("toto4.mod", false, rank); - m_object->SetPartPosition(4, Math::Vector(0.0f, 1.9f, 0.3f)); + m_object->SetPartPosition(4, glm::vec3(0.0f, 1.9f, 0.3f)); m_object->SetPartRotationX(4, 30.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); @@ -137,7 +137,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 4); modelManager->AddModelReference("toto4.mod", false, rank); - m_object->SetPartPosition(5, Math::Vector(0.0f, 0.67f, 0.0f)); + m_object->SetPartPosition(5, glm::vec3(0.0f, 0.67f, 0.0f)); m_object->SetPartRotationX(5, 30.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); @@ -145,7 +145,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 5); modelManager->AddModelReference("toto5.mod", false, rank); - m_object->SetPartPosition(6, Math::Vector(0.0f, 0.70f, 0.0f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, 0.70f, 0.0f)); m_object->SetPartRotationX(6, 30.0f*Math::PI/180.0f); // Creates right antenna. @@ -154,7 +154,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelReference("toto4.mod", false, rank); - m_object->SetPartPosition(7, Math::Vector(0.0f, 1.9f, -0.3f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 1.9f, -0.3f)); m_object->SetPartRotationX(7, -30.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); @@ -162,7 +162,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 7); modelManager->AddModelReference("toto4.mod", false, rank); - m_object->SetPartPosition(8, Math::Vector(0.0f, 0.67f, 0.0f)); + m_object->SetPartPosition(8, glm::vec3(0.0f, 0.67f, 0.0f)); m_object->SetPartRotationX(8, -30.0f*Math::PI/180.0f); rank = m_engine->CreateObject(); @@ -170,7 +170,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 8); modelManager->AddModelReference("toto5.mod", false, rank); - m_object->SetPartPosition(9, Math::Vector(0.0f, 0.70f, 0.0f)); + m_object->SetPartPosition(9, glm::vec3(0.0f, 0.70f, 0.0f)); m_object->SetPartRotationX(9, -30.0f*Math::PI/180.0f); m_object->SetScale(0.5f); // is little @@ -234,8 +234,8 @@ bool CMotionToto::EventProcess(const Event &event) bool CMotionToto::EventFrame(const Event &event) { Math::Matrix* mat; - Math::Vector eye, lookat, dir, perp, nPos, aPos, pos, speed; - Math::Vector vibLin, vibCir, dirSpeed, aAntenna; + glm::vec3 eye, lookat, dir, perp, nPos, aPos, pos, speed; + glm::vec3 vibLin, vibCir, dirSpeed, aAntenna; glm::vec2 dim; glm::ivec2 wDim; Gfx::ParticleType type; @@ -304,9 +304,9 @@ bool CMotionToto::EventFrame(const Event &event) eye = m_engine->GetEyePt(); lookat = m_engine->GetLookatPt(); - vibLin = Math::Vector(0.0f, 0.0f, 0.0f); - vibCir = Math::Vector(0.0f, 0.0f, 0.0f); - aAntenna = Math::Vector(0.0f, 0.0f, 0.0f); + vibLin = glm::vec3(0.0f, 0.0f, 0.0f); + vibCir = glm::vec3(0.0f, 0.0f, 0.0f); + aAntenna = glm::vec3(0.0f, 0.0f, 0.0f); aAntenna.x += 30.0f*Math::PI/180.0f; // Calculates the new position. @@ -717,7 +717,7 @@ bool CMotionToto::EventFrame(const Event &event) float t = Math::Mod(m_time, 3.5f); if ( t >= 2.2f || ( t >= 1.2f && t <= 1.4f ) ) // breathe? { - pos = Math::Vector(1.0f, 0.2f, 0.0f); + pos = glm::vec3(1.0f, 0.2f, 0.0f); pos.z += (Math::Rand()-0.5f)*0.5f; speed = pos; @@ -735,7 +735,7 @@ bool CMotionToto::EventFrame(const Event &event) } else // out of water? { - pos = Math::Vector(0.0f, -0.5f, 0.0f); + pos = glm::vec3(0.0f, -0.5f, 0.0f); pos.z += (Math::Rand()-0.5f)*0.5f; speed = pos; @@ -759,7 +759,7 @@ bool CMotionToto::EventFrame(const Event &event) pos.y = (Math::Rand()-0.5f)*1.0f+3.5f; pos.z = (Math::Rand()-0.5f)*1.0f; pos = Transform(*mat, pos); - speed = Math::Vector(0.0f, 0.0f, 0.0f); + speed = glm::vec3(0.0f, 0.0f, 0.0f); dim.x = (Math::Rand()*0.3f+0.3f); dim.y = dim.x; if ( m_actionType == MT_ERROR ) type = Gfx::PARTIERROR; @@ -783,7 +783,7 @@ bool CMotionToto::EventFrame(const Event &event) pos.y = (Math::Rand()-0.5f)*1.4f+3.5f; pos.z = (Math::Rand()-0.5f)*1.4f; pos = Transform(*mat, pos); - speed = Math::Vector(0.0f, 0.0f, 0.0f); + speed = glm::vec3(0.0f, 0.0f, 0.0f); dim.x = (Math::Rand()*0.5f+0.5f); dim.y = dim.x; m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIERROR, 0.5f+Math::Rand()*0.5f, 0.0f, 1.0f, sheet); diff --git a/src/object/motion/motiontoto.h b/src/object/motion/motiontoto.h index 2440f9ff..07590ef8 100644 --- a/src/object/motion/motiontoto.h +++ b/src/object/motion/motiontoto.h @@ -40,7 +40,7 @@ public: ~CMotionToto(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; Error SetAction(int action, float time=0.2f) override; diff --git a/src/object/motion/motionvehicle.cpp b/src/object/motion/motionvehicle.cpp index 878fa487..896114f4 100644 --- a/src/object/motion/motionvehicle.cpp +++ b/src/object/motion/motionvehicle.cpp @@ -59,9 +59,9 @@ CMotionVehicle::CMotionVehicle(COldObject* object) m_armTimeAbs = 1000.0f; m_armMember = 1000.0f; m_canonTime = 0.0f; - m_wheelLastPos = Math::Vector(0.0f, 0.0f, 0.0f); - m_wheelLastAngle = Math::Vector(0.0f, 0.0f, 0.0f); - m_posKey = Math::Vector(0.0f, 0.0f, 0.0f); + m_wheelLastPos = glm::vec3(0.0f, 0.0f, 0.0f); + m_wheelLastAngle = glm::vec3(0.0f, 0.0f, 0.0f); + m_posKey = glm::vec3(0.0f, 0.0f, 0.0f); m_bFlyFix = false; } @@ -86,7 +86,7 @@ void CMotionVehicle::DeleteObject(bool bAll) // Creates a vehicle traveling any lands on the ground. -void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionVehicle::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank, i, j, parent; @@ -281,28 +281,28 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type == OBJECT_MOBILErs || type == OBJECT_MOBILErp) { - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 6.5f, SOUND_BOUMm, 0.45f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 7.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 4.0f, 0.0f), 6.5f, SOUND_BOUMm, 0.45f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 3.0f, 0.0f), 7.0f)); } else if (type == OBJECT_MOBILEsa || type == OBJECT_MOBILEst) { - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 3.0f, 0.0f), 6.0f)); } else if (type == OBJECT_MOBILEdr) { - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 7.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 3.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 3.0f, 0.0f), 7.0f)); } else if (type == OBJECT_APOLLO2) { - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 8.0f, SOUND_BOUMm, 0.45f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 0.0f, 0.0f), 8.0f, SOUND_BOUMm, 0.45f)); } else { - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 6.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 4.0f, 0.0f), 6.0f)); } if (type == OBJECT_MOBILEfa || @@ -316,7 +316,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("lem2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); m_object->SetPartRotationZ(1, ARM_NEUTRAL_ANGLE1); // Creates the forearm. @@ -325,7 +325,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 1); modelManager->AddModelReference("lem3.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(5.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(5.0f, 0.0f, 0.0f)); m_object->SetPartRotationZ(2, ARM_NEUTRAL_ANGLE2); // Creates the hand. @@ -334,7 +334,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 2); modelManager->AddModelReference("lem4.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(3, Math::Vector(3.5f, 0.0f, 0.0f)); + m_object->SetPartPosition(3, glm::vec3(3.5f, 0.0f, 0.0f)); m_object->SetPartRotationZ(3, ARM_NEUTRAL_ANGLE3); m_object->SetPartRotationX(3, Math::PI/2.0f); @@ -344,7 +344,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 3); modelManager->AddModelReference("lem5.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(4, Math::Vector(1.5f, 0.0f, 0.0f)); + m_object->SetPartPosition(4, glm::vec3(1.5f, 0.0f, 0.0f)); m_object->SetPartRotationZ(4, -Math::PI*0.10f); // Creates the remote clamp. @@ -353,7 +353,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 3); modelManager->AddModelReference("lem6.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(5, Math::Vector(1.5f, 0.0f, 0.0f)); + m_object->SetPartPosition(5, glm::vec3(1.5f, 0.0f, 0.0f)); m_object->SetPartRotationZ(5, Math::PI*0.10f); } @@ -368,7 +368,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("lem2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); m_object->SetPartRotationZ(1, 110.0f*Math::PI/180.0f); // Creates the forearm. @@ -377,7 +377,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 1); modelManager->AddModelReference("lem3.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(5.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(5.0f, 0.0f, 0.0f)); m_object->SetPartRotationZ(2, -110.0f*Math::PI/180.0f); // Creates the sensor. @@ -386,7 +386,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 2); modelManager->AddModelReference("lem4s.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(3, Math::Vector(3.5f, 0.0f, 0.0f)); + m_object->SetPartPosition(3, glm::vec3(3.5f, 0.0f, 0.0f)); m_object->SetPartRotationZ(3, -65.0f*Math::PI/180.0f); } @@ -401,8 +401,8 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("canon.mod", false, rank, m_object->GetTeam()); -//? m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); - m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); +//? m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); m_object->SetPartRotationZ(1, 0.0f); } @@ -417,7 +417,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("canoni1.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); m_object->SetPartRotationZ(1, 0.0f); rank = m_engine->CreateObject(); @@ -425,7 +425,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 1); modelManager->AddModelReference("canoni2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(0.0f, 2.5f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(0.0f, 2.5f, 0.0f)); m_object->SetPartRotationZ(2, 0.0f); } @@ -440,8 +440,8 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("neutron.mod", false, rank, m_object->GetTeam()); -//? m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); - m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f)); +//? m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 5.3f, 0.0f)); m_object->SetPartRotationZ(1, 0.0f); } @@ -458,7 +458,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(-3.0f, 1.0f, -3.0f)); + m_object->SetPartPosition(6, glm::vec3(-3.0f, 1.0f, -3.0f)); // Creates the left-back wheel. rank = m_engine->CreateObject(); @@ -466,7 +466,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(-3.0f, 1.0f, 3.0f)); + m_object->SetPartPosition(7, glm::vec3(-3.0f, 1.0f, 3.0f)); m_object->SetPartRotationY(7, Math::PI); // Creates the right-front wheel. @@ -475,7 +475,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(8, Math::Vector(2.0f, 1.0f, -3.0f)); + m_object->SetPartPosition(8, glm::vec3(2.0f, 1.0f, -3.0f)); // Creates the left-front wheel. rank = m_engine->CreateObject(); @@ -483,7 +483,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(9, Math::Vector(2.0f, 1.0f, 3.0f)); + m_object->SetPartPosition(9, glm::vec3(2.0f, 1.0f, 3.0f)); m_object->SetPartRotationY(9, Math::PI); } @@ -495,7 +495,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(-2.0f, 1.0f, -3.0f)); + m_object->SetPartPosition(6, glm::vec3(-2.0f, 1.0f, -3.0f)); // Creates the left-back wheel. rank = m_engine->CreateObject(); @@ -503,7 +503,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(-2.0f, 1.0f, 3.0f)); + m_object->SetPartPosition(7, glm::vec3(-2.0f, 1.0f, 3.0f)); m_object->SetPartRotationY(7, Math::PI); // Creates the right-front wheel. @@ -512,7 +512,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(8, Math::Vector(3.0f, 1.0f, -3.0f)); + m_object->SetPartPosition(8, glm::vec3(3.0f, 1.0f, -3.0f)); // Creates the left-front wheel. rank = m_engine->CreateObject(); @@ -520,7 +520,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 0); modelManager->AddModelReference("lem2w.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(9, Math::Vector(3.0f, 1.0f, 3.0f)); + m_object->SetPartPosition(9, glm::vec3(3.0f, 1.0f, 3.0f)); m_object->SetPartRotationY(9, Math::PI); } @@ -539,11 +539,11 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, modelManager->AddModelCopy("lem2t.mod", false, rank, m_object->GetTeam()); if (m_object->GetTrainer() || type == OBJECT_MOBILEtt) { - m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.55f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, 2.0f, -3.55f)); m_object->SetPartScaleZ(6, 0.725f); } else - m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.0f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, 2.0f, -3.0f)); // Creates the left caterpillar. rank = m_engine->CreateObject(); @@ -553,11 +553,11 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, modelManager->AddModelCopy("lem3t.mod", false, rank, m_object->GetTeam()); if (m_object->GetTrainer() || type == OBJECT_MOBILEtt) { - m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.55f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 2.0f, 3.55f)); m_object->SetPartScaleZ(7, 0.725f); } else - m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 2.0f, 3.0f)); } if (type == OBJECT_MOBILErt || @@ -572,7 +572,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelCopy("roller2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.0f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, 2.0f, -3.0f)); // Creates the left caterpillar. rank = m_engine->CreateObject(); @@ -580,7 +580,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelCopy("roller3.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 2.0f, 3.0f)); } if (type == OBJECT_MOBILEsa || @@ -592,7 +592,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelCopy("subm4.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(0.0f, 1.0f, -3.0f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, 1.0f, -3.0f)); // Creates the left caterpillar. rank = m_engine->CreateObject(); @@ -600,7 +600,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelCopy("subm5.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(0.0f, 1.0f, 3.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 1.0f, 3.0f)); } if (type == OBJECT_MOBILEdr) // caterpillars? @@ -611,7 +611,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelCopy("drawer2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(0.0f, 1.0f, -3.0f)); + m_object->SetPartPosition(6, glm::vec3(0.0f, 1.0f, -3.0f)); // Creates the left caterpillar. rank = m_engine->CreateObject(); @@ -619,7 +619,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelCopy("drawer3.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(0.0f, 1.0f, 3.0f)); + m_object->SetPartPosition(7, glm::vec3(0.0f, 1.0f, 3.0f)); } if (type == OBJECT_MOBILEfa || @@ -635,7 +635,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("lem2f.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(6, Math::Vector(1.7f, 3.0f, 0.0f)); + m_object->SetPartPosition(6, glm::vec3(1.7f, 3.0f, 0.0f)); // Creates the right-back foot. rank = m_engine->CreateObject(); @@ -643,7 +643,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelReference("lem2f.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(7, Math::Vector(-1.8f, 3.0f, -1.5f)); + m_object->SetPartPosition(7, glm::vec3(-1.8f, 3.0f, -1.5f)); m_object->SetPartRotationY(7, 120.0f*Math::PI/180.0f); // Creates the left-back foot. @@ -652,7 +652,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 0); modelManager->AddModelReference("lem2f.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(8, Math::Vector(-1.8f, 3.0f, 1.5f)); + m_object->SetPartPosition(8, glm::vec3(-1.8f, 3.0f, 1.5f)); m_object->SetPartRotationY(8, -120.0f*Math::PI/180.0f); } @@ -722,7 +722,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("roller2t.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(0.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 0.0f, 0.0f)); m_object->SetPartRotationZ(1, 0.0f); // Creates the pestle. @@ -731,7 +731,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("roller3t.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(9.0f, 4.0f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(9.0f, 4.0f, 0.0f)); m_object->SetPartRotationZ(2, 0.0f); } @@ -743,7 +743,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("roller2c.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(3.0f, 4.6f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(3.0f, 4.6f, 0.0f)); m_object->SetPartRotationZ(1, Math::PI/8.0f); // Creates the cannon. @@ -752,7 +752,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("roller3p.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(7.0f, 6.5f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(7.0f, 6.5f, 0.0f)); m_object->SetPartRotationZ(2, 0.0f); } @@ -764,7 +764,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("recover1.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(2.0f, 5.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(2.0f, 5.0f, 0.0f)); // Creates the right arm. rank = m_engine->CreateObject(); @@ -772,7 +772,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 1); modelManager->AddModelReference("recover2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(0.1f, 0.0f, -5.0f)); + m_object->SetPartPosition(2, glm::vec3(0.1f, 0.0f, -5.0f)); m_object->SetPartRotationZ(2, 126.0f*Math::PI/180.0f); // Creates the right forearm. @@ -781,7 +781,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 2); modelManager->AddModelReference("recover3.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(3, Math::Vector(5.0f, 0.0f, -0.5f)); + m_object->SetPartPosition(3, glm::vec3(5.0f, 0.0f, -0.5f)); m_object->SetPartRotationZ(3, -144.0f*Math::PI/180.0f); // Creates the left arm. @@ -790,7 +790,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(4, rank); m_object->SetObjectParent(4, 1); modelManager->AddModelReference("recover2.mod", true, rank, m_object->GetTeam()); - m_object->SetPartPosition(4, Math::Vector(0.1f, 0.0f, 5.0f)); + m_object->SetPartPosition(4, glm::vec3(0.1f, 0.0f, 5.0f)); m_object->SetPartRotationZ(4, 126.0f*Math::PI/180.0f); // Creates the left forearm. @@ -799,7 +799,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(5, rank); m_object->SetObjectParent(5, 4); modelManager->AddModelReference("recover3.mod", true, rank, m_object->GetTeam()); - m_object->SetPartPosition(5, Math::Vector(5.0f, 0.0f, 0.5f)); + m_object->SetPartPosition(5, glm::vec3(5.0f, 0.0f, 0.5f)); m_object->SetPartRotationZ(5, -144.0f*Math::PI/180.0f); } @@ -811,7 +811,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("roller2s.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(0.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(0.0f, 0.0f, 0.0f)); m_object->SetPartRotationZ(1, 0.0f); // Creates the intermediate piston. @@ -820,7 +820,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 1); modelManager->AddModelReference("roller3s.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(7.0f, 4.5f, 0.0f)); + m_object->SetPartPosition(2, glm::vec3(7.0f, 4.5f, 0.0f)); m_object->SetPartRotationZ(2, 0.0f); // Creates the piston with the sphere. @@ -829,7 +829,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 2); modelManager->AddModelReference("roller4s.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(3, Math::Vector(0.0f, 1.0f, 0.0f)); + m_object->SetPartPosition(3, glm::vec3(0.0f, 1.0f, 0.0f)); m_object->SetPartRotationZ(3, 0.0f); } @@ -841,7 +841,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("subm2.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(4.2f, 3.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(4.2f, 3.0f, 0.0f)); // Creates the right tong. rank = m_engine->CreateObject(); @@ -849,7 +849,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 1); modelManager->AddModelReference("subm3.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(2, Math::Vector(0.5f, 0.0f, -1.5f)); + m_object->SetPartPosition(2, glm::vec3(0.5f, 0.0f, -1.5f)); // Creates the left tong. rank = m_engine->CreateObject(); @@ -857,7 +857,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(3, rank); m_object->SetObjectParent(3, 1); modelManager->AddModelReference("subm3.mod", true, rank, m_object->GetTeam()); - m_object->SetPartPosition(3, Math::Vector(0.5f, 0.0f, 1.5f)); + m_object->SetPartPosition(3, glm::vec3(0.5f, 0.0f, 1.5f)); if (m_object->GetTrainer()) { @@ -877,7 +877,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("drawer4.mod", false, rank, m_object->GetTeam()); - m_object->SetPartPosition(1, Math::Vector(-3.0f, 3.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(-3.0f, 3.0f, 0.0f)); // Creates the key. if ( m_object->GetToy() ) @@ -887,7 +887,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("drawer5.mod", false, rank, m_object->GetTeam()); - m_posKey = Math::Vector(3.0f, 5.7f, 0.0f); + m_posKey = glm::vec3(3.0f, 5.7f, 0.0f); m_object->SetPartPosition(2, m_posKey); m_object->SetPartRotationY(2, 90.0f*Math::PI/180.0f); } @@ -901,7 +901,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectParent(10+i, 1); sprintf(name, "drawer%d.mod", 10+i); modelManager->AddModelReference(name, false, rank, m_object->GetTeam()); - m_object->SetPartPosition(10+i, Math::Vector(0.0f, 0.0f, 0.0f)); + m_object->SetPartPosition(10+i, glm::vec3(0.0f, 0.0f, 0.0f)); m_object->SetPartRotationY(10+i, 45.0f*Math::PI/180.0f*i); } } @@ -916,7 +916,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("drawer5.mod", false, rank, m_object->GetTeam()); - m_posKey = Math::Vector(0.2f, 4.1f, 0.0f); + m_posKey = glm::vec3(0.2f, 4.1f, 0.0f); m_object->SetPartPosition(2, m_posKey); m_object->SetPartRotationY(2, 90.0f*Math::PI/180.0f); } @@ -930,7 +930,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("apolloj2.mod", false, rank, m_object->GetTeam()); // antenna - m_object->SetPartPosition(1, Math::Vector(5.5f, 8.8f, 2.0f)); + m_object->SetPartPosition(1, glm::vec3(5.5f, 8.8f, 2.0f)); m_object->SetPartRotationY(1, -120.0f*Math::PI/180.0f); m_object->SetPartRotationZ(1, 45.0f*Math::PI/180.0f); @@ -939,7 +939,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2, rank); m_object->SetObjectParent(2, 0); modelManager->AddModelReference("apolloj3.mod", false, rank, m_object->GetTeam()); // camera - m_object->SetPartPosition(2, Math::Vector(5.5f, 2.8f, -2.0f)); + m_object->SetPartPosition(2, glm::vec3(5.5f, 2.8f, -2.0f)); m_object->SetPartRotationY(2, 30.0f*Math::PI/180.0f); // Creates the wheels. @@ -948,28 +948,28 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(6, rank); m_object->SetObjectParent(6, 0); modelManager->AddModelReference("apolloj4.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(6, Math::Vector(-5.75f, 1.65f, -5.0f)); + m_object->SetPartPosition(6, glm::vec3(-5.75f, 1.65f, -5.0f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(7, rank); m_object->SetObjectParent(7, 0); modelManager->AddModelReference("apolloj4.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(7, Math::Vector(-5.75f, 1.65f, 5.0f)); + m_object->SetPartPosition(7, glm::vec3(-5.75f, 1.65f, 5.0f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(8, rank); m_object->SetObjectParent(8, 0); modelManager->AddModelReference("apolloj4.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(8, Math::Vector(5.75f, 1.65f, -5.0f)); + m_object->SetPartPosition(8, glm::vec3(5.75f, 1.65f, -5.0f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(9, rank); m_object->SetObjectParent(9, 0); modelManager->AddModelReference("apolloj4.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(9, Math::Vector(5.75f, 1.65f, 5.00f)); + m_object->SetPartPosition(9, glm::vec3(5.75f, 1.65f, 5.00f)); // Creates mud guards. rank = m_engine->CreateObject(); @@ -977,28 +977,28 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(10, rank); m_object->SetObjectParent(10, 0); modelManager->AddModelReference("apolloj6.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(10, Math::Vector(-5.75f, 1.65f, -5.0f)); + m_object->SetPartPosition(10, glm::vec3(-5.75f, 1.65f, -5.0f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(11, rank); m_object->SetObjectParent(11, 0); modelManager->AddModelReference("apolloj6.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(11, Math::Vector(-5.75f, 1.65f, 5.0f)); + m_object->SetPartPosition(11, glm::vec3(-5.75f, 1.65f, 5.0f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(12, rank); m_object->SetObjectParent(12, 0); modelManager->AddModelReference("apolloj5.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(12, Math::Vector(5.75f, 1.65f, -5.0f)); + m_object->SetPartPosition(12, glm::vec3(5.75f, 1.65f, -5.0f)); rank = m_engine->CreateObject(); m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT); m_object->SetObjectRank(13, rank); m_object->SetObjectParent(13, 0); modelManager->AddModelReference("apolloj5.mod", false, rank, m_object->GetTeam()); // wheel - m_object->SetPartPosition(13, Math::Vector(5.75f, 1.65f, 5.00f)); + m_object->SetPartPosition(13, glm::vec3(5.75f, 1.65f, 5.00f)); } if (type == OBJECT_MOBILErt || @@ -1061,7 +1061,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, type != OBJECT_APOLLO2) { CObject* powerCell = nullptr; - Math::Vector powerCellPos = m_object->GetPowerPosition(); + glm::vec3 powerCellPos = m_object->GetPowerPosition(); float powerCellAngle = 0.0f; if (power <= 1.0f) { @@ -1074,7 +1074,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type, assert(powerCell->Implements(ObjectInterfaceType::Transportable)); powerCell->SetPosition(powerCellPos); - powerCell->SetRotation(Math::Vector(0.0f, powerCellAngle, 0.0f)); + powerCell->SetRotation(glm::vec3(0.0f, powerCellAngle, 0.0f)); dynamic_cast(*powerCell).SetTransporter(m_object); assert(m_object->Implements(ObjectInterfaceType::Powered)); m_object->SetPower(powerCell); @@ -1105,7 +1105,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 4.0f; character->wheelLeft = 4.0f; character->wheelRight = 4.0f; - m_object->SetPowerPosition(Math::Vector(-3.2f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-3.2f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 20.0f); m_physics->SetLinMotionX(MO_RECSPEED, 10.0f); @@ -1131,7 +1131,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 3.0f; character->wheelLeft = 4.0f; character->wheelRight = 4.0f; - m_object->SetPowerPosition(Math::Vector(-3.2f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-3.2f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 20.0f); m_physics->SetLinMotionX(MO_RECSPEED, 10.0f); @@ -1162,7 +1162,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 4.0f; character->wheelLeft = 4.8f; character->wheelRight = 4.8f; - m_object->SetPowerPosition(Math::Vector(-3.2f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-3.2f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 15.0f); m_physics->SetLinMotionX(MO_RECSPEED, 8.0f); @@ -1193,7 +1193,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 4.0f; character->wheelLeft = 5.0f; character->wheelRight = 5.0f; - m_object->SetPowerPosition(Math::Vector(-3.2f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-3.2f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 15.0f); m_physics->SetLinMotionX(MO_RECSPEED, 8.0f); @@ -1225,7 +1225,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 4.0f; character->wheelLeft = 4.5f; character->wheelRight = 4.5f; - m_object->SetPowerPosition(Math::Vector(-3.2f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-3.2f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 50.0f); m_physics->SetLinMotionX(MO_RECSPEED, 50.0f); @@ -1260,7 +1260,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 5.0f; character->wheelLeft = 6.0f; character->wheelRight = 6.0f; - m_object->SetPowerPosition(Math::Vector(-5.8f, 4.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-5.8f, 4.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 10.0f); m_physics->SetLinMotionX(MO_RECSPEED, 5.0f); @@ -1287,7 +1287,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 4.0f; character->wheelLeft = 4.0f; character->wheelRight = 4.0f; - m_object->SetPowerPosition(Math::Vector(-5.0f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-5.0f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 15.0f); m_physics->SetLinMotionX(MO_RECSPEED, 10.0f); @@ -1313,7 +1313,7 @@ void CMotionVehicle::CreatePhysics(ObjectType type) character->wheelBack = 4.0f; character->wheelLeft = 4.0f; character->wheelRight = 4.0f; - m_object->SetPowerPosition(Math::Vector(-5.0f, 3.0f, 0.0f)); + m_object->SetPowerPosition(glm::vec3(-5.0f, 3.0f, 0.0f)); m_physics->SetLinMotionX(MO_ADVSPEED, 15.0f); m_physics->SetLinMotionX(MO_RECSPEED, 10.0f); @@ -1384,7 +1384,7 @@ bool CMotionVehicle::EventFrame(const Event &event) { Math::Matrix* mat; Character* character; - Math::Vector pos, angle, floor; + glm::vec3 pos, angle, floor; ObjectType type; float s, a, speedBL, speedBR, speedFL, speedFR, h, a1, a2; float back, front, dist, radius, limit[2]; @@ -1545,17 +1545,17 @@ bool CMotionVehicle::EventFrame(const Event &event) } else { - m_object->SetPartPosition(6, Math::Vector(back, radius, -dist)); - m_object->SetPartPosition(7, Math::Vector(back, radius, dist)); - m_object->SetPartPosition(8, Math::Vector(front, radius, -dist)); - m_object->SetPartPosition(9, Math::Vector(front, radius, dist)); + m_object->SetPartPosition(6, glm::vec3(back, radius, -dist)); + m_object->SetPartPosition(7, glm::vec3(back, radius, dist)); + m_object->SetPartPosition(8, glm::vec3(front, radius, -dist)); + m_object->SetPartPosition(9, glm::vec3(front, radius, dist)); if ( type == OBJECT_APOLLO2 ) { - m_object->SetPartPosition(10, Math::Vector(back, radius, -dist)); - m_object->SetPartPosition(11, Math::Vector(back, radius, dist)); - m_object->SetPartPosition(12, Math::Vector(front, radius, -dist)); - m_object->SetPartPosition(13, Math::Vector(front, radius, dist)); + m_object->SetPartPosition(10, glm::vec3(back, radius, -dist)); + m_object->SetPartPosition(11, glm::vec3(back, radius, dist)); + m_object->SetPartPosition(12, glm::vec3(front, radius, -dist)); + m_object->SetPartPosition(13, glm::vec3(front, radius, dist)); } } } @@ -1721,7 +1721,7 @@ bool CMotionVehicle::EventFrame(const Event &event) bool CMotionVehicle::EventFrameFly(const Event &event) { Math::Matrix* mat; - Math::Vector pos, angle, paw[3]; + glm::vec3 pos, angle, paw[3]; float hope[3], actual, final, h, a; int i; @@ -1741,9 +1741,9 @@ bool CMotionVehicle::EventFrameFly(const Event &event) if ( m_physics->GetLand() ) // on the ground? { mat = m_object->GetWorldMatrix(0); - paw[0] = Transform(*mat, Math::Vector( 4.2f, 0.0f, 0.0f)); // front - paw[1] = Transform(*mat, Math::Vector(-3.0f, 0.0f, -3.7f)); // right back - paw[2] = Transform(*mat, Math::Vector(-3.0f, 0.0f, 3.7f)); // left back + paw[0] = Transform(*mat, glm::vec3( 4.2f, 0.0f, 0.0f)); // front + paw[1] = Transform(*mat, glm::vec3(-3.0f, 0.0f, -3.7f)); // right back + paw[2] = Transform(*mat, glm::vec3(-3.0f, 0.0f, 3.7f)); // left back for ( i=0 ; i<3 ; i++ ) { @@ -1780,7 +1780,7 @@ bool CMotionVehicle::EventFrameFly(const Event &event) bool CMotionVehicle::EventFrameInsect(const Event &event) { - Math::Vector dir; + glm::vec3 dir; float s, a, prog = 0.0f, time; int i, st, nd, action; bool bStop, bOnBoard; @@ -1933,7 +1933,7 @@ bool CMotionVehicle::EventFrameInsect(const Event &event) bool CMotionVehicle::EventFrameCanoni(const Event &event) { - Math::Vector pos, speed; + glm::vec3 pos, speed; glm::vec2 dim; float zoom, angle, factor; bool bOnBoard = false; diff --git a/src/object/motion/motionvehicle.h b/src/object/motion/motionvehicle.h index c277b401..67410988 100644 --- a/src/object/motion/motionvehicle.h +++ b/src/object/motion/motionvehicle.h @@ -30,7 +30,7 @@ public: ~CMotionVehicle(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; protected: @@ -50,8 +50,8 @@ protected: float m_armTimeAbs; float m_armMember; float m_canonTime; - Math::Vector m_wheelLastPos; - Math::Vector m_wheelLastAngle; - Math::Vector m_posKey; + glm::vec3 m_wheelLastPos = { 0, 0, 0 }; + glm::vec3 m_wheelLastAngle = { 0, 0, 0 }; + glm::vec3 m_posKey = { 0, 0, 0 }; bool m_bFlyFix; }; diff --git a/src/object/motion/motionworm.cpp b/src/object/motion/motionworm.cpp index 389c6801..d7ad83da 100644 --- a/src/object/motion/motionworm.cpp +++ b/src/object/motion/motionworm.cpp @@ -85,7 +85,7 @@ void CMotionWorm::DeleteObject(bool bAll) // Creates a vehicle traveling any lands on the ground. -void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type, +void CMotionWorm::Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) { int rank, i; @@ -102,8 +102,8 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetRotationY(angle); // A vehicle must have a obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere). - m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); - m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f)); + m_object->AddCrashSphere(CrashSphere(glm::vec3(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); + m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 0.0f, 0.0f), 5.0f)); px = 1.0f+WORM_PART/2; @@ -113,7 +113,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(1, rank); m_object->SetObjectParent(1, 0); modelManager->AddModelReference("worm1.mod", false, rank); - m_object->SetPartPosition(1, Math::Vector(px, 0.0f, 0.0f)); + m_object->SetPartPosition(1, glm::vec3(px, 0.0f, 0.0f)); px -= 1.0f; // Creates the body. @@ -124,7 +124,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2+i, rank); m_object->SetObjectParent(2+i, 0); modelManager->AddModelReference("worm2.mod", false, rank); - m_object->SetPartPosition(2+i, Math::Vector(px, 0.0f, 0.0f)); + m_object->SetPartPosition(2+i, glm::vec3(px, 0.0f, 0.0f)); px -= 1.0f; } @@ -134,7 +134,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type, m_object->SetObjectRank(2+WORM_PART, rank); m_object->SetObjectParent(2+WORM_PART, 0); modelManager->AddModelReference("worm3.mod", false, rank); - m_object->SetPartPosition(2+WORM_PART, Math::Vector(px, 0.0f, 0.0f)); + m_object->SetPartPosition(2+WORM_PART, glm::vec3(px, 0.0f, 0.0f)); m_object->CreateShadowCircle(0.0f, 1.0f, Gfx::ENG_SHADOW_WORM); @@ -231,7 +231,7 @@ bool CMotionWorm::EventProcess(const Event &event) bool CMotionWorm::EventFrame(const Event &event) { Math::Matrix* mat; - Math::Vector pos, p, angle, speed; + glm::vec3 pos, p, angle, speed; glm::vec2 center, pp, dim; float height[WORM_PART+2]; float floor, a, s, px, curve, phase, h, zoom, radius; @@ -331,7 +331,7 @@ bool CMotionWorm::EventFrame(const Event &event) pos.y += -height[i]; pos.x += (Math::Rand()-0.5f)*4.0f; pos.z += (Math::Rand()-0.5f)*4.0f; - speed = Math::Vector(0.0f, 0.0f, 0.0f); + speed = glm::vec3(0.0f, 0.0f, 0.0f); dim.x = Math::Rand()*2.0f+1.5f; dim.y = dim.x; m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f); diff --git a/src/object/motion/motionworm.h b/src/object/motion/motionworm.h index 8b01acec..3edc6a19 100644 --- a/src/object/motion/motionworm.h +++ b/src/object/motion/motionworm.h @@ -31,7 +31,7 @@ public: ~CMotionWorm(); void DeleteObject(bool bAll=false) override; - void Create(Math::Vector pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; + void Create(glm::vec3 pos, float angle, ObjectType type, float power, Gfx::COldModelManager* modelManager) override; bool EventProcess(const Event &event) override; bool SetParam(int rank, float value) override;