- Timestamp:
- Oct 30, 2010, 1:54:49 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
r7301 r7601 30 30 @file DistanceMultiTrigger.h 31 31 @brief Definition of the DistanceMultiTrigger class. 32 @ingroup MultiTrigger 32 33 */ 33 34 … … 37 38 #include "objects/ObjectsPrereqs.h" 38 39 40 #include <map> 41 42 #include "core/WeakPtr.h" 43 39 44 #include "worldentities/WorldEntity.h" 40 #include "core/WeakPtr.h"41 #include <map>42 45 43 46 #include "MultiTrigger.h" … … 48 51 /** 49 52 @brief 50 The DistanceMultiTrigger is a trigger that triggers whenever an object (that is of the specified target type) is in a specified range of the DistanceMultiTrigger. The object can be specified further by adding a DistanceTriggerBeacon (just attaching it) to the objects that can trigger this DistanceMultiTrigger and specify the name of the DistanceTriggerBeacon with the parameter targetname and only objects that have a DistanceTriggerBeacon with that name attachedwill trigger the DistanceMultiTrigger.53 The DistanceMultiTrigger is a MultiTrigger that triggers whenever an object (that is of the specified target type) is in a specified range of the DistanceMultiTrigger. The object can be specified further by adding a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" (by just attaching it) to the objects that can trigger this DistanceMultiTrigger and specify the name of the @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" with the parameter <em>targetname</em> and only objects that have a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" with that name will trigger the DistanceMultiTrigger. 51 54 Parameters are (additional to the ones of MultiTrigger): 52 'distance', which specifies the maximum distance at which the DistanceMultiTrigger still triggers. Default is 100.53 'targetname', which, if not left blank, causes the DistancMultiTrigger to be in single-target mode, meaning, that it only reacts to objects that have a DistanceTriggerBeacon (therefore the target has to be set to DistanceTriggerBeacon for it to work), with the name specified by targetname, attached.55 - @b distance Which specifies the maximum distance at which the DistanceMultiTrigger still triggers. Default is 100. 56 - @b targetname Which, if not left blank, causes the DistancMultiTrigger to be in <em>single-target</em> mode, meaning, that it only reacts to objects that have a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" (therefore the target has to be set to @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" for it to work), with the name specified by <em>targetname</em>, attached. 54 57 55 58 A simple DistanceMultiTrigger would look like this: … … 58 61 @endcode 59 62 60 An implementation that only reacts to objects with a DistanceTriggerBeaconattached would look like this:63 An implementation that only reacts to objects with a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" attached would look like this: 61 64 @code 62 65 <DistanceMultiTrigger position="0,0,0" target="DistanceMultiTrigger" targetname="beacon1" distance="30" /> 63 66 @endcode 64 This particular DistanceMultiTrigger would only react if an object was in range, that had a DistanceTriggerBeacon with the name 'beacon1' attached. 65 @see MultiTrigger.h 67 This particular DistanceMultiTrigger would only react if an object was in range, that had a @ref orxonox::DistanceTriggerBeacon "DistanceTriggerBeacon" with the name <em>beacon1</em> attached. 68 69 @see MultiTrigger 66 70 For more information on MultiTriggers. 71 67 72 @author 68 73 Damian 'Mozork' Frick 74 75 @ingroup MultiTrigger 69 76 */ 70 77 class _ObjectsExport DistanceMultiTrigger : public MultiTrigger … … 106 113 private: 107 114 float distance_; //!< The distance at which the DistanceMultiTrigger triggers. 108 std::string targetName_; //!< The target name, used in singleTargetMode.109 bool singleTargetMode_; //!< To indicate whe the MultiDistanceTrigger is in single-target-mode.115 std::string targetName_; //!< The target name, used in <em>single-target</em> mode. 116 bool singleTargetMode_; //!< To indicate whe the MultiDistanceTrigger is in <em>single-target</em> mode. 110 117 111 118 std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger.
Note: See TracChangeset
for help on using the changeset viewer.