summaryrefslogtreecommitdiffstats
path: root/src/object/task/taskfireant.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/task/taskfireant.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/task/taskfireant.cpp')
-rw-r--r--src/object/task/taskfireant.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/object/task/taskfireant.cpp b/src/object/task/taskfireant.cpp
index 0c7aaf6..f2fbd09 100644
--- a/src/object/task/taskfireant.cpp
+++ b/src/object/task/taskfireant.cpp
@@ -60,7 +60,7 @@ CTaskFireAnt::~CTaskFireAnt()
bool CTaskFireAnt::EventProcess(const Event &event)
{
- D3DVECTOR dir, vib;
+ Math::Vector dir, vib;
float a, g, cirSpeed;
if ( m_engine->RetPause() ) return true;
@@ -93,9 +93,9 @@ bool CTaskFireAnt::EventProcess(const Event &event)
// Assigns the goal was achieved.
-Error CTaskFireAnt::Start(D3DVECTOR impact)
+Error CTaskFireAnt::Start(Math::Vector impact)
{
- D3DVECTOR pos;
+ Math::Vector pos;
ObjectType type;
m_impact = impact;
@@ -109,7 +109,7 @@ Error CTaskFireAnt::Start(D3DVECTOR impact)
// Insect on its back?
if ( m_object->RetFixed() ) return ERR_FIRE_VEH;
- m_physics->SetMotorSpeed(D3DVECTOR(0.0f, 0.0f, 0.0f));
+ m_physics->SetMotorSpeed(Math::Vector(0.0f, 0.0f, 0.0f));
pos = m_object->RetPosition(0);
m_angle = Math::RotateAngle(m_impact.x-pos.x, pos.z-m_impact.z); // CW !
@@ -129,8 +129,8 @@ Error CTaskFireAnt::Start(D3DVECTOR impact)
Error CTaskFireAnt::IsEnded()
{
- D3DMATRIX* mat;
- D3DVECTOR pos, speed;
+ Math::Matrix* mat;
+ Math::Vector pos, speed;
Math::Point dim;
float angle, dist;
int i, channel;
@@ -175,10 +175,10 @@ Error CTaskFireAnt::IsEnded()
for ( i=0 ; i<20 ; i++ )
{
- pos = D3DVECTOR(-2.5f, -0.7f, 0.0f);
+ pos = Math::Vector(-2.5f, -0.7f, 0.0f);
mat = m_object->RetWorldMatrix(2);
- pos = Transform(*mat, pos);
- dist = Length(pos, m_impact);
+ pos = Math::Transform(*mat, pos);
+ dist = Math::Distance(pos, m_impact);
speed = m_impact-pos;
speed.x += (Math::Rand()-0.5f)*dist*1.2f;
speed.y += (Math::Rand()-0.5f)*dist*0.4f+50.0f;