summaryrefslogtreecommitdiffstats
path: root/src/object/auto/autopara.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-06-19 20:11:47 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-06-19 20:11:47 +0200
commit9f784e81f81651bed087902f9f3afee113e56148 (patch)
treeae89f6dabe2443b39aba292673027d197fc120e6 /src/object/auto/autopara.cpp
parentb8027ce9a7f050b95846a668a02f5801331e127f (diff)
downloadcolobot-9f784e81f81651bed087902f9f3afee113e56148.tar.gz
colobot-9f784e81f81651bed087902f9f3afee113e56148.tar.bz2
colobot-9f784e81f81651bed087902f9f3afee113e56148.zip
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
Diffstat (limited to 'src/object/auto/autopara.cpp')
-rw-r--r--src/object/auto/autopara.cpp11
1 files changed, 6 insertions, 5 deletions
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 <d3d.h>
#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 )