Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
0.8.4:charactercontrolling [2022/06/21 21:29] – [User-Friendly Events] admin0.8.4:charactercontrolling [2022/06/21 21:38] (current) – [Audio Manager Controller] admin
Line 194: Line 194:
  
 It's usual to handle different things during character controlling. So you'd like to check for special positions in 3D space and execute actions when getting triggered. Or you like to playback sounds on specific states or refer to a sound-map. It's usual to handle different things during character controlling. So you'd like to check for special positions in 3D space and execute actions when getting triggered. Or you like to playback sounds on specific states or refer to a sound-map.
-Therefore you're able to link out TGorillaTriggerPointManager or the TGorillaAudioManagerController. 
-==== TriggerPoints Management ==== 
  
-TriggerPoints are 3D positions in your 3D world space. Those can be static or dynamic (moving). For example you have another character you want to talk to. You can set up dynamic trigger point for the model and the system will automatically check when it's getting close enough. +The following components are allowed to link to a character controller: 
-In a triggerpoint specific event you can react on that feedback and start the conversation ([[Dialogues|Dialogues]]).+  * [[triggerpoints|TGorillaTriggerPointManager]] 
 +  * [[audiomanagercontroller|TGorillaAudioManagerController]] 
 +  * [[animationcontroller|TGorillaAnimationController]]
  
-<file pascal> 
  
-procedure TGameWindow.DoOnWheelTriggered(ASender : TGorillaTriggerPointManager; 
-  const APos, AViewDir : TPoint3D; const APoint : TGorillaTriggerPoint; 
-  const ADistance : Single); 
-begin 
-  FMX.Types.Log.D('wheel triggered'); 
-end; 
- 
-procedure TGameWindow.DoOnWheelUnTriggered(ASender : TGorillaTriggerPointManager; 
-  const APos, AViewDir : TPoint3D; const APoint : TGorillaTriggerPoint; 
-  const ADistance : Single); 
-begin 
-  FMX.Types.Log.D('wheel untriggered'); 
-end; 
- 
-  [...] 
- 
- 
-FTriggerPoints := TGorillaTriggerPointManager.Create(Self); 
-// we don't want to check against camera, but againts the character model 
-FTriggerPoints.RelatedControl := FCharacter; 
-FTriggerPoints.Enabled := true; 
- 
-// creata a single trigger point at runtime 
-LTP := FTriggerPoints.AddTriggerPoint('Wheel1', Point3D(-10, 0, 10), 0.25, 30); 
-LTP.LookInDirection := false; // trigger only if character is nearby 
-LTP.Kind := TGorillaTriggerPointKind.StaticTriggerPoint; 
-LTP.Data := TValue.From<String>('Press [E] to rotate wheel #1'); 
-LTP.Tag  := 1; 
-LTP.OnTriggered := DoOnWheelTriggered; 
-LTP.OnUnTriggered := DoOnWheelUnTriggered; 
-</file> 
-==== Audio Manager Controller ==== 
- 
-The audio manager controller is an exchange layer between your character controller and an audio manager. 
-You can playback sounds automatically, without any programming, by a configured hotkey map or a soundmap. 
- 
-The following example showing how to setup an audio manager controller at runtime. Here we show the usage of  
-an input stated handling by keyboard input. 
- 
-<file pascal> 
-FAudioCtrl := TGorillaAudioManagerController.Create(Self); 
-FAudioCtrl.AudioManager := Self.FAudioManager; 
-FAudioCtrl.AddHotKeyMapping('RUN_FORWARD',  SOUND_RUN, 
-  TGorillaCharacterControllerHotKey.KeyboardMoveForward, [fpMoving,fpBoost]); 
-FAudioCtrl.AddHotKeyMapping('RUN_BACKWARD', SOUND_RUN, 
-  TGorillaCharacterControllerHotKey.KeyboardMoveBackward, [fpMoving,fpBoost]); 
-FAudioCtrl.AddHotKeyMapping('WALK_FORWARD',  SOUND_WALK, 
-  TGorillaCharacterControllerHotKey.KeyboardMoveForward, [fpMoving]); 
-FAudioCtrl.AddHotKeyMapping('WALK_BACKWARD', SOUND_WALK, 
-  TGorillaCharacterControllerHotKey.KeyboardMoveBackward, [fpMoving]); 
-</file> 
 ===== Physics Character Controller ===== ===== Physics Character Controller =====