Changeset 3586 in orxonox.OLD for orxonox/trunk/src/story_entities
- Timestamp:
- Mar 17, 2005, 2:15:33 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r3573 r3586 181 181 182 182 //create helper for player 183 HelperParent* hp = new HelperParent ();183 //HelperParent* hp = new HelperParent (); 184 184 /* the player has to be added to this helper */ 185 185 186 186 // create a player 187 WorldEntity* myPlayer = new Player (); 188 myPlayer->setName ("player"); 189 this->spawn (myPlayer); 190 this->localPlayer = myPlayer; 187 this->localPlayer = new Player (); 188 this->localPlayer->setName ("player"); 189 this->spawn (this->localPlayer); 191 190 /*monitor progress*/ 192 191 this->glmis->step(); … … 194 193 // bind input 195 194 Orxonox *orx = Orxonox::getInstance (); 196 orx->getLocalInput()->bind ( myPlayer);195 orx->getLocalInput()->bind (this->localPlayer); 197 196 198 197 // bind camera 199 198 this->localCamera = new Camera(this); 200 199 this->localCamera->setName ("camera"); 201 this->localCamera->bind ( myPlayer);200 this->localCamera->bind (this->localPlayer); 202 201 /*monitor progress*/ 203 202 this->glmis->step(); … … 217 216 this->spawn(env); 218 217 219 /* 220 Vector* es = new Vector (50, 2, 0); 221 Quaternion* qs = new Quaternion (); 222 WorldEntity* pr = new Primitive(PSPHERE); 223 pr->setName("primitive"); 224 this->spawn(pr, this->localPlayer, es, qs, ROTATION); 225 */ 226 218 219 //Vector* es = new Vector (10, 5, 0); 220 //Quaternion* qs = new Quaternion (); 221 //WorldEntity* pr = new Primitive(PSPHERE); 222 //pr->setName("primitive"); 223 //this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE); 224 227 225 228 226 /*monitor progress*/ … … 231 229 // trackManager->setBindSlave(env); 232 230 PNode* tn = trackManager->getTrackNode(); 233 tn->addChild( myPlayer);231 tn->addChild(this->localPlayer); 234 232 235 233 //localCamera->setParent(TrackNode::getInstance()); 236 234 tn->addChild (this->localCamera); 237 myPlayer->setMode(PNODE_ROTATE_AND_MOVE);235 this->localPlayer->setMode(PNODE_ROTATE_AND_MOVE); 238 236 //Vector* cameraOffset = new Vector (0, 5, -10); 239 237 Vector* cameraOffset = new Vector (-10, 5, 0); 240 238 this->localCamera->setRelCoor (cameraOffset); 241 trackManager->condition(2, NEAREST, myPlayer);239 trackManager->condition(2, NEAREST, this->localPlayer); 242 240 243 241 break; … … 267 265 skySphere = new Skysphere("../data/pictures/sky-replace.jpg"); 268 266 this->localPlayer->addChild(this->skySphere); 267 268 Vector* es = new Vector (20, 0, 0); 269 Quaternion* qs = new Quaternion (); 270 WorldEntity* pr = new Primitive(PSPHERE); 271 pr->setName("primitive"); 272 this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE); 269 273 270 274 break; … … 721 725 entity->setRelCoor (relCoor); 722 726 entity->setRelDir (relDir); 727 entity->setMode(parentingMode); 723 728 724 729 this->entities->add (entity);
Note: See TracChangeset
for help on using the changeset viewer.