summaryrefslogtreecommitdiffstats
path: root/src/object/auto/autotower.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/autotower.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/autotower.cpp')
-rw-r--r--src/object/auto/autotower.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/object/auto/autotower.cpp b/src/object/auto/autotower.cpp
index a76260e..227a1e9 100644
--- a/src/object/auto/autotower.cpp
+++ b/src/object/auto/autotower.cpp
@@ -105,7 +105,7 @@ bool CAutoTower::EventProcess(const Event &event)
{
CObject* power;
CObject* target;
- D3DVECTOR pos;
+ Math::Vector pos;
float angle, energy, quick;
CAuto::EventProcess(event);
@@ -209,7 +209,7 @@ bool CAutoTower::EventProcess(const Event &event)
m_angleYactual = Math::NormAngle(m_object->RetAngleY(1));
m_angleZfinal = -Math::PI/2.0f;
- m_angleZfinal -= Math::RotateAngle(Length2d(m_targetPos, pos), pos.y-m_targetPos.y); // CW !
+ m_angleZfinal -= Math::RotateAngle(Math::DistanceProjected(m_targetPos, pos), pos.y-m_targetPos.y); // CW !
m_angleZactual = m_object->RetAngleZ(2);
m_phase = ATP_TURN;
@@ -274,12 +274,12 @@ bool CAutoTower::EventProcess(const Event &event)
// Seeks the nearest target object.
-CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
+CObject* CAutoTower::SearchTarget(Math::Vector &impact)
{
CObject* pObj;
CObject* pBest = 0;
CPhysics* physics;
- D3DVECTOR iPos, oPos;
+ Math::Vector iPos, oPos;
ObjectType oType;
float distance, min, radius, speed;
int i;
@@ -313,7 +313,7 @@ CObject* CAutoTower::SearchTarget(D3DVECTOR &impact)
}
if ( !pObj->GetCrashSphere(0, oPos, radius) ) continue;
- distance = Length(oPos, iPos);
+ distance = Math::Distance(oPos, iPos);
if ( distance > TOWER_SCOPE ) continue; // too far
if ( distance < min )
{
@@ -359,8 +359,8 @@ Error CAutoTower::RetError()
void CAutoTower::FireStopUpdate(float progress, bool bLightOn)
{
- D3DMATRIX* mat;
- D3DVECTOR pos, speed;
+ Math::Matrix* mat;
+ Math::Vector pos, speed;
Math::Point dim;
int i;
@@ -387,7 +387,7 @@ void CAutoTower::FireStopUpdate(float progress, bool bLightOn)
mat = m_object->RetWorldMatrix(0);
- speed = D3DVECTOR(0.0f, 0.0f, 0.0f);
+ speed = Math::Vector(0.0f, 0.0f, 0.0f);
dim.x = 2.0f;
dim.y = dim.x;