Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6058


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.

Location:
code/branches/steering/src/orxonox
Files:
3 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
  • code/branches/steering/src/orxonox/graphics/Camera.h

    r6033 r6058  
    5252            void releaseFocus();
    5353
    54             inline Ogre::Camera* getCamera()
     54            inline Ogre::Camera* getOgreCamera()
    5555               { return this->camera_; }
    5656
  • code/branches/steering/src/orxonox/weaponsystem/WeaponMode.cc

    r6055 r6058  
    206206            {
    207207                Vector3 muzzleDirection(controller->getTarget() - this->muzzlePosition_);
    208                 this->muzzleOrientation_ = this->weapon_->getWorldOrientation() * (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection);
     208                this->muzzleOrientation_ = (this->weapon_->getWorldOrientation() * WorldEntity::FRONT).getRotationTo(muzzleDirection) * this->weapon_->getWorldOrientation();
    209209            }
    210210            else
Note: See TracChangeset for help on using the changeset viewer.