- Timestamp:
- Apr 1, 2018, 12:40:41 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc
r11847 r11848 49 49 this->localAngularAcceleration_.setValue(1, 1, 1); 50 50 51 this->velocity .setValue(0, 0, 0);51 this->velocity = Vector3(0, 0, 0); 52 52 53 53 this->setCollisionType(CollisionType::Dynamic); … … 87 87 88 88 89 btVector3 possibleposition[] = {btVector3(0,10,245),btVector3(215,0,240)};89 Vector3 possibleposition[] = {Vector3(0,10,245),Vector3(215,0,240)}; 90 90 91 91 /** … … 123 123 if(this->ismoving){ 124 124 if(!((this->actuelposition.z-target_z)<0.1)) { 125 velocity = btVector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y),-sgn(this->actuelposition.z-this->target_z));126 move(dt );125 velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y),-sgn(this->actuelposition.z-this->target_z)); 126 move(dt, actuelposition, velocity); 127 127 } 128 128 if(!((this->actuelposition.x-target_x)<0.1)){ 129 velocity = btVector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y-this->target_y),-sgn(this->actuelposition.z-this->target_z));130 move(dt );129 velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y-this->target_y),-sgn(this->actuelposition.z-this->target_z)); 130 move(dt, actuelposition, velocity); 131 131 } 132 132 } … … 152 152 153 153 154 void move(float dt ){154 void move(float dt, Vector3 actuelposition, Vector3 velocity){ 155 155 156 156 this->setPosition(Vector3(actuelposition.x+velocity.x*dt,actuelposition.y+velocity.y*dt ,actuelposition.z+velocity.z*dt);
Note: See TracChangeset
for help on using the changeset viewer.