Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2014, 10:21:20 AM (10 years ago)
Author:
muemart
Message:

Comment out all the raytest stuff. Needs more work and/or knowledge

Location:
code/branches/turretFS14
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/turretFS14/data/levels/turretTest.oxw

    r10060 r10063  
    5252  </collisionShapes>
    5353</SpaceShip>
    54 
    55 <Turret collisionType="dynamic" pitch=90 position="30,0,0">
    56     <attached>
    57       <Model position="0,0,0" mesh="turretSocketFront.mesh" scale3D="10,10,10" pitch=-90/>
    58       <Model position="0,0,0" mesh="turretSocketIn.mesh" scale3D="10,10,10" pitch=-90/>
    59       <Model position="0,0,0" mesh="turretSocketTop.mesh" scale3D="10,10,10" pitch=-90/>
    60       <Model position="0,0,0" mesh="turretSocketLeft.mesh" scale3D="10,10,10" pitch=-90/>
    61       <Model position="0,0,0" mesh="turretSocketRight.mesh" scale3D="10,10,10" pitch=-90/>
    62 
    63       <Turret position="0,0,-10" collisionType="dynamic" pitch=20 angularDamping=0.999999 mass=100 maxPitch=45 maxYaw=45 maxAttackRadius=2000 minAttackRadius=30>
    64         <attached>
    65           <Model position="0,0,0" pitch="-90" roll="0" mesh="turretHead.mesh" scale3D="10,10,10"/>
    66         </attached>
    67         <collisionShapes>
    68           <SphereCollisionShape radius="10"   position = "0,0,0"/>
    69         </collisionShapes>
    70         <controller>
    71           <TurretController/>
    72         </controller>
    73         <?lua
    74           include("includes/weaponSettingsTurret.oxi")
    75         ?>
    76       </Turret>
    77     </attached>
    78    
    79     <controller>
    80       <TeamTargetProxy team=10/>
    81     </controller>
    82   </Turret>
    83 
    8454   
    8555  </Scene>
  • code/branches/turretFS14/src/modules/objects/Turret.cc

    r10061 r10063  
    6363
    6464        this->setRadarVisibility(false);
     65
     66        //this->rayTest_ = this->getScene()->getSceneManager()->createRayQuery(Ogre::Ray());
    6567    }
    6668
    6769    /**
    6870        @brief
    69         Destructor. Nothing to see here.
     71        Destructor. Destroys the rayTest_ element (if it was used)  .
    7072     */
    7173    Turret::~Turret()
    7274    {
    73 
     75        //this->getScene()->getSceneManager()->destroyQuery(this->rayTest_);
    7476    }
    7577
     
    8789        The squared distance to the position. -1, if it's ouside of range
    8890    */
    89     float Turret::isInRange(const WorldEntity* target ) const
     91    float Turret::isInRange(const WorldEntity* target )
    9092    {
    9193        //Check distance
     
    120122        }
    121123
    122         Ogre::SceneManager* scenemanager = this->getScene()->getSceneManager();
    123         Ogre::Ray ray = Ogre::Ray(this->getWorldPosition(), distance);
    124         Ogre::DefaultRaySceneQuery rayscenequery = Ogre::DefaultRaySceneQuery(scenemanager);
    125         rayscenequery.setRay(ray);
    126        //rayscenequery.execute();
     124        //TODO: Finish this. Find a way to convert objects from Ogre to Orxonox
     125        /*Ogre::Ray ray = Ogre::Ray(this->getWorldPosition(), distance);
     126        this->rayTest_->setRay(ray);
     127        Ogre::RaySceneQueryResult result = this->rayTest_->execute();*/
     128
    127129
    128130        return distanceVal;
     
    273275            //Don't make the rotation instantaneous. Use an arbitrary interpolation, not that great...
    274276            //TODO: make the rotation better (constant velocity etc.). At the moment, the turret rotates
    275             //      slower the closer it is to the destination
     277            //slower the closer it is to the destination
    276278            Quaternion drot = Quaternion::nlerp(dt*this->rotationThrust_/20.f, Quaternion::IDENTITY, this->rotation_);
    277279            this->rotate(drot, WorldEntity::World);
  • code/branches/turretFS14/src/modules/objects/Turret.h

    r10060 r10063  
    3737#include "objects/ObjectsPrereqs.h"
    3838#include "worldentities/pawns/Pawn.h"
     39#include <OgreSceneQuery.h>
    3940
    4041namespace orxonox
     
    6364            virtual void rotateYaw(const Vector2& value);
    6465            virtual void rotateRoll(const Vector2& value);
    65             virtual float isInRange(const WorldEntity* target) const;
     66            virtual float isInRange(const WorldEntity* target);
    6667            virtual void aimAtPosition(const Vector3 &position);
    6768
     
    119120            Ogre::Real maxYaw_; //!< The maxmium yaw the turret can have (on one side).
    120121            float rotationThrust_;  //!< The velocity the turret rotates with.
     122            Ogre::RaySceneQuery* rayTest_; //!< Used to perform a raytest, currently unused @see isInRange
    121123
    122124    };
Note: See TracChangeset for help on using the changeset viewer.