Changeset 10705 in orxonox.OLD for branches/presentation/src/world_entities
- Timestamp:
- Jun 15, 2007, 4:44:51 PM (17 years ago)
- Location:
- branches/presentation/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/creatures/fps_player.cc
r10704 r10705 109 109 this->jumpAcceleration = 0.0f; 110 110 111 this->cameraNode.setParent(this); 111 this->cameraNode = new PNode(); 112 this->cameraNode->setParent(this); 112 113 113 114 this->attitude = this->getAbsDir().getAttitude(); … … 133 134 //this->aimingSystem = new AimingSystem(this); 134 135 135 #if 0136 #if 1 136 137 this->getWeaponManager().changeWeaponConfig(1); 137 138 this->getWeaponManager().setSlotCount(2); … … 142 143 this->getWeaponManager().setSlotPosition(1, Vector(5.0, 0.0, 0.0)); 143 144 144 this->getWeaponManager().setParentNode( &this->cameraNode);145 this->cameraNode .addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE);146 147 this->getWeaponManager().getFixedTarget()->setParent( &this->cameraNode);145 this->getWeaponManager().setParentNode(this->cameraNode); 146 this->cameraNode->addNodeFlags(PNODE_PROHIBIT_CHILD_DELETE); 147 148 this->getWeaponManager().getFixedTarget()->setParent(this->cameraNode); 148 149 this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ALL); 149 150 this->getWeaponManager().getFixedTarget()->setRelCoor(10,0,0); … … 155 156 this->addWeapon(wpRight,1, 0); 156 157 wpRight->toList( this->getOMListNumber() ); 157 wpRight->setParent( &this->cameraNode );158 wpRight->requestAction( WA_ACTIVATE );158 wpRight->setParent( this->cameraNode ); 159 //wpRight->requestAction( WA_ACTIVATE ); 159 160 //wpRight->addChild(this->aimingSystem); 160 161 161 162 //this->toList( OM_PLAYERS ); 162 163 } 163 #e ndif164 #else 164 165 165 166 FPSSniperRifle* wpRight = new FPSSniperRifle(0); … … 169 170 170 171 this->weaponMan.setParentEntity( this ); 171 this->weaponMan.setSlotCount(1); 172 this->weaponMan.createWeaponSlot(0, this->cameraNode.getRelCoor().x, this->cameraNode.getRelCoor().y, this->cameraNode.getRelCoor().z, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 172 this->weaponMan.setSlotCount(2); 173 this->weaponMan.createWeaponSlot(0, 0, 0, 0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 174 this->weaponMan.createWeaponSlot(1, 0, 0, 0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 173 175 this->weaponMan.addWeapon(wpRight, 0, 0); 174 176 this->weaponMan.changeWeaponConfig(0); … … 176 178 this->weaponMan.getFixedTarget()->setParent(&this->cameraNode ); 177 179 this->weaponMan.getFixedTarget()->setRelCoor( 100000,0,0 ); 178 180 #endif 179 181 180 182 // network registration … … 240 242 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true ); 241 243 242 State::getCameraNode()->setParentSoft( &this->cameraNode);243 State::getCameraTargetNode()->setParentSoft( &this->cameraNode);244 State::getCameraNode()->setParentSoft(this->cameraNode); 245 State::getCameraTargetNode()->setParentSoft(this->cameraNode); 244 246 245 247 State::getCamera()->setViewMode(Camera::ViewFPS); 246 248 247 this->getWeaponManager().getFixedTarget()->setParent( &this->cameraNode);249 this->getWeaponManager().getFixedTarget()->setParent(this->cameraNode); 248 250 //this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ALL); 249 251 //this->getWeaponManager().getFixedTarget()->setRelCoor(100,0,0); … … 278 280 this->initWeapon = true; 279 281 280 this->cameraNode .setParentMode(PNODE_ROTATE_AND_MOVE);282 this->cameraNode->setParentMode(PNODE_ROTATE_AND_MOVE); 281 283 282 284 this->getWeaponManager().getParentNode()->setParentMode(PNODE_ROTATE_AND_MOVE); 283 this->getWeaponManager().getFixedTarget()->setParent( &this->cameraNode);285 this->getWeaponManager().getFixedTarget()->setParent(this->cameraNode); 284 286 //this->getWeaponManager().getFixedTarget()->setParentMode(PNODE_ROTATE_AND_MOVE); 285 287 State::getCamera()->setViewMode(Camera::ViewFPS); … … 298 300 f = 0.3*f; 299 301 300 this->cameraNode.setRelCoor(0, box->halfLength[1] * f, 0); 302 this->cameraNode->setRelCoor(0, box->halfLength[1] * f, 0); 303 // this->weaponMan.setRelCoor(0, box->halfLength[1] * f, 0); 301 304 // this->cameraNode.setRelCoor(10, box->halfLength[1] * f, 0); 302 305 float v = 0.1f; 303 this->getWeaponManager().setSlotPosition(0, Vector(-8.0, box->halfLength[1] * v, 1.1)); 304 this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * v, 0.0)); 306 //this->getWeaponManager().setSlotPosition(0, Vector(-8.0, box->halfLength[1] * v, 1.1)); 307 //this->getWeaponManager().setSlotPosition(1, Vector(5.0, box->halfLength[1] * v, 0.0)); 308 this->getWeaponManager().setSlotDirection( 0, Quaternion( 0.04, Vector( 0, 0, 1 ) ) ); 305 309 } 306 310 … … 390 394 391 395 this->setAbsDir(Quaternion(heading, Vector(0,1,0))); 392 this->cameraNode .setRelDir(Quaternion( attitude, Vector( 0, 0, 1 ) ));396 this->cameraNode->setRelDir(Quaternion( attitude, Vector( 0, 0, 1 ) )); 393 397 394 398 Vector velocity; -
branches/presentation/src/world_entities/creatures/fps_player.h
r10704 r10705 62 62 float attitude; //!< defines the camera angle to the x-z-plane 63 63 64 PNode 64 PNode* cameraNode; //!< the "eyes" of the player (or call it head if you want) 65 65 66 66 float fallVelocity; //!< velocity for falling down -
branches/presentation/src/world_entities/weapons/bsp_weapon.cc
r10704 r10705 94 94 void BspWeapon::tick( float dt ) 95 95 { 96 PRINTF(0)("BSPWEAPON TICK: %d %f %f\n", bFire, bRate, dt );96 //PRINTF(0)("BSPWEAPON TICK: %d %f %f\n", bFire, bRate, dt ); 97 97 if (bFire) { 98 98 if (bRate <= 0) { -
branches/presentation/src/world_entities/weapons/fps_sniper_rifle.cc
r10704 r10705 168 168 glMatrixMode(GL_MODELVIEW); 169 169 glPushMatrix(); 170 glTranslatef (this->getAbsCoor ().x, 171 this->getAbsCoor ().y, 172 this->getAbsCoor ().z); 170 171 Vector pos = this->getAbsCoor() + this->getAbsDir().apply( Vector( 2, 0, 0 ) ); 172 glTranslatef (pos.x, 173 pos.y, 174 pos.z); 173 175 174 176 Vector tmpRot = this->getAbsDir().getSpacialAxis(); … … 183 185 184 186 glPopMatrix(); 185 186 187 } 187 188
Note: See TracChangeset
for help on using the changeset viewer.