diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-19 20:11:47 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-19 20:11:47 +0200 |
commit | 9f784e81f81651bed087902f9f3afee113e56148 (patch) | |
tree | ae89f6dabe2443b39aba292673027d197fc120e6 /src/object/task/tasksearch.cpp | |
parent | b8027ce9a7f050b95846a668a02f5801331e127f (diff) | |
download | colobot-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/tasksearch.cpp')
-rw-r--r-- | src/object/task/tasksearch.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/object/task/tasksearch.cpp b/src/object/task/tasksearch.cpp index c002d6a..7660bfa 100644 --- a/src/object/task/tasksearch.cpp +++ b/src/object/task/tasksearch.cpp @@ -22,6 +22,7 @@ #include <d3d.h>
#include "common/struct.h"
+#include "math/geometry.h"
#include "math/old/math3d.h"
#include "common/event.h"
#include "common/misc.h"
@@ -59,8 +60,8 @@ CTaskSearch::~CTaskSearch() bool CTaskSearch::EventProcess(const Event &event)
{
- D3DMATRIX* mat;
- D3DVECTOR pos, speed;
+ Math::Matrix* mat;
+ Math::Vector pos, speed;
Math::Point dim;
float angle;
int i;
@@ -89,8 +90,8 @@ bool CTaskSearch::EventProcess(const Event &event) m_lastParticule = m_time;
mat = m_object->RetWorldMatrix(0);
- pos = D3DVECTOR(6.5f, 0.2f, 0.0f);
- pos = Transform(*mat, pos); // sensor position
+ pos = Math::Vector(6.5f, 0.2f, 0.0f);
+ pos = Math::Transform(*mat, pos); // sensor position
speed.x = (Math::Rand()-0.5f)*20.0f;
speed.z = (Math::Rand()-0.5f)*20.0f;
@@ -135,7 +136,7 @@ void CTaskSearch::InitAngle() Error CTaskSearch::Start()
{
ObjectType type;
- D3DVECTOR speed;
+ Math::Vector speed;
int i;
m_bError = true;
@@ -240,14 +241,14 @@ bool CTaskSearch::CreateMark() {
CObject* fret;
ObjectType type;
- D3DMATRIX* mat;
- D3DVECTOR pos;
+ Math::Matrix* mat;
+ Math::Vector pos;
TerrainRes res;
Error info;
mat = m_object->RetWorldMatrix(0);
- pos = D3DVECTOR(7.5f, 0.0f, 0.0f);
- pos = Transform(*mat, pos); // sensor position
+ pos = Math::Vector(7.5f, 0.0f, 0.0f);
+ pos = Math::Transform(*mat, pos); // sensor position
res = m_terrain->RetResource(pos);
if ( res == TR_NULL ) return false;
@@ -310,7 +311,7 @@ bool CTaskSearch::CreateMark() void CTaskSearch::DeleteMark(ObjectType type)
{
CObject* pObj;
- D3DVECTOR oPos;
+ Math::Vector oPos;
int i;
for ( i=0 ; i<1000000 ; i++ )
|