From 9f784e81f81651bed087902f9f3afee113e56148 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Tue, 19 Jun 2012 20:11:47 +0200 Subject: Switched to new implementation of the rest of math module - changed structs from D3DVECTOR to Math::Vector and from D3DMATRIX to Math::Matrix - changed functions to new Math namespace functions - moved mainmovie module from graphics to object - added Get and Set to Math::Matrix --- src/object/auto/autopara.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/object/auto/autopara.cpp') diff --git a/src/object/auto/autopara.cpp b/src/object/auto/autopara.cpp index 46a34f9..568156b 100644 --- a/src/object/auto/autopara.cpp +++ b/src/object/auto/autopara.cpp @@ -20,6 +20,7 @@ #include #include "common/struct.h" +#include "math/geometry.h" #include "graphics/d3d/d3dengine.h" #include "math/old/d3dmath.h" #include "common/global.h" @@ -79,14 +80,14 @@ void CAutoPara::DeleteObject(bool bAll) void CAutoPara::Init() { - D3DMATRIX* mat; + Math::Matrix* mat; m_time = 0.0f; m_timeVirus = 0.0f; m_lastParticule = 0.0f; mat = m_object->RetWorldMatrix(0); - m_pos = Transform(*mat, D3DVECTOR(22.0f, 4.0f, 0.0f)); + m_pos = Math::Transform(*mat, Math::Vector(22.0f, 4.0f, 0.0f)); m_phase = APAP_WAIT; // waiting ... m_progress = 0.0f; @@ -110,7 +111,7 @@ void CAutoPara::StartBlitz() bool CAutoPara::EventProcess(const Event &event) { - D3DVECTOR pos, speed; + Math::Vector pos, speed; Math::Point dim; int i; @@ -253,7 +254,7 @@ void CAutoPara::ChargeObject(float rTime) { CObject* pObj; CObject* power; - D3DVECTOR sPos, oPos; + Math::Vector sPos, oPos; float dist, energy; int i; @@ -265,7 +266,7 @@ void CAutoPara::ChargeObject(float rTime) if ( pObj == 0 ) break; oPos = pObj->RetPosition(0); - dist = Length(oPos, sPos); + dist = Math::Distance(oPos, sPos); if ( dist > 20.0f ) continue; if ( pObj->RetTruck() == 0 && pObj->RetType() == OBJECT_POWER ) -- cgit v1.2.3-1-g7c22