Gorilla.Controller.Input.TriggerPoint
Unit Gorilla.Controller.Input.TriggerPoint.pasClasses
- TGorillaTriggerPoint = class ( TCollectionItem )
- TGorillaTriggerPointCollection = class ( TOwnedCollection )
- TGorillaTriggerPointManager = class ( TComponent )
Enumerations
- enum TGorillaTriggerPointKind = ( StaticTriggerPoint, DynamicTriggerPoint ) ;
Constants
TGorillaTriggerPointKind
Defines which kind of trigger point handling should be used. Static trigger points are 3D world coordinates not moving / standing still. For points changing, f.e. with the position of a character, you can use dynamic trigger points.
TGorillaTriggerPoint
The trigger point class defines a global/absolut point in 3D space, which is tracable. In combination with a first person controller those points can trigger event to interact with.
Ancestors
Members
Fields
- protected FName :
string
- protected FEnabled :
Boolean
- protected FKind :
TGorillaTriggerPointKind
- protected FLookInDirection :
Boolean
- protected FControl :
TControl3D
- protected FPosition :
TPosition3D
- protected FTolerance :
Single
- protected FDistance :
Single
- protected FData :
TValue
- protected FTag :
Integer
- protected FOnTriggered :
TGorillaOnTriggeredPointEvent
- protected FOnUnTriggered :
TGorillaOnTriggeredPointEvent
Methods
- public constructor Create ( ACollection : TCollection ) ;
- public destructor Destroy ( ) ;
- protected function GetDisplayName ( ) : string ; override;
- protected procedure SetDisplayName ( const AValue : string ) ; override;
- protected function GetPosition ( ) : TPosition3D ; virtual;
- protected procedure SetPosition ( const AValue : TPosition3D ) ; virtual;
- protected procedure SetTolerance ( const AValue : Single ) ; virtual;
- protected procedure SetDistance ( const AValue : Single ) ; virtual;
- public procedure AfterConstruction ( ) ; override;
- public procedure Assign ( Source : TPersistent ) ; override;
- public procedure Notification ( AComponent : TComponent; Operation : TOperation ) ;
- public function IsLookingTowards
(
const
AViewPos :
TPoint3D; const
AViewDir :
TPoint3D; out
ADistance :
Single
)
: Boolean
;
virtual;
Performs a test on the trigger point depending on the supplied position, direction and maximum distance. The function returns true, if the specific trigger points is triggerable and false if not. The computed distance between the point position and the supplied position will be returns in the ADistance output parameter.
Properties
- public Data : TValue
- published DisplayName : string
- published Enabled : Boolean
- published Kind : TGorillaTriggerPointKind
- published LookInDirection : Boolean
Define if point getting triggered only if camera is looking in direction. If LookInDirection is false, the point will be triggered if position is nearby.
read FLookInDirection
write FLookInDirection - published Control : TControl3D
- published Position : TPosition3D
The absolute (global/world) 3D coordinate for the point when static trigger point kind is set. In case dynamic trigger point type is set, the position is handled as offset to the current linked TControl3D component.
read GetPosition
write SetPosition - published Tolerance : Single
The tolerance value defines the allowed offset between view-direction point and trigger point position.
read FTolerance
write SetTolerance - published Distance : Single
- published Tag : Integer
TGorillaTriggerPointCollection
Defining a collection of triggerable points. All items will be of TGorillaTriggerPoint class.
Ancestors
Members
TGorillaTriggerPointManager
The trigger point manager allows to manage trigger points and to check for those.
Ancestors
Members
Fields
- protected FEnabled :
Boolean
- protected FItems :
TGorillaTriggerPointCollection
- protected FRelatedControl :
TControl3D
- protected FLastTriggerPoint :
TGorillaTriggerPoint
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetItems ( const AValue : TGorillaTriggerPointCollection ) ; virtual;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- public procedure AfterConstruction ( ) ; override;
- public function AddTriggerPoint
(
AName :
string; APos :
TPoint3D; ATolerance :
Single; ADistance :
Single
)
: TGorillaTriggerPoint
;
overload virtual;
Adds a new static trigger point with a name, 3D coordinate and sensitivity radius.
- public function AddTriggerPoint
(
AName :
string; ACtrl :
TControl3D; AOfs :
TPoint3D; ATolerance :
Single; ADistance :
Single
)
: TGorillaTriggerPoint
;
overload virtual;
Adds a new dynamic trigger point with a name, a linked control, 3D coordinate and sensitivity radius.
- public procedure RemoveTriggerPoint
(
AName :
string
)
;
virtual;
Removes an existing
- public procedure ClearTriggerPoints
(
)
;
virtual;
Removes all registered trigger points.
- public function ClosestTriggerPoint
(
const
AViewPos :
TPoint3D; const
AViewDir :
TPoint3D; out
APoint :
TGorillaTriggerPoint; out
ADistance :
Single
)
: Boolean
;
virtual;
Tries to find the closest trigger point to the current position, the camera/view direction and a maximum distance between point and position. If no suitable point can be found, the function returns false.
Properties
- published Enabled : Boolean
- published Items : TGorillaTriggerPointCollection
- published RelatedControl : TControl3D
Optional related control to check distance to. If this property is not set, a character controller uses the camera by default.
read FRelatedControl
write FRelatedControl