[Orxonox-commit 7234] r11848 - code/branches/3DPacman_FS18/src/modules/Pacman
dreherm at orxonox.net
dreherm at orxonox.net
Sun Apr 1 00:40:42 CEST 2018
Author: dreherm
Date: 2018-04-01 00:40:41 +0200 (Sun, 01 Apr 2018)
New Revision: 11848
Modified:
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h
Log:
Ghost Check 4
Modified: code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc 2018-03-31 22:33:08 UTC (rev 11847)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc 2018-03-31 22:40:41 UTC (rev 11848)
@@ -48,7 +48,7 @@
this->localLinearAcceleration_.setValue(1, 1, 1);
this->localAngularAcceleration_.setValue(1, 1, 1);
- this->velocity.setValue(0, 0, 0);
+ this->velocity = Vector3(0, 0, 0);
this->setCollisionType(CollisionType::Dynamic);
@@ -86,7 +86,7 @@
- btVector3 possibleposition[] = {btVector3(0,10,245),btVector3(215,0,240)};
+ Vector3 possibleposition[] = {Vector3(0,10,245),Vector3(215,0,240)};
/**
@brief
@@ -122,12 +122,12 @@
//Move, if ghost hasn't arrived yet
if(this->ismoving){
if(!((this->actuelposition.z-target_z)<0.1)) {
- velocity = btVector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y),-sgn(this->actuelposition.z-this->target_z));
- move(dt);
+ velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y),-sgn(this->actuelposition.z-this->target_z));
+ move(dt, actuelposition, velocity);
}
if(!((this->actuelposition.x-target_x)<0.1)){
- velocity = btVector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y-this->target_y),-sgn(this->actuelposition.z-this->target_z));
- move(dt);
+ velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y-this->target_y),-sgn(this->actuelposition.z-this->target_z));
+ move(dt, actuelposition, velocity);
}
}
@@ -151,7 +151,7 @@
- void move(float dt){
+ void move(float dt, Vector3 actuelposition, Vector3 velocity){
this->setPosition(Vector3(actuelposition.x+velocity.x*dt,actuelposition.y+velocity.y*dt ,actuelposition.z+velocity.z*dt);
}
Modified: code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h 2018-03-31 22:33:08 UTC (rev 11847)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h 2018-03-31 22:40:41 UTC (rev 11848)
@@ -54,7 +54,7 @@
virtual void rotatePitch(const Vector2& value);
virtual void rotateRoll(const Vector2& value);
- void move(float dt);
+ void move(float dt, Vector3 actuelposition, Vector3 velocity);
//virtual void resetGhost();
/**
@@ -139,9 +139,9 @@
bool ismoving = false;
int target_x = 0;
int target_z = 0;
- btVector3 actuelposition;
- btVector3 velocity;
- btVector3 resetposition;
+ Vector3 actuelposition;
+ Vector3 velocity;
+ Vector3 resetposition;
};
}
More information about the Orxonox-commit
mailing list