Changeset 6052 for code/branches/steering/src
- Timestamp:
- Nov 12, 2009, 8:00:42 PM (15 years ago)
- Location:
- code/branches/steering/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/steering/src/orxonox/graphics/Camera.cc
r5929 r6052 61 61 62 62 this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString()); 63 this->camera_->setUserObject(this); 63 64 this->cameraNode_ = this->getScene()->getRootSceneNode()->createChildSceneNode(); 64 65 this->attachNode(this->cameraNode_); -
code/branches/steering/src/orxonox/worldentities/WorldEntity.cc
r5929 r6052 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. … … 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/steering/src/orxonox/worldentities/WorldEntity.h
r5781 r6052 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.