Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9494 in orxonox.OLD for trunk/src/world_entities/space_ships


Ignore:
Timestamp:
Jul 27, 2006, 10:44:28 AM (18 years ago)
Author:
bensch
Message:

merged the proxy back

Location:
trunk/src/world_entities/space_ships
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/space_ship.cc

    r9406 r9494  
    310310void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
    311311{
    312   Playable::collidesWith(entity, location);
    313 
    314   if( entity->isA(CL_PROJECTILE) && entity != ref)
    315   {
    316     if ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer())
    317     {
    318       //TODO handle this
    319     }
    320   }
    321   PRINTF(3)("collision %s vs %s @ (%f,%f,%f)\n", this->getClassCName(), entity->getClassCName(), location.x, location.y, location.z);
     312
    322313}
    323314
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r8623 r9494  
    126126  this->cameraNode.addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);
    127127  //this->cameraNode.setParentMode(PNODE_ROTATE_MOVEMENT);
    128   //this->cameraNode.setParent(this);
     128  this->cameraNode.setParent(this);
     129  this->cameraNode.setRelCoor(0,5,0);
    129130
    130131  // rotors
     
    211212  this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
    212213  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
    213  
     214
    214215  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
    215216  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
     
    218219  registerVar( new SynchronizeableBool( &bAscend, &bAscend, "bAscend", PERMISSION_OWNER ) );
    219220  registerVar( new SynchronizeableBool( &bDescend, &bDescend, "bDescend", PERMISSION_OWNER ) );
    220   //registerVar( new SynchronizeableQuaternion( &direction, &direction, "direction", PERMISSION_OWNER ) );
     221  registerVar( new SynchronizeableQuaternion( &direction, &direction, "direction", PERMISSION_OWNER ) );
    221222  registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) );
    222223  registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
     
    294295
    295296  // spaceship controlled movement
     297
     298  // TRYING TO FIX PNode.
     299  //this->cameraNode.setRelCoor(Vector(0.0f, 5.0f, 0.0f));//, 30.0f);
     300  //this->cameraNode.setRelDir(Quaternion(this->smoothRotator  *10.0, Vector(0,1,0)));
     301
    296302  this->movement(dt);
    297303  this->rotorCycle += this->rotorSpeed * dt;
    298 
    299   // TRYING TO FIX PNode.
    300   this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0.0f, 5.0f, 0.0f), 30.0f);
    301   this->cameraNode.setRelDirSoft(this->getAbsDir(), 30.0f);
    302 }
     304}
     305
     306
     307#include "shared_network_data.h"
    303308
    304309/**
     
    349354
    350355        this->velocity += (accelerationDir - damping)* dt;
    351         this->shiftCoor (this->velocity * dt);
     356        //if (this->getOwner() != SharedNetworkData::getInstance()->getHostID())
     357          this->shiftCoor (this->velocity * dt);
    352358
    353359        // limit the maximum rotation speed.
     
    362368        }
    363369
    364         this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
     370        //if (this->getOwner() != SharedNetworkData::getInstance()->getHostID())
     371          this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
    365372
    366373        this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     
    407414
    408415    case Playable::Vertical:
    409     {
    410       accel.z = 0;
    411       Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
    412       accelerationDir.z=0;
     416      {
     417        accel.z = 0;
     418        Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
     419        accelerationDir.z=0;
    413420
    414421        // this is the air friction (necessary for a smooth control)
    415       Vector damping = (this->velocity * this->airFriction);
    416 
    417       this->velocity += (accelerationDir - damping)* dt;
    418       this->shiftCoor (this->velocity * dt);
    419 
    420       this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
    421 
    422       this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
    423       this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5);
    424 
    425       this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
    426       this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5);
    427     }
    428     break;
     422        Vector damping = (this->velocity * this->airFriction);
     423
     424        this->velocity += (accelerationDir - damping)* dt;
     425        this->shiftCoor (this->velocity * dt);
     426
     427        this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
     428
     429        this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     430        this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5);
     431
     432        this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     433        this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5);
     434      }
     435      break;
    429436    default:
    430437      PRINTF(2)("Playmode %s Not Implemented\n", Playable::playmodeToString(this->getPlaymode()).c_str());
Note: See TracChangeset for help on using the changeset viewer.