Changeset 6108 for code/branches/presentation2/src/orxonox/worldentities
- Timestamp:
- Nov 20, 2009, 8:15:25 PM (15 years ago)
- Location:
- code/branches/presentation2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2
- Property svn:mergeinfo changed
/code/branches/steering (added) merged: 5979,5981,5984,5993,6001,6033,6045,6052,6055,6058,6091
- Property svn:mergeinfo changed
-
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc
r6107 r6108 65 65 this->camera_ = 0; 66 66 this->xmlcontroller_ = 0; 67 this->controller_ = 0; 67 68 this->reverseCamera_ = 0; 68 69 this->bDestroyWhenPlayerLeft_ = false; -
code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.h
r6107 r6108 140 140 inline Controller* getXMLController() const 141 141 { return this->xmlcontroller_; } 142 143 inline Controller* getController() const 144 { return this->controller_; } 145 inline void setController(Controller* val) 146 { this->controller_ = val; } 142 147 143 148 protected: … … 202 207 std::string cameraPositionTemplate_; 203 208 Controller* xmlcontroller_; 209 Controller* controller_; 204 210 CameraPosition* reverseCamera_; 205 211 }; -
code/branches/presentation2/src/orxonox/worldentities/WorldEntity.cc
r5929 r6108 472 472 //! Attaches an Ogre::MovableObject to this WorldEntity. 473 473 void WorldEntity::attachOgreObject(Ogre::MovableObject* object) 474 { this->node_->attachObject(object); } 474 { 475 this->node_->attachObject(object); 476 object->setUserObject(this); 477 } 478 475 479 void WorldEntity::attachOgreObject(Ogre::BillboardSet* object) 476 { this-> node_->attachObject(object); }480 { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 477 481 void WorldEntity::attachOgreObject(Ogre::Camera* object) 478 { this-> node_->attachObject(object); }482 { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 479 483 void WorldEntity::attachOgreObject(Ogre::Entity* object) 480 { this-> node_->attachObject(object); }484 { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 481 485 void WorldEntity::attachOgreObject(Ogre::ParticleSystem* object) 482 { this-> node_->attachObject(object); }486 { this->attachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 483 487 484 488 //! Detaches an Ogre::MovableObject from this WorldEntity. 485 489 void WorldEntity::detachOgreObject(Ogre::MovableObject* object) 486 { this->node_->detachObject(object); } 490 { 491 object->setUserObject(NULL); 492 this->node_->detachObject(object); 493 } 494 487 495 void WorldEntity::detachOgreObject(Ogre::BillboardSet* object) 488 { this-> node_->detachObject(object); }496 { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 489 497 void WorldEntity::detachOgreObject(Ogre::Camera* object) 490 { this-> node_->detachObject(object); }498 { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 491 499 void WorldEntity::detachOgreObject(Ogre::Entity* object) 492 { this-> node_->detachObject(object); }500 { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 493 501 void WorldEntity::detachOgreObject(Ogre::ParticleSystem* object) 494 { this-> node_->detachObject(object); }502 { this->detachOgreObject(static_cast<Ogre::MovableObject*>(object)); } 495 503 496 504 //! Detaches an Ogre::MovableObject (by string) from this WorldEntity. … … 646 654 /** 647 655 @brief 648 Makes this WorldEntity look a specific target location.656 Makes this WorldEntity look at a specific target location. 649 657 @param relativeTo 650 658 @see WorldEntity::TransformSpace … … 913 921 } 914 922 915 //! Copies our own parameters for restitution, angular factor, damping sand friction to the bullet rigid body.923 //! Copies our own parameters for restitution, angular factor, damping and friction to the bullet rigid body. 916 924 void WorldEntity::internalSetPhysicsProps() 917 925 { -
code/branches/presentation2/src/orxonox/worldentities/WorldEntity.h
r5781 r6108 33 33 #include "OrxonoxPrereqs.h" 34 34 35 #include <OgreUserDefinedObject.h> 35 36 #ifdef ORXONOX_RELEASE 36 37 # include <OgreSceneNode.h> … … 55 56 56 57 The basic task of the WorldEntity is provide a location, a direction and a scaling and the possibility 57 to create an entire hierarchy of deriv ated objects.58 to create an entire hierarchy of derived objects. 58 59 It is also the basis for the physics interface to the Bullet physics engine. 59 60 Every WorldEntity can have a specific collision type: @see CollisionType … … 63 64 There is also support for attaching WorldEntities with physics to each other. Currently, the collision shape 64 65 of both objects simply get merged into one larger shape (for static collision type). 65 The phy iscal body that is internally stored and administrated has the following supported properties:66 - Restitution, angular factor, linear damping, angular damping, fric ition, mass and collision shape.66 The physical body that is internally stored and administrated has the following supported properties: 67 - Restitution, angular factor, linear damping, angular damping, friction, mass and collision shape. 67 68 You can get more information at the corresponding set function. 68 69 69 70 Collision shapes: These are controlled by the internal WorldEntityCollisionShape. @see WorldEntityCollisionShape. 70 71 */ 71 class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState 72 class _OrxonoxExport WorldEntity : public BaseObject, public Synchronisable, public btMotionState, public Ogre::UserDefinedObject 72 73 { 73 74 friend class Scene; … … 318 319 Sets an artificial parameter that tells how much torque is applied when you apply a non-central force. 319 320 320 Normally the angular factor is 1, which means it's physically 'correct'. Howe rver if you have a player321 Normally the angular factor is 1, which means it's physically 'correct'. However if you have a player 321 322 character that should not rotate when hit sideways, you can set the angular factor to 0. 322 323 */ … … 394 395 You can override this function in a derived class to constrain the collision to e.g. None or Dynamic. 395 396 A projectile may not prove very useful if there is no physical body. Simply set the CollisionType 396 in its constructor and override this method. But be careful that a derived class e's virtual functions397 in its constructor and override this method. But be careful that a derived class's virtual functions 397 398 don't yet exist in the constructor if a base class. 398 399 */
Note: See TracChangeset
for help on using the changeset viewer.