Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11846


Ignore:
Timestamp:
Apr 1, 2018, 12:23:34 AM (6 years ago)
Author:
dreherm
Message:

Commit and check ghost class2

Location:
code/branches/3DPacman_FS18/src/modules/Pacman
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.cc

    r11845 r11846  
    4949        this->localAngularAcceleration_.setValue(1, 1, 1);
    5050
    51         this->velocity(1, 0, 0);
     51        this->velocity = Vector3(0, 0, 0);
    5252
    5353        this->setCollisionType(CollisionType::Dynamic);
     
    123123        if(this->ismoving){
    124124            if(!((this->actuelposition.z-target_z)<0.1)) {
    125                 velocity = Vector3(sgn(this->actuelposition.x-this->target_x),sgn(this->actuelposition.y-this->target_y),sgn(this->actuelposition.z-this->target_z));
     125                velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y),-sgn(this->actuelposition.z-this->target_z));
    126126                move(dt);
    127127            }   
    128128            if(!((this->actuelposition.x-target_x)<0.1)){
    129                 velocity = Vector3(sgn(this->actuelposition.x-this->target_x),sgn(this->actuelposition.y-this->target_y),sgn(this->actuelposition.z-this->target_z));
     129                velocity = Vector3(-sgn(this->actuelposition.x-this->target_x),-sgn(this->actuelposition.y-this->target_y),-sgn(this->actuelposition.z-this->target_z));
    130130                move(dt);
    131131            }
     
    153153
    154154    void move(float dt){
    155         this->setPosition(actuelposition+velocity*dt);
     155
     156        this->setPosition(Vector3(actuelposition.x+velocity.x*dt,actuelposition.y+velocity.y*dt ,actuelposition.z+velocity.z*dt);
    156157    }
    157158
  • code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h

    r11845 r11846  
    5555            virtual void rotateRoll(const Vector2& value);
    5656
    57             virtual void move();
     57            void move();
    5858           
    5959            //virtual void resetGhost();
Note: See TracChangeset for help on using the changeset viewer.