Differences

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

Link to this comparison view

Next revision
Previous revision
0.8.4:charactercontrolling [2022/05/03 12:20] – external edit 127.0.0.10.8.4:charactercontrolling [2022/06/21 21:38] (current) – [Audio Manager Controller] admin
Line 15: Line 15:
 ===== Hotkeys ===== ===== Hotkeys =====
  
-Because we've link an input controller to the character controller, we have to define hotkeys to react on.+Because we've linked an input controller to the character controller, we have to define hotkeys to react on. 
 In short this means: if the input controller detects a hotkey, it will forward the event to the character controller. In short this means: if the input controller detects a hotkey, it will forward the event to the character controller.
-And then the character controller will react on the hotkey event by a specific operation, like moving forwared or shooting.+And then the character controller will react on the hotkey event by a specific operation, like moving forward or shooting.
  
 By default the character controllery already defines standardized hotkeys, like W-A-S-D for movement. By default the character controllery already defines standardized hotkeys, like W-A-S-D for movement.
Line 77: Line 78:
  
 For individual treatment you can disable or overwrite those predefined hotkeys. For individual treatment you can disable or overwrite those predefined hotkeys.
-The basis character controller component catches all input events, handles them and throws back user-friendly events.+The basic character controller component catches all input events, handles them and throws back user-friendly events.
  
 ^Event ^Description^ ^Event ^Description^
Line 193: 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 =====