Changeset 8706 for code/trunk/src/modules/objects
- Timestamp:
- Jun 14, 2011, 8:53:28 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 22 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/objects/CMakeLists.txt
r7163 r8706 4 4 Planet.cc 5 5 Script.cc 6 SpaceBoundaries.cc 6 7 ) 7 8 -
code/trunk/src/modules/objects/ObjectsPrereqs.h
r8351 r8706 72 72 class Planet; 73 73 class Script; 74 class SpaceBoundaries; 74 75 75 76 // collisionshapes -
code/trunk/src/modules/objects/Script.cc
r7493 r8706 140 140 141 141 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 142 P awn* pawn= NULL;142 PlayerInfo* player = NULL; 143 143 144 144 // If the trigger is a PlayerTrigger. … … 148 148 return false; 149 149 else 150 p awn= pTrigger->getTriggeringPlayer();150 player = pTrigger->getTriggeringPlayer(); 151 151 } 152 152 else 153 153 return false; 154 154 155 if(p awn== NULL) //TODO: Will this ever happen? If not, change in NotificationDispatcher as well.155 if(player == NULL) //TODO: Will this ever happen? If not, change in NotificationDispatcher as well. 156 156 { 157 157 COUT(4) << "The Script was triggered by an entity other than a Pawn. (" << trigger->getIdentifier()->getName() << ")" << std::endl; 158 return false;159 }160 161 // Extract the PlayerInfo from the Pawn.162 PlayerInfo* player = pawn->getPlayer();163 164 if(player == NULL)165 {166 COUT(3) << "The PlayerInfo* is NULL." << std::endl;167 158 return false; 168 159 } -
code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.cc
r6417 r8706 27 27 */ 28 28 29 /** 30 @file BoxCollisionShape.cc 31 @brief Implementation of the BoxCollisionShape class. 32 */ 33 29 34 #include "BoxCollisionShape.h" 30 35 … … 39 44 CreateFactory(BoxCollisionShape); 40 45 46 /** 47 @brief 48 Constructor. Registers and initializes the object. 49 */ 41 50 BoxCollisionShape::BoxCollisionShape(BaseObject* creator) : CollisionShape(creator) 42 51 { … … 44 53 45 54 this->halfExtents_ = Vector3(1, 1, 1); 46 updateShape();55 this->updateShape(); 47 56 48 57 this->registerVariables(); … … 51 60 BoxCollisionShape::~BoxCollisionShape() 52 61 { 62 // TODO: Move to CollisionShape? 53 63 if (this->isInitialized()) 54 64 delete this->collisionShape_; … … 70 80 } 71 81 82 /** 83 @brief 84 Is called when the scale of the BoxCollisionShape has changed. 85 */ 86 void BoxCollisionShape::changedScale() 87 { 88 CollisionShape::changedScale(); 89 90 // Resize the internal collision shape 91 // TODO: Assuming setLocalScaling works. 92 // this->collisionShape_->setLocalScaling(multi_cast<btVector3>(this->getScale3D())); 93 if(!this->hasUniformScaling()) 94 { 95 CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl; 96 return; 97 } 98 99 this->setHalfExtents(this->halfExtents_ * this->getScale()); 100 } 101 102 /** 103 @brief 104 Creates a new internal collision shape for the BoxCollisionShape. 105 @return 106 Returns a pointer to the newly created btBoxShape. 107 */ 72 108 btCollisionShape* BoxCollisionShape::createNewShape() const 73 109 { -
code/trunk/src/modules/objects/collisionshapes/BoxCollisionShape.h
r7601 r8706 43 43 namespace orxonox 44 44 { 45 46 /** 47 @brief 48 Wrapper for the bullet box collision shape class btBoxShape. 49 50 @author 51 Reto Grieder 52 53 @see btBoxShape 54 @ingroup Collisionshapes 55 */ 45 56 class _ObjectsExport BoxCollisionShape : public CollisionShape 46 57 { … … 51 62 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 52 63 53 inline void setHalfExtents(const Vector3& extents) 54 { this->halfExtents_ = extents; updateShape(); } 64 /** 65 @brief Set the half extents of the BoxCollisionShape. 66 If the half extent changes, this causes the internal collision shape to be recreated. 67 @param extents A vector with the half extents. 68 The x-component is half the length, the y-component is half the height and the z-component is half the width. 69 @return Returns true if the half extent has changed, false if not. 70 */ 71 inline bool setHalfExtents(const Vector3& extents) 72 { if(this->halfExtents_ == extents) return false; this->halfExtents_ = extents; updateShape(); return true; } 73 /** 74 @brief Get the half extents of the BoxCollisionShape. 75 @return Returns a vector containing the half extents. 76 */ 55 77 inline const Vector3& getHalfExtents() const 56 78 { return halfExtents_;} 57 79 58 inline void setWidth(float value) 59 { this->halfExtents_.z = value / 2; updateShape(); } 80 /** 81 @brief Set the width of the BoxCollisionShape. 82 If the width changes, this causes the internal collision shape to be recreated. 83 @param value The width to be set. 84 @return Returns true if the width has changed, false if not. 85 */ 86 inline bool setWidth(float value) 87 { if(this->halfExtents_.z == value/2.0f) return false; this->halfExtents_.z = value / 2.0f; updateShape(); return true; } 88 /** 89 @brief Get the width of the BoxCollisionShape. 90 @return Returns the width of the BoxCollisionShape. 91 */ 60 92 inline float getWidth() const 61 { return this->halfExtents_.z * 2 ; }93 { return this->halfExtents_.z * 2.0f; } 62 94 63 inline void setHeight(float value) 64 { this->halfExtents_.y = value / 2; updateShape(); } 95 /** 96 @brief Set the height of the BoxCollisionShape. 97 If the height changes, this causes the internal collision shape to be recreated. 98 @param value The height to be set. 99 @return Returns true if the height has changed, false if not. 100 */ 101 inline bool setHeight(float value) 102 { if(this->halfExtents_.y == value/2.0f) return false; this->halfExtents_.y = value / 2.0f; updateShape(); return true; } 103 /** 104 @brief Get the height of the BoxCollisionShape. 105 @return Returns the height of the BoxCollisionShape. 106 */ 65 107 inline float getHeight() const 66 { return this->halfExtents_.y * 2 ; }108 { return this->halfExtents_.y * 2.0f; } 67 109 68 inline void setLength(float value) 69 { this->halfExtents_.x = value / 2; updateShape(); } 110 /** 111 @brief Set the length of the BoxCollisionShape. 112 If the length changes, this causes the internal collision shape to be recreated. 113 @param value The length to be set. 114 @return Returns true if the length has changed, false if not. 115 */ 116 inline bool setLength(float value) 117 { if(this->halfExtents_.x == value/2.0f) return false; this->halfExtents_.x = value / 2.0f; updateShape(); return true; } 118 /** 119 @brief Get the length of the BoxCollisionShape. 120 @return Returns the length of the BoxCollisionShape. 121 */ 70 122 inline float getLength() const 71 { return this->halfExtents_.x * 2; } 123 { return this->halfExtents_.x * 2.0f; } 124 125 virtual void changedScale(); // Is called when the scale of the BoxCollisionShape has changed. 72 126 73 127 private: 74 128 void registerVariables(); 75 129 76 btCollisionShape* createNewShape() const; 130 btCollisionShape* createNewShape() const; // Creates a new internal collision shape for the BoxCollisionShape. 77 131 78 Vector3 halfExtents_; 132 Vector3 halfExtents_; //!< The half extents of the BoxCollisionShape. The x-component is half the length, the y-component is half the height and the z-component is half the width. 79 133 }; 80 134 } -
code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.cc
r6417 r8706 27 27 */ 28 28 29 /** 30 @file ConeCollisionShape.cc 31 @brief Implementation of the ConeCollisionShape class. 32 */ 33 29 34 #include "ConeCollisionShape.h" 30 35 … … 33 38 #include "core/CoreIncludes.h" 34 39 #include "core/XMLPort.h" 40 #include "tools/BulletConversions.h" 35 41 36 42 namespace orxonox … … 38 44 CreateFactory(ConeCollisionShape); 39 45 46 /** 47 @brief 48 Constructor. Registers and initializes the object. 49 */ 40 50 ConeCollisionShape::ConeCollisionShape(BaseObject* creator) : CollisionShape(creator) 41 51 { … … 69 79 } 70 80 81 /** 82 @brief 83 Is called when the scale of the ConeCollisionShape has changed. 84 */ 85 void ConeCollisionShape::changedScale() 86 { 87 CollisionShape::changedScale(); 88 89 // Resize the internal collision shape 90 // TODO: Assuming setLocalScaling works. 91 //this->collisionShape_->setLocalScaling(multi_cast<btVector3>(this->getScale3D())); 92 if(!this->hasUniformScaling()) 93 { 94 CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl; 95 return; 96 } 97 98 this->radius_ *= this->getScale(); 99 this->height_ *= this->getScale(); 100 this->updateShape(); 101 } 102 103 /** 104 @brief 105 Creates a new internal collision shape for the ConeCollisionShape. 106 @return 107 Returns a pointer to the newly created btConeShape. 108 */ 71 109 btCollisionShape* ConeCollisionShape::createNewShape() const 72 110 { -
code/trunk/src/modules/objects/collisionshapes/ConeCollisionShape.h
r7601 r8706 41 41 namespace orxonox 42 42 { 43 44 /** 45 @brief 46 Wrapper for the bullet cone collision shape class btConeShape. 47 48 @author 49 Reto Grieder 50 51 @see btConeShape 52 @ingroup Collisionshapes 53 */ 43 54 class _ObjectsExport ConeCollisionShape : public CollisionShape 44 55 { … … 49 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 61 51 inline void setRadius(float value) 52 { this->radius_ = value; updateShape(); } 62 /** 63 @brief Set the radius of the ConeCollisionShape. 64 If the radius changes, this causes the internal collision shape to be recreated. 65 @param value The radius to be set. 66 @return Returns true if the radius has changed, false if not. 67 */ 68 inline bool setRadius(float value) 69 { if(this->radius_ == value) return false; this->radius_ = value; updateShape(); return true; } 70 /** 71 @brief Get the radius of the ConeCollisionShape. 72 @return Returns the radius of the ConeCollisionShape. 73 */ 53 74 inline float getRadius() const 54 75 { return radius_; } 55 76 56 inline void setHeight(float value) 57 { this->height_ = value; updateShape(); } 77 /** 78 @brief Set the height of the ConeCollisionShape. 79 If the height changes, this causes the internal collision shape to be recreated. 80 @param value The height to be set. 81 @return Returns true if the height has changed, false if not. 82 */ 83 inline bool setHeight(float value) 84 { if(this->height_ == value) return false; this->height_ = value; updateShape(); return true; } 85 /** 86 @brief Get the height of the ConeCollisionShape. 87 @return Returns the height of the ConeCollisionShape. 88 */ 58 89 inline float getHeight() const 59 90 { return this->height_; } 91 92 virtual void changedScale(); // Is called when the scale of the ConeCollisionShape has changed. 60 93 61 94 private: 62 95 void registerVariables(); 63 96 64 btCollisionShape* createNewShape() const; 97 btCollisionShape* createNewShape() const; // Creates a new internal collision shape for the ConeCollisionShape. 65 98 66 float radius_; 67 float height_; 99 float radius_; //!< The radius of the ConeCollisionShape. 100 float height_; //!< The height of the ConeCollisionShape. 68 101 }; 69 102 } -
code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.cc
r6417 r8706 27 27 */ 28 28 29 /** 30 @file PlaneCollisionShape.cc 31 @brief Implementation of the PlaneCollisionShape class. 32 */ 33 29 34 #include "PlaneCollisionShape.h" 30 35 … … 39 44 CreateFactory(PlaneCollisionShape); 40 45 46 /** 47 @brief 48 Constructor. Registers and initializes the object. 49 */ 41 50 PlaneCollisionShape::PlaneCollisionShape(BaseObject* creator) : CollisionShape(creator) 42 51 { … … 70 79 } 71 80 81 /** 82 @brief 83 Is called when the scale of the PlaneCollisionShape has changed. 84 */ 85 void PlaneCollisionShape::changedScale() 86 { 87 CollisionShape::changedScale(); 88 89 // Resize the internal collision shape 90 // TODO: Assuming setLocalScaling works. 91 //this->collisionShape_->setLocalScaling(multi_cast<btVector3>(this->getScale3D())); 92 if(!this->hasUniformScaling()) 93 { 94 CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl; 95 return; 96 } 97 98 this->setOffset(this->offset_*this->getScale()); 99 } 100 101 /** 102 @brief 103 Creates a new internal collision shape for the PlaneCollisionShape. 104 @return 105 Returns a pointer to the newly created btStaticPlaneShape. 106 */ 72 107 btCollisionShape* PlaneCollisionShape::createNewShape() const 73 108 { -
code/trunk/src/modules/objects/collisionshapes/PlaneCollisionShape.h
r7601 r8706 43 43 namespace orxonox 44 44 { 45 46 /** 47 @brief 48 Wrapper for the bullet plane collision shape class btStaticPlaneShape. 49 50 @author 51 Martin Stypinski 52 53 @see btStaticPlaneShape 54 @ingroup Collisionshapes 55 */ 45 56 class _ObjectsExport PlaneCollisionShape : public CollisionShape 46 57 { … … 51 62 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 52 63 53 inline void setNormal(const Vector3& normal) 54 { this->normal_ = normal; updateShape(); } 55 inline const Vector3& getNormal() 64 /** 65 @brief Set the normal of the PlaneCollisionShape. 66 If the normal changes, this causes the internal collision shape to be recreated. 67 @param normal The normal vector to be set. 68 @return Returns true if the normal has changed, false if not. 69 */ 70 inline bool setNormal(const Vector3& normal) 71 { if(this->normal_ == normal) return false; this->normal_ = normal; updateShape(); return true; } 72 /** 73 @brief Get the normal of the PlaneCollisionShape. 74 @return Returns the normal vector of the PlaneCollisionShape. 75 */ 76 inline const Vector3& getNormal() const 56 77 { return normal_;} 57 78 58 inline void setOffset(float offset) 59 { this->offset_ = offset; updateShape(); } 60 inline float getOffset() 79 /** 80 @brief Set the offset of the PlaneCollisionShape. 81 If the offset changes, this causes the internal collision shape to be recreated. 82 @param offset The offset to be set. 83 @return Returns true if the offset has changed, false if not. 84 */ 85 inline bool setOffset(float offset) 86 { if(this->offset_ == offset) return false; this->offset_ = offset; updateShape(); return true; } 87 /** 88 @brief Get the offset of the PlaneCollisionShape. 89 @return Returns the offset of the PlaneCollisionShape. 90 */ 91 inline float getOffset() const 61 92 { return this->offset_;} 93 94 virtual void changedScale(); // Is called when the scale of the PlaneCollisionShape has changed. 62 95 63 96 private: 64 97 void registerVariables(); 65 98 66 btCollisionShape* createNewShape() const;99 btCollisionShape* createNewShape() const; // Creates a new internal collision shape for the PlaneCollisionShape. 67 100 68 Vector3 normal_; 69 float offset_; 101 Vector3 normal_; //!< The normal vector of the PlaneCollisionShape. 102 float offset_; //!< The offset of the PlaneCollisionShape. 70 103 }; 71 104 } -
code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.cc
r5781 r8706 27 27 */ 28 28 29 /** 30 @file SphereCollisionShape.cc 31 @brief Implementation of the SphereCollisionShape class. 32 */ 33 29 34 #include "SphereCollisionShape.h" 30 35 … … 33 38 #include "core/CoreIncludes.h" 34 39 #include "core/XMLPort.h" 40 #include "tools/BulletConversions.h" 35 41 36 42 namespace orxonox … … 38 44 CreateFactory(SphereCollisionShape); 39 45 46 /** 47 @brief 48 Constructor. registers and initializes the object. 49 */ 40 50 SphereCollisionShape::SphereCollisionShape(BaseObject* creator) : CollisionShape(creator) 41 51 { … … 66 76 } 67 77 78 /** 79 @brief 80 Is called when the scale of the SphereCollisionShape has changed. 81 */ 82 void SphereCollisionShape::changedScale() 83 { 84 CollisionShape::changedScale(); 85 86 // Resize the internal collision shape 87 // TODO: Assuming setLocalScaling works. 88 //this->collisionShape_->setLocalScaling(multi_cast<btVector3>(this->getScale3D())); 89 if(!this->hasUniformScaling()) 90 { 91 CCOUT(1) << "Error: Non-uniform scaling is not yet supported." << endl; 92 return; 93 } 94 95 this->setRadius(this->radius_*this->getScale()); 96 } 97 98 /** 99 @brief 100 Creates a new internal collision shape for the SphereCollisionShape. 101 @return 102 Returns a pointer to the newly created btSphereShape. 103 */ 68 104 btCollisionShape* SphereCollisionShape::createNewShape() const 69 105 { -
code/trunk/src/modules/objects/collisionshapes/SphereCollisionShape.h
r7601 r8706 41 41 namespace orxonox 42 42 { 43 44 /** 45 @brief 46 Wrapper for the bullet sphere collision shape class btSphereShape. 47 48 @author 49 Reto Grieder 50 51 @see btSphereShape 52 @ingroup Collisionshapes 53 */ 43 54 class _ObjectsExport SphereCollisionShape : public CollisionShape 44 55 { … … 49 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 61 51 inline void setRadius(float radius) 52 { this->radius_ = radius; updateShape(); } 62 /** 63 @brief Set the radius of the SphereCollisionShape. 64 If the radius changes, this causes the internal collision shape to be recreated. 65 @param radius The radius to be set. 66 @return Returns true if the radius has changed, false if not. 67 */ 68 inline bool setRadius(float radius) 69 { if(this->radius_ == radius) return false; this->radius_ = radius; updateShape(); return true; } 70 /** 71 @brief Get the radius of the SphereCollisionShape. 72 @return Returns the radius of the SphereCollisionShape. 73 */ 53 74 inline float getRadius() const 54 75 { return this->radius_; } 76 77 virtual void changedScale(); // Is called when the scale of the SphereCollisionShape has changed. 55 78 56 79 private: … … 59 82 btCollisionShape* createNewShape() const; 60 83 61 float radius_; 84 float radius_; //!< The radius of the SphereCollisionShape. 62 85 }; 63 86 } -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.cc
r8213 r8706 53 53 Default Constructor. Registers the object and initializes default values. 54 54 */ 55 DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator) , beaconMask_(NULL)55 DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator) 56 56 { 57 57 RegisterObject(DistanceMultiTrigger); … … 60 60 this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::off); 61 61 this->targetName_ = ""; 62 this->beaconMask_.exclude(Class(BaseObject)); 63 this->beaconMask_.include(Class(DistanceTriggerBeacon)); 62 64 } 63 65 … … 68 70 DistanceMultiTrigger::~DistanceMultiTrigger() 69 71 { 70 if(this->beaconMask_ != NULL) 71 delete this->beaconMask_; 72 72 73 } 73 74 … … 135 136 // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons. 136 137 if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify) 137 targetMask = *this->beaconMask_;138 targetMask = this->beaconMask_; 138 139 139 140 // Iterate through all objects that are targets of the DistanceMultiTrigger. … … 207 208 { 208 209 this->beaconMode_ = mode; 209 if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify && this->beaconMask_ == NULL)210 {211 this->beaconMask_ = new ClassTreeMask();212 this->beaconMask_->exclude(Class(BaseObject));213 this->beaconMask_->include(Class(DistanceTriggerBeacon));214 }215 210 } 216 211 -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
r8213 r8706 152 152 distanceMultiTriggerBeaconMode::Value beaconMode_; //!< The beacon mode, the DistanceMultiTrigger is in. 153 153 std::string targetName_; //!< The target name, used in <em>single-target</em> mode. 154 ClassTreeMask *beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.154 ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons. 155 155 156 156 std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger. -
code/trunk/src/modules/objects/triggers/DistanceTrigger.cc
r8213 r8706 57 57 The creator of this trigger. 58 58 */ 59 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator) , beaconMask_(NULL)59 DistanceTrigger::DistanceTrigger(BaseObject* creator) : Trigger(creator) 60 60 { 61 61 RegisterObject(DistanceTrigger); … … 64 64 this->targetMask_.exclude(Class(BaseObject)); 65 65 this->targetName_ = ""; 66 this->beaconMask_.exclude(Class(BaseObject)); 67 this->beaconMask_.include(Class(DistanceTriggerBeacon)); 66 68 } 67 69 … … 72 74 DistanceTrigger::~DistanceTrigger() 73 75 { 74 // Delete the beacon mask if it exists. 75 if(this->beaconMask_ != NULL) 76 delete this->beaconMask_; 76 77 77 } 78 78 … … 159 159 // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons. 160 160 if(this->beaconMode_ == distanceTriggerBeaconMode::identify) 161 targetMask = *this->beaconMask_;161 targetMask = this->beaconMask_; 162 162 163 163 // Iterate through all objects that are targets of the DistanceTrigger. … … 205 205 entity = entity->getParent(); 206 206 207 Pawn* player = orxonox_cast<Pawn*>(entity); 208 this->setTriggeringPlayer(player); 207 Pawn* pawn = orxonox_cast<Pawn*>(entity); 208 if(pawn != NULL) 209 this->setTriggeringPawn(pawn); 210 else 211 CCOUT(2) << "Pawn was NULL." << endl; 209 212 } 210 213 … … 228 231 { 229 232 this->beaconMode_ = mode; 230 if(this->beaconMode_ == distanceTriggerBeaconMode::identify && this->beaconMask_ == NULL)231 {232 this->beaconMask_ = new ClassTreeMask();233 this->beaconMask_->exclude(Class(BaseObject));234 this->beaconMask_->include(Class(DistanceTriggerBeacon));235 }236 233 } 237 234 … … 280 277 Check whether the DistanceTrigger is triggered. 281 278 It is triggered if it is triggered according only to its mode (i.e. its sub-triggers) and if a target is in range. 282 @param 279 @param mode 280 The mode for which it is tested, whether the DistanceTrigger is triggered. 281 @return 283 282 Returns true if it is triggered ,false if not. 284 283 */ -
code/trunk/src/modules/objects/triggers/DistanceTrigger.h
r8213 r8706 71 71 - @b target Which specifies the class of objects that can trigger the DistanceTrigger. Default is <code>"Pawn"</code>. 72 72 - @b beaconMode Which specifies, whether the DistanceTrigger operates on @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacons" or not. If <em>off</em> the DistanceMultiTrigger works as usual. If set to <em>identify</em> the DistanceTrigger is only triggered by objects that have a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon", with the same name as specified in <em>targetname</em>, attached to them. If set to <em>exclude</em> the DistanceTrigger is only triggered by objects that don't have a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon", with the same name as specified in <em>targetname</em>, attached to them. Default is <em>off</em>. 73 - @b targetname Which specifies the name @ref or oxnox::DistanceTriggerBeacon "DistanceTriggerBeacons" need to have to make the DistanceTrigger react to them if it is in <em>beacon-mode</em> (the beaconMode is not <em>off</em>).73 - @b targetname Which specifies the name @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacons" need to have to make the DistanceTrigger react to them if it is in <em>beacon-mode</em> (the beaconMode is not <em>off</em>). 74 74 75 75 A simple DistanceTrigger could look like this: … … 162 162 distanceTriggerBeaconMode::Value beaconMode_; //!< The beacon mode. 163 163 std::string targetName_; //!< The name a DistanceTriggerBeacon needs to have to make the DistanceTrigger react to it if in beacon-mode. 164 ClassTreeMask *beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.164 ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons. 165 165 166 166 WeakPtr<WorldEntity> cache_; //!< Caches the entity that triggered the DistanceTrigger last. -
code/trunk/src/modules/objects/triggers/EventTrigger.h
r8213 r8706 60 60 61 61 @see Trigger 62 For more information on @ref or oxnox::Trigger "Triggers".62 For more information on @ref orxonox::Trigger "Triggers". 63 63 64 64 @author -
code/trunk/src/modules/objects/triggers/MultiTrigger.cc
r8213 r8706 63 63 this->bMultiTrigger_ = true; 64 64 65 this->setSyncMode( 0x0);65 this->setSyncMode(ObjectDirection::None); 66 66 } 67 67 … … 198 198 if(bActive ^ this->isActive(state->originator)) 199 199 { 200 201 200 bool bFire = true; 202 201 … … 312 311 313 312 // We only want WorldEntities 314 //TODO: Really?315 313 ClassTreeMask WEMask; 316 314 WEMask.include(Class(WorldEntity)); -
code/trunk/src/modules/objects/triggers/MultiTriggerContainer.cc
r7601 r8706 73 73 { 74 74 this->setForPlayer(true); 75 this->setTriggeringP layer(pawn);75 this->setTriggeringPawn(pawn); 76 76 } 77 77 } -
code/trunk/src/modules/objects/triggers/Trigger.cc
r8213 r8706 76 76 } 77 77 78 this->setSyncMode( 0x0);78 this->setSyncMode(ObjectDirection::None); 79 79 } 80 80 -
code/trunk/src/modules/objects/triggers/TriggerBase.cc
r7652 r8706 71 71 this->bMultiTrigger_ = false; 72 72 73 this->setSyncMode( 0x0);73 this->setSyncMode(ObjectDirection::None); 74 74 } 75 75 -
code/trunk/src/modules/objects/triggers/TriggerBase.h
r8213 r8706 133 133 inline int getActivations(void) const 134 134 { return this->remainingActivations_; } 135 /** 136 @brief Check whether the trigger has still at least one remaining activation. 137 @return Returns true if the trigger has remaining activations (i.e. the number of remaining activations is not zero). 138 */ 139 inline bool hasRemainingActivations(void) const 140 { return this->remainingActivations_ > 0 || this->remainingActivations_ == INF_s; } 135 141 136 142 /**
Note: See TracChangeset
for help on using the changeset viewer.