[Orxonox-commit 7235] r11849 - code/branches/3DPacman_FS18/src/modules/Pacman
dreherm at orxonox.net
dreherm at orxonox.net
Sun Apr 1 00:44:36 CEST 2018
Author: dreherm
Date: 2018-04-01 00:44:36 +0200 (Sun, 01 Apr 2018)
New Revision: 11849
Modified:
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h
Log:
Ghost Check 5
Modified: code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc 2018-03-31 22:40:41 UTC (rev 11848)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc 2018-03-31 22:44:36 UTC (rev 11849)
@@ -52,7 +52,7 @@
this->setCollisionType(CollisionType::Dynamic);
- this->resetposition.setValue(0,20,245); //Set Default start position
+ this->resetposition = Vector3(0,20,245); //Set Default start position
this->actuelposition = this->getPosition();
@@ -126,7 +126,7 @@
move(dt, actuelposition, velocity);
}
if(!((this->actuelposition.x-target_x)<0.1)){
- velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y-this->target_y),-sgn(this->actuelposition.z-this->target_z));
+ velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y),-sgn(this->actuelposition.z-this->target_z));
move(dt, actuelposition, velocity);
}
}
@@ -151,9 +151,9 @@
- void move(float dt, Vector3 actuelposition, Vector3 velocity){
+ void PacmanGhost::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);
+ 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:40:41 UTC (rev 11848)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h 2018-03-31 22:44:36 UTC (rev 11849)
@@ -54,7 +54,7 @@
virtual void rotatePitch(const Vector2& value);
virtual void rotateRoll(const Vector2& value);
- void move(float dt, Vector3 actuelposition, Vector3 velocity);
+ void PacmanGhost::move(float dt, Vector3 actuelposition, Vector3 velocity);
//virtual void resetGhost();
/**
More information about the Orxonox-commit
mailing list