From f8f3a64612835970352cdf4ea295fef095036c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Fri, 24 Dec 2021 18:32:42 +0100 Subject: [PATCH] Refactored Math::Point in motion classes --- src/object/motion/motionant.cpp | 2 +- src/object/motion/motionhuman.cpp | 2 +- src/object/motion/motionspider.cpp | 2 +- src/object/motion/motiontoto.cpp | 8 ++++---- src/object/motion/motiontoto.h | 6 +++--- src/object/motion/motionvehicle.cpp | 2 +- src/object/motion/motionworm.cpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/object/motion/motionant.cpp b/src/object/motion/motionant.cpp index 28abe174..514d552a 100644 --- a/src/object/motion/motionant.cpp +++ b/src/object/motion/motionant.cpp @@ -392,7 +392,7 @@ bool CMotionAnt::EventProcess(const Event &event) bool CMotionAnt::EventFrame(const Event &event) { Math::Vector dir, pos, speed; - Math::Point dim; + glm::vec2 dim; float s, a, prog = 0.0f, time; float tSt[9], tNd[9]; int i, ii, st, nd, action; diff --git a/src/object/motion/motionhuman.cpp b/src/object/motion/motionhuman.cpp index 906aaab6..a83960fa 100644 --- a/src/object/motion/motionhuman.cpp +++ b/src/object/motion/motionhuman.cpp @@ -614,7 +614,7 @@ bool CMotionHuman::EventFrame(const Event &event) { Math::Matrix* mat; Math::Vector dir, actual, pos, speed, pf; - Math::Point center, dim, p2; + glm::vec2 center, dim, p2; float s, a, prog, rTime[2], lTime[2], time, rot, hr, hl; float al, ar, af; float tSt[9], tNd[9]; diff --git a/src/object/motion/motionspider.cpp b/src/object/motion/motionspider.cpp index 4673b8b3..81d49841 100644 --- a/src/object/motion/motionspider.cpp +++ b/src/object/motion/motionspider.cpp @@ -327,7 +327,7 @@ bool CMotionSpider::EventProcess(const Event &event) bool CMotionSpider::EventFrame(const Event &event) { Math::Vector dir, pos, speed; - Math::Point dim; + glm::vec2 dim; float s, a, prog = 0.0f, time; float tSt[12], tNd[12]; int i, ii, st, nd, action; diff --git a/src/object/motion/motiontoto.cpp b/src/object/motion/motiontoto.cpp index 80f1bef9..e0a1afb1 100644 --- a/src/object/motion/motiontoto.cpp +++ b/src/object/motion/motiontoto.cpp @@ -57,7 +57,7 @@ CMotionToto::CMotionToto(COldObject* object) : CMotion(object) m_blinkTime = 0.0f; m_blinkProgress = -1.0f; m_lastMotorParticle = 0.0f; - m_mousePos = Math::Point(0.0f, 0.0f); + m_mousePos = { 0.0f, 0.0f }; } // Object's destructor. @@ -196,7 +196,7 @@ return; m_progress = 0.0f; m_object->SetRotationY(0.0f); - m_mousePos = Math::Point(0.5f, 0.5f); + m_mousePos = { 0.5f, 0.5f }; } // End of the display of informations. @@ -209,7 +209,7 @@ void CMotionToto::StopDisplayInfo() // Getes the position of the mouse. -void CMotionToto::SetMousePos(Math::Point pos) +void CMotionToto::SetMousePos(const glm::vec2& pos) { m_mousePos = pos; } @@ -236,7 +236,7 @@ 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; - Math::Point dim; + glm::vec2 dim; glm::ivec2 wDim; Gfx::ParticleType type; float progress, focus, distance, shift, verti, level, zoom; diff --git a/src/object/motion/motiontoto.h b/src/object/motion/motiontoto.h index 0115dbd4..2440f9ff 100644 --- a/src/object/motion/motiontoto.h +++ b/src/object/motion/motiontoto.h @@ -21,7 +21,7 @@ #include "object/motion/motion.h" -#include "math/point.h" +#include enum MotionTotoAction @@ -46,7 +46,7 @@ public: void StartDisplayInfo(); void StopDisplayInfo(); - void SetMousePos(Math::Point pos); + void SetMousePos(const glm::vec2& pos); protected: bool EventFrame(const Event &event); @@ -64,5 +64,5 @@ protected: float m_blinkTime; float m_blinkProgress; int m_soundChannel; - Math::Point m_mousePos; + glm::vec2 m_mousePos; }; diff --git a/src/object/motion/motionvehicle.cpp b/src/object/motion/motionvehicle.cpp index 712ad18a..878fa487 100644 --- a/src/object/motion/motionvehicle.cpp +++ b/src/object/motion/motionvehicle.cpp @@ -1934,7 +1934,7 @@ bool CMotionVehicle::EventFrameInsect(const Event &event) bool CMotionVehicle::EventFrameCanoni(const Event &event) { Math::Vector pos, speed; - Math::Point dim; + glm::vec2 dim; float zoom, angle, factor; bool bOnBoard = false; diff --git a/src/object/motion/motionworm.cpp b/src/object/motion/motionworm.cpp index a2bdb483..389c6801 100644 --- a/src/object/motion/motionworm.cpp +++ b/src/object/motion/motionworm.cpp @@ -232,7 +232,7 @@ bool CMotionWorm::EventFrame(const Event &event) { Math::Matrix* mat; Math::Vector pos, p, angle, speed; - Math::Point center, pp, dim; + glm::vec2 center, pp, dim; float height[WORM_PART+2]; float floor, a, s, px, curve, phase, h, zoom, radius; int i, under;