Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 13, 2009, 12:06:22 PM (14 years ago)
Author:
rgrieder
Message:

Found the firing direction bug: "Fixed goes first" we were told a few weeks ago in a lecture about spatial coordinates.
Here the problem was a quaternion multiplication.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/steering/src/orxonox/controllers/NewHumanController.cc

    r6055 r6058  
    5959        crossHairOverlay_->show();
    6060
    61         // HACK: Define which objects are targettable when considering the creator of an orxonox::Model
     61        // HACK: Define which objects are targetable when considering the creator of an orxonox::Model
    6262        this->targetMask_.exclude(ClassByString("BaseObject"));
    6363        this->targetMask_.include(ClassByString("WorldEntity"));
     
    121121        //std::cout << "X: " << static_cast<float>(this->currentYaw_)/2*-1+.5 << "  Y: " << static_cast<float>(this->currentPitch_)/2*-1+.5 << endl;
    122122
    123         Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5, static_cast<float>(this->currentPitch_)/2*-1+.5);
     123        Ogre::Ray mouseRay = HumanController::localController_s->getControllableEntity()->getCamera()->getOgreCamera()->getCameraToViewportRay(static_cast<float>(this->currentYaw_)/2*-1+.5, static_cast<float>(this->currentPitch_)/2*-1+.5);
    124124
    125125        rsq->setRay(mouseRay);
     
    170170        }
    171171*/
    172         return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getWorldOrientation() * Vector3::NEGATIVE_UNIT_Z * 100);
    173         //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getCamera()->getCamera()->getOrientation() * Vector3::NEGATIVE_UNIT_Z);
     172        return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getWorldOrientation() * Vector3::NEGATIVE_UNIT_Z * 800);
     173        //return this->controllableEntity_->getWorldPosition() + (this->controllableEntity_->getCamera()->getOgreCamera()->getOrientation() * Vector3::NEGATIVE_UNIT_Z);
    174174    }
    175175
Note: See TracChangeset for help on using the changeset viewer.