Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2009, 4:54:20 PM (16 years ago)
Author:
wirthmi
Message:

Changed a function call when hit from damage() to hit(). Pass through to controller

Location:
code/branches/presentation2/src/orxonox/controllers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/controllers/Controller.h

    r6195 r6295  
    5050                { return this->player_; }
    5151
     52            virtual inline void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {};
     53
    5254            inline ControllableEntity* getControllableEntity() const
    5355                { return this->controllableEntity_; }
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc

    r6289 r6295  
    4444#include "sound/SoundManager.h"
    4545#include "Scene.h"
     46#include "tools/BulletConversions.h"
     47#include "bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h"
    4648
    4749namespace orxonox
     
    246248            HumanController::localController_s->getControllableEntity()->fire(firemode);
    247249
     250    }
     251
     252    void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) {
     253        Vector3 posA = multi_cast<Vector3>(contactpoint.getPositionWorldOnA());
     254        //Vector3 posB = multi_cast<Vector3>(contactpoint.getPositionWorldOnB());
     255        //posA and posB are almost identical
     256
     257        Vector3 relativeHit = this->getControllableEntity()->getWorldOrientation() * (posA - this->getControllableEntity()->getPosition());
     258
     259        COUT(0) << relativeHit << endl;
     260        //COUT(0) << "Damage: " << damage << " Point A: " << posA << " Point B: " << posB << endl;
    248261    }
    249262
  • code/branches/presentation2/src/orxonox/controllers/NewHumanController.h

    r6236 r6295  
    5656            virtual void doFire(unsigned int firemode);
    5757
     58            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
     59
    5860            static void unfire();
    5961            virtual void doUnfire();
Note: See TracChangeset for help on using the changeset viewer.