-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsharp_component_samples.sample
More file actions
1897 lines (1897 loc) · 117 KB
/
Copy pathcsharp_component_samples.sample
File metadata and controls
1897 lines (1897 loc) · 117 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version='1.0' encoding='UTF-8'?>
<meta>
<samples_pack name="csharp_component_samples">
<title>C# Component Samples</title>
<version>2.21.0.1</version>
<dependency>2.21.0.1</dependency>
<os>cross</os><workflow>editor2</workflow>
<precision>double</precision>
<path>data</path>
<command>world_load csharp_component_samples</command>
<custom_app>csharp_component_samples</custom_app>
<run_workflow>dotnet</run_workflow>
<bin_type>development</bin_type>
<api>csdnc</api>
<plugins>FMOD</plugins>
<description>
<![CDATA[
<p>A set of samples showcasing the use of engine features via C# components for various use cases.</p>
<p>Programming is easy: application logic is implemented in components, that can be assigned to any nodes in the virtual world to extend their functionality.</p>
<p>To launch this samples, you should perform the following actions:
<ul>
<li>Install one of the following IDEs to work with the source code:
<ul>
<li><b><a href="https://code.visualstudio.com/download">Visual Studio Code</a></b>, recommended (C# extension is required)</li>
<li><b>Visual Studio 2022</b></li>
</ul>
</li>
<li>Download and install <a href="https://dotnet.microsoft.com/en-us/download/dotnet/8.0">.NET Core 8.0</a><br/>If you're using Visual Studio, choose the appropriate .NET Core version:
<ul>
<li>
<a href="https://dotnet.microsoft.com/en-us/download/dotnet/8.0">v8.0.107</a> for Visual Studio 2022
</li>
</ul>
</li>
<li>Click <b>Copy as Project</b> under this Demo.</li>
<li>Click <b>Open Editor</b> for the project to run it in the Editor.</li>
<li>Run the project via the <b>Play</b> button on the Editor's toolbar.</li>
</ul>
</p>
]]>
</description>
<features>
<![CDATA[
<p>
<ul>
<li><b>Animation</b> - blending and lerping animations, applying partial blending of bones, rotating bones via code, controlling animation playback</li>
<li><b>Arcade Sample</b> - simple but frequently used arcade mechanics: controls, shooting and intersection of bullets with surfaces, node spawning, transformations, and deletion</li>
<li><b>Cameras</b> - creating and controlling various cameras: first-person-view, orbital, panning, and persecutor camera</li>
<li><b>CharacterController</b> - first-person character controller implementation</li>
<li><b>Components</b> - all available types of component parameters</li>
<li><b>Create Nodes</b> - creating and deleting nodes via code</li>
<li><b>Input</b> - enabling input from various devices (keyboard, gamepad, joystick, etc.)</li>
<li><b>Materials</b> - changing material parameters at run time</li>
<li><b>Navigation</b> - 2D and 3D pathfinding and navigation (navigation meshes, obstacles, sectors)</li>
<li><b>Sounds</b> - adding and controlling various sounds</li>
<li><b>Tracker</b> - using Tracker functionality to animate objects (change their position, rotation, and scale) via tracks created in the Tracker tool.</li>
<li><b>Transformation</b> - object transformations: rotation via Euler angles, local and world transforms</li>
<li><b>Widgets</b> - using widgets and containers to create a custom GUI</li>
<li><b>World Intersection</b> - detecting intersections between bounds and nodes, between rays and geometry</li>
</ul>
</p>
]]>
</features>
<products>
<product>tier3_bin_windows</product>
<product>tier3_bin_channel</product>
<product>tier3_bin_channel_windows</product>
<product>tier3_bin_channel_linux</product>
<product>tier3_src_windows</product>
<product>tier3_bin_linux</product>
<product>tier3_src_linux</product>
<product>tier3_evaluation</product>
<product>tier2_bin_windows</product>
<product>tier2_src_windows</product>
<product>tier2_bin_linux</product>
<product>tier2_src_linux</product>
<product>tier2_evaluation</product>
<product>tier0_bin</product>
<product>tier0_bin_pro</product>
<product>tier4_bin</product>
<product>tier4_evaluation</product>
</products>
<images>
<card_image>.meta/images/csharp_rect.png</card_image>
<thumb>.meta/images/csharp_sm.png</thumb>
<image>.meta/images/csharp_001.png</image>
<image>.meta/images/csharp_002.png</image>
<image>.meta/images/csharp_003.png</image>
</images>
<categories>
<category id="scene_management" name="Scene Management" order="10" img="data/csharp_component_samples/scene_management/scene_management.png"/>
<category id="csharp_language_features" name="C# Language Features" order="15" img="data/csharp_component_samples/csharp_language_features/csharp_language_features.png"/>
<category id="player_controllers" name="Player Controllers" order="20" img="data/csharp_component_samples/player_controllers/player_controllers.png"/>
<category id="input_handling" name="Input Handling" order="30" img="data/csharp_component_samples/input_handling/input_handling.png"/>
<category id="app_logic" name="App Logic" order="40" img="data/csharp_component_samples/app_logic/app_logic.png"/>
<category id="procedural_generation_placement" name="Procedural Generation & Placement" order="50" img="data/csharp_component_samples/procedural_generation_placement/procedural_generation_placement.png"/>
<category id="multi_threading_performance_optimization" name="Multithreading & Performance Optimization" order="60" img="data/csharp_component_samples/multi_threading_performance_optimization/multi_threading_performance_optimization.png"/>
<category id="nodes" name="Nodes" order="80" img="data/csharp_component_samples/nodes/nodes.png"/>
<category id="terrain_modification_usage" name="Terrain Modification & Usage" order="90" img="data/csharp_component_samples/terrain_modification_usage/terrain_modification_usage.png"/>
<category id="physics" name="Physics" order="100" img="data/csharp_component_samples/physics/physics.png"/>
<category id="rendering" name="Rendering" order="110" img="data/csharp_component_samples/rendering/rendering.png"/>
<category id="animation_generic" name="Animation - Generic" order="120" img="data/csharp_component_samples/animation_generic/animation_generic.png"/>
<category id="animation_characters" name="Animation - Characters" order="125" img="data/csharp_component_samples/animation_characters/animation_characters.png"/>
<category id="navigation" name="Navigation" order="140" img="data/csharp_component_samples/navigation/navigation.png"/>
<category id="user_interface" name="User Interface" order="150" img="data/csharp_component_samples/user_interface/user_interface.png"/>
<category id="sounds" name="Sounds" order="160" img="data/csharp_component_samples/sounds/sounds.png"/>
<category id="network" name="Network" order="170" img="data/csharp_component_samples/network/network.png"/>
<category id="unigine_script_interop" name="UnigineScript Interop" order="180" img="data/csharp_component_samples/unigine_script_interop/unigine_script_interop.png"/>
</categories>
<samples>
<sample title="Additive Animation Blending [Animation Graph]" order="1" id="additive_animation_blending" category_id="animation_characters">
<sdk_desc>
<![CDATA[Additive blending of two animations.]]>
</sdk_desc>
<desc>
<brief>
<![CDATA[Additive blending of two animations.]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Bones: Partial Blend [Animation Graph]" order="1" id="bones_partial_blend" category_id="animation_characters">
<sdk_desc><![CDATA[Demonstration of partial blending between two animations using bone-specific interpolation.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates partial blending between two animations using bone-specific interpolation.]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Linear Animation Blending [Animation Graph]" order="1" id="linear_animation_blending" category_id="animation_characters">
<sdk_desc>
<![CDATA[Linear interpolation of two animations.]]>
</sdk_desc>
<desc>
<brief>
<![CDATA[Linear interpolation of two animations.]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Bones: Rotation [Animation Graph]" order="1" id="bones_rotation" category_id="animation_generic">
<sdk_desc><![CDATA[Controlling animation playback and directly modifying bone transforms.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates how to control animation playback and directly modify bone transforms.]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Animation Layers Playback" id="animation_layers_playback" category_id="animation_generic">
<sdk_desc><![CDATA[Using multiple layers in animation playback.]]></sdk_desc>
<desc>
<brief>
<![CDATA[Animation playback uses animation layers.]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Curve Animation" id="curve_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Real-time animation of transforms and materials using <i>Curve2D</i> for flexible, non-linear motion.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to animate both node transforms and material parameters using <i>Curve2D</i>. Separate <i>Curve2d</i> tracks control a node's position, rotation, and scale, evaluated each frame to build the final transformation matrix.</p>
<p>This setup is useful for creating looping motions and dynamic material effects without relying on external animation assets.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Basic Recipes</tag>
<tag>Transformations</tag>
</tags>
</sample>
<sample title="Material Parameters Animation" id="material_parameters_animation" category_id="animation_generic">
<sdk_desc><![CDATA[Changing parameters of materials at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>The <i>Materials</i> sample illustrates how to change the following parameters of materials at runtime:</p>
<p> - Albedo color</p>
<p> - Albedo texture</p>
<p> - Metalness</p>
<p> - Emission state</p>
<p> - Cast World Shadow.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
<tag>Materials</tag>
</tags>
</sample>
<sample title="Track Playback" img="yes" id="track_playback" category_id="animation_generic">
<sdk_desc><![CDATA[Using tracks to animate objects (position, rotation, and scale).]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use <i>Tracker</i> to animate objects by changing their position, rotation, and scale through tracks created in the <b>Tracker</b> tool.</p>
<p>Tracks in code are referred to via names and IDs.</p>
<p>The <b>TrackPlayback</b> component uses a C# wrapper for <i>Tracker</i> functionality implemented in the <b>Tracker.cs</b> file.</p>
]]>
</brief>
</desc>
<tags>
<tag>Animation</tag>
</tags>
</sample>
<sample title="Advanced Event Connection Patterns" id="advanced_event_connection_patterns" category_id="app_logic">
<sdk_desc><![CDATA[Advanced ways of subscribing to events in UNIGINE: using extra arguments, discarding parameters, and storing connection handles for disconnection.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates advanced ways of subscribing to events in UNIGINE: using extra arguments, discarding parameters, and storing connection handles for disconnection.]]>
</brief>
</desc>
<controls>
<![CDATA[<p>T - rotate around X axis</p><p>Y - rotate around Y axis</p><p>U - rotate around Z axis</p><p>I - rotate around XYZ axes at the same time</p>]]>
</controls>
<tags>
<tag>Systems</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Arcade Game Prototype" img="yes" id="arcade_game_prototype" category_id="app_logic">
<sdk_desc><![CDATA[A simple yet flexible 3D shooter prototype featuring core gameplay systems like shooting, collisions, health management, and dynamic effects.]]></sdk_desc>
<desc>
<brief>
<![CDATA[<p>This sample showcases a flexible arcade-style interaction system, built with UNIGINE's C# API. It presents foundational gameplay mechanics commonly used in shooter, and action-style applications. The project serves both as a beginner-friendly learning resource and a base for prototyping more advanced features such as basic non-player behavior or scoring logic.</p>
<b><p>Core Features:</p></b>
<p> - <b>Player Controller:</b> Control a robot character with keyboard input for movement and rotation.</p>
<p> - <b>Projectile System:</b> An automated turret fires projectiles using raycasting for hit detection and visual impact effects.</p>
<p> - <b>Enemy Turret:</b> A rotating turret that periodically shoots projectiles at the player.</p>
<p> - <b>Health System:</b> The robot takes damage and is destroyed when health reaches zero, with corresponding visual effects and cleanup.</p>
<p> - <b>Node Spawning & Deletion:</b> Bullets and particle effects are dynamically created and removed, with timed destruction to manage scene performance.</p>
<p> - <b>Visual FX (Optional):</b> Includes particle effects for shooting, impact, and destruction events.</p>
<b><p>Use Cases:</p></b>
<p> - <b>Game Prototyping:</b> Provides a foundation for building shooter mechanics, or arcade-style gameplay.</p>
<p> - <b>Physics & Interaction:</b> Demonstrates raycasting-based hit detection.</p>
<p> - <b>Learning Tool:</b> Ideal for beginners exploring the UNIGINE C# API and gameplay scripting.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[<p align=left>Keys <b>UP</b> and <b>DOWN</b> to move forward/backward</p>
<p align=left>Keys <b>LEFT</b> and <b>RIGHT</b> for clockwise/counterclockwise rotation</p>
]]>
</controls>
<tags>
<tag>Complex Solutions</tag>
<tag>Intersections</tag>
<tag>Physics</tag>
<tag>Games</tag>
<tag>Effects</tag>
<tag>VFX</tag>
<tag>Decals</tag>
</tags>
</sample>
<sample title="Component Parameters In Editor" img="yes" id="component_parameters_in_editor" category_id="app_logic">
<sdk_desc><![CDATA[Demonstration of component parameter types and configuration options.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates possible variations of component parameter types available in the <b>Component System</b>. It includes primitive types, vectors, masks, files, properties, materials, nodes, curves, structs, arrays, and advanced features like conditional visibility and value filtering.</p>
<p>Select the <b>component_parameters</b> <i>Node Dummy</i> in the Editor and explore all parameter variations in the <i>Parameters</i> window. This serves as a comprehensive reference for available parameter types and their configuration options.</p>
]]>
</brief>
</desc>
<tags>
<tag>Component System</tag>
<tag>Programming</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Console Interaction" id="console_interaction" category_id="app_logic">
<sdk_desc><![CDATA[Interacting with the Engine's built-in console and adding custom console commands and variables via API using the <i>Console</i> and <i>ConsoleVariable</i> classes.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to interact with the Engine's built-in console and add custom console commands and variables via API using the <i>Console</i> and <i>ConsoleVariable</i> classes. It shows how to define different types of console variables: <i>ConsoleVariableInt</i>, <i>ConsoleVariableFloat</i>, and <i>ConsoleVariableString</i>, and how to register custom console commands.</p>
<p>Commands are linked to callback functions using <i>MakeCallback</i>, and can be executed directly from code or entered manually through the console. Commands can also be added and removed dynamically at runtime, making the system flexible for various use cases. Console variables can be accessed or changed through both code and the console interface.</p>
<p>For demonstration, to move the Material Ball in the scene use the custom command <b>control_node [x] [y] [z]</b> in the Console (`), where <i>x, y, z</i> are the target world coordinates (e.g., <b>control_node 0 5 1</b>).</p>
<p>This functionality can be used for development, debugging, rapid prototyping, and runtime adjustments in interactive applications.</p>
]]>
</brief>
</desc>
<tags>
<tag>Systems</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Euler Angle Composition And Decomposition" id="euler_angle_composition_and_decomposition" category_id="app_logic">
<sdk_desc><![CDATA[Showing how the order of angles affects rotation.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>Example of the object rotation using Euler angles. You can also observe different ways of decomposing the current rotation by various angle sequences.</p>
<p>This example helps to understand 3D rotations using Euler angles. It shows how different sequences can lead to different orientations in space.</p>
]]>
</brief>
</desc>
<tags>
<tag>Basic Recipes</tag>
<tag>Transformations</tag>
</tags>
</sample>
<sample title="Filesystem External Package" id="filesystem_external_package" category_id="app_logic">
<sdk_desc><![CDATA[Demonstration of working with external package files via the <i>Package</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to create a custom data package using code and use it to generate objects in the scene.</p>
<p>It creates a box mesh and spawns it 64 times in the scene with varied positions and rotations.</p>
<p>Package is a collection of files and data for UNIGINE projects stored in a single file. The <i>Package</i> class is a data provider for the File System. You can use it to load all necessary resources. </p>
<p>The <i>ExternalPackage</i> class describes the generation of a mesh (in this case, a box) and its saving to a temporary file at a specified path. The class also implements an interface for searching, reading, and retrieving information about files within the package.</p>
<p>The <i>ExternalPackageSample</i> class adds the created external package, and its contents are used to create meshes with different positions and orientations. This approach allows for quick and convenient management of a large number of objects without adding them by hand.</p>
<p>Packages can be used to conveniently transfer files between your projects or exchange data with other users, be it content (a single model or a scene with a set of objects driven by logic implemented via C# components) or files (plugins, libraries, execution files, etc.).</p>
<p>Using this example will help you understand how to organize work with external files, create and manage your own data packages, implement a mechanism for loading and reading data from a package.</p>
]]>
</brief>
</desc>
<tags>
<tag>Systems</tag>
<tag>Logic</tag>
<tag>File System</tag>
</tags>
</sample>
<sample title="Inverse FPS Usage" id="inverse_fps_usage" category_id="app_logic">
<sdk_desc><![CDATA[Using <i>Game.IFps</i> to implement movement logic independent of the frame rate.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates the importance of using <i>Game.IFps</i> to implement movement logic independent of the frame rate.]]>
</brief>
</desc>
<tags>
<tag>Logic</tag>
</tags>
</sample>
<sample title="XML" id="xml" category_id="app_logic">
<sdk_desc><![CDATA[Creating and manipulating an <i>XML</i> document using the <i>Xml</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to create and manipulate an <i>XML</i> document using the <i>Xml</i> class. It creates a nested <i>XML</i> tree with multiple child nodes, each containing arguments and optionally a text value.</p>
<p>The structure is built using the <i>Xml.AddChild()</i> method, and the arguments are parsed using <i>Xml.GetArgName()</i> and <i>Xml.GetArgValue()</i>. After construction, the <i>XML</i> tree is traversed recursively to display the structure and all attributes in the Console output.</p>
<p>This approach demonstrates the use of the <i>Xml</i> class for working with hierarchical data, which is useful for config files, level data, and other structured content in <i>XML</i> format.</p>
]]>
</brief>
</desc>
<tags>
<tag>File Formats</tag>
</tags>
</sample>
<sample title="Abstract Components" id="abstract_components" category_id="csharp_language_features">
<sdk_desc><![CDATA[Demonstrating the use of abstract component classes for shared behavior via C# API.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use abstract classes in the C# Component System to implement common behavior across different components.</p>
<p>At the core of the sample is the abstract <b>Toggleable</b> component, which defines a shared structure for enabling and disabling functionality. It contains the <b>Toggled</b> property that automatically calls the <i>On()</i> or <i>Off()</i> methods when changed. These methods are abstract and must be implemented in each derived class. The <i>Toggle()</i> method is used to switch the state manually, applying the corresponding behavior and updating the internal state.</p>
<p>Two specific components, <b>Lamp</b> and <b>Fan</b>, inherit from <b>Toggleable</b> and implement their own versions of the abstract methods. Lamp controls a light source by toggling its emission material state, while Fan continuously rotates the object when active.</p>
<p>The <b>Toggler</b> component performs interaction by casting a ray from the camera when the left mouse button is pressed. If it hits an object with a <b>Toggleable</b> component attached, it toggles that component's state.</p>
<p>This setup is useful for scenarios where different types of objects need to respond to a common interaction pattern. Using abstract classes makes it easy to implement consistent logic across objects while still allowing each one of them to behave differently.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<p><b>Click</b> on the lamp (sphere) and the fan (cube) to toggle them.</p>
]]>
</controls>
<tags>
<tag>Systems</tag>
<tag>Component System</tag>
<tag>Logic</tag>
<tag>Programming</tag>
</tags>
</sample>
<sample title="Coroutine Animations" id="coroutine_animations" category_id="csharp_language_features">
<sdk_desc><![CDATA[Managing (starting, stopping, and coordinating) multiple coroutines in UNIGINE to create non-blocking, time-based animations with UI-driven runtime control.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement application logic to be executed across multiple frames using coroutines, their execution can be suspended either by the Engine or manually, and then resumed. Here coroutines are used to create non-blocking, time-based targeted animations on a node. Smooth movement, continuous rotation, and material blinking effects are implemented using coroutine control flow (<b>StartCoroutine, yield return, StopCoroutine</b>). The sample also shows how to manage multiple coroutines simultaneously and stop them selectively.</p>
<p>You can control coroutine-based animations using a simple GUI which provides a practical way to explore and understand coroutine-driven behavior.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/code/csharp/coroutines?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Component System</tag>
<tag>Logic</tag>
<tag>Programming</tag>
</tags>
</sample>
<sample title="Input Gamepad" id="input_gamepad" category_id="input_handling">
<sdk_desc>
<![CDATA[This sample demonstrates how to add input from the gamepad to the project.]]>
</sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates how to add input from the gamepad to the project.]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Input Joystick" id="input_joystick" category_id="input_handling">
<sdk_desc><![CDATA[This sample demonstrates how to add advanced joystick input handling, supporting multiple controllers with real-time axis/button monitoring and force feedback effects in UNIGINE.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to add advanced joystick input handling to a project using the <i>InputJoystick.cs</i> component assigned to <b>NodeDummy</b>, supporting multiple controllers with real-time axis/button monitoring and force feedback effects in UNIGINE.</p>
<p>It features a <b>dynamic UI for testing 10+ force feedback types</b> (springs, vibrations, waves) and automatically handles device connection/disconnection events.</p>
<p><b>Use Cases:</b></p>
<p>Ideal for racing/flight simulators or any project requiring precise controller input with haptic feedback.</p>
]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Input Keyboard And Mouse" id="input_keyboard_mouse" category_id="input_handling">
<sdk_desc><![CDATA[This sample demonstrates how to add monitoring of keyboard and mouse input, tracking key states, mouse movements, wheel events, cursor positions, and real-time input data.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to add monitoring of keyboard and mouse input, tracking key states, mouse movements, wheel events, and cursor positions across different coordinate systems using the <i>InputKeyboardAndMouse.cs</i> component assigned to <b>NodeDummy</b>. It displays real-time input data including key presses, mouse deltas, and text input.</p>
<p>The sample shows three mouse handling modes:</p>
<p> - <b>GRAB</b> - locks and hides the cursor</p>
<p> - <b>SOFT</b> - locks the cursor to the window but keeps it visible</p>
<p> - <b>USER</b> - leaves mouse behavior completely under user control.</p>
]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Touch" id="touch" category_id="input_handling">
<sdk_desc><![CDATA[This sample demonstrates how to add multi-touch input from the touchscreen, visualizing finger positions with dynamic circles and displaying real-time coordinates to the project.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates how to add multi-touch input from the <i><b>touchscreen</b></i>, visualizing finger positions with dynamic circles and displaying real-time coordinates to the project using the <i>InputTouches.cs</i> component assigned to <b>NodeDummy</b>.]]>
</brief>
</desc>
<tags>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Asynchronous Meshes And Textures Loading" id="asynchronous_meshes_and_textures_loading" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Loading meshes and textures in a separate thread using the <i>AsyncQueue</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to load resources like meshes and textures in the background using the <i>AsyncQueue</i> class. Files are loaded in a separate thread, so the main application stays responsive.</p>
<p>Meshes and textures are added to the loading queue, and the system listens for events to know when each resource is ready. When a mesh finishes loading, it's removed from the queue. For textures, an event handler is used to handle their completion. The sample also demonstrates how to group and manage resource requests, making it easier to control the loading process.</p>
<p>This kind of async loading is useful for streaming large levels, loading assets on demand in VR, or preloading data in simulations without freezing the interface.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/api/library/filesystem/class.asyncqueue?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
<tag>File System</tag>
<tag>Multithreading</tag>
</tags>
</sample>
<sample title="Asynchronous Nodes Loading Stress-Test" id="asynchronous_nodes_loading_stress_test" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Asynchronous node loading via <i>AsyncQueue</i> with main-thread spatial integration.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to asynchronously load large number of nodes using the <i>AsyncQueue</i> class while ensuring correct activation on the main thread.</p>
<p>In UNIGINE, world nodes must be created only from the main thread. To comply with this restriction and avoid blocking the main thread, the sample performs the initial node loading in a background thread, and then schedules a follow-up task on the main thread to finalize activation by calling <i>updateEnabled()</i> - a method that registers the node and its children in the world's spatial structure.</p>
<p>With the built-in Profiler enabled, you can observe how the engine handles increasing load smoothly and avoids frame spikes.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/api/library/filesystem/class.asyncqueue?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
<tag>Multithreading</tag>
<tag>World Management</tag>
</tags>
</sample>
<sample title="Asynchronous Tasks Scheduler Configuration" id="asynchronous_tasks_scheduler_configuration" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Managing tasks via <i>AsyncQueue</i> class with dirrefent thread types, parallel execution and frame control.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstates how to schedule and run different types of tasks using the <i>AsyncQueue class</i>. It shows how to execute operations in different thread types, control thread count, and choose whether tasks should complete within the current frame or run freely in the background.</p>
<p> - <b>Async</b> - non-blocking execution in a single thread. Useful for offloading tasks without stalling the main thread.</p>
<p> - <b>Async Multithread</b> - parallel execution across multiple threads. Each thread receives its own portion of work. Does not block the caller.</p>
<p> - <b>Frame-Async Multithread</b> - same as <b>Async Multithread</b>, but ensures all threads complete their tasks within the current frame.</p>
<p> - <b>Sync Multithread</b> - multi-threaded execution that blocks the calling thread until all threads finish.</p>
<p> - <b>Frame-Sync Multithread</b> - same as <b>Sync Multithread</b>, but ensures all threads complete their tasks within the current frame.</p>
]]>
</brief>
</desc>
<link_docs>https://developer.unigine.com/docs/api/library/filesystem/class.asyncqueue?rlang=cs</link_docs>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
<tag>Multithreading</tag>
</tags>
</sample>
<sample title="Microprofiler Custom Counters" id="microprofiler_custom_counters" category_id="multi_threading_performance_optimization">
<sdk_desc><![CDATA[Using <i>Microprofile</i>, an advanced CPU/GPU profiler, to track performance and estimate the time spent on different sections of code.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates methods for tracking performance and estimating the time spent on different sections of code. For this purpose, it uses <b>Microprofile</b>, an advanced CPU/GPU profiler with per-frame inspection support.]]>
</brief>
</desc>
<exec>microprofile_enabled 1</exec>
<edit>microprofile_enabled 1</edit>
<tags>
<tag>Systems</tag>
<tag>Optimization</tag>
</tags>
</sample>
<sample title="Navigation Mesh 2D" id="navigation_mesh_2d" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 2D navigation paths using a <i>Navigation Mesh</i> object and <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to calculate and visualize 2D navigation paths using the <b>Navigation Mesh</b> object and <i>PathRoute</i> class via the C# API. It shows how to build a route between two points on a navigation mesh and renders the result for debugging or visualization purposes.</p>
<p>This setup is useful for prototyping AI navigation, testing route validity, and analyzing the structure of navigable areas in 2D gameplay scenarios.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Mesh 2D Demo" id="navigation_mesh_2d_demo" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 2D navigation paths with moving targets using <i>Navigation Mesh</i> object and <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement dynamic 2D pathfinding using a <b>Navigation Mesh</b> object, with autonomous robots navigating toward randomly positioned targets. Each robot uses a <i>PathRoute</i> class instance to calculate a valid route within the navigation mesh and moves along it in real time.</p>
<p>This setup is useful for prototyping simple AI behavior such as patrolling or target chasing, where agents continuously search for and move toward dynamic goals.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Obstacles 2D" id="navigation_obstacles_2d" category_id="navigation">
<sdk_desc><![CDATA[Demonstrating the use of <i>Obstacles</i> within a <i>Navigation Mesh</i> to dynamically modify valid pathfinding areas at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use dynamic <b>Obstacles</b> in combination with a <b>Navigation Mesh</b> to influence 2D pathfinding in runtime. When an obstacle overlaps the navigation mesh, it temporarily modifies the traversable area, forcing the pathfinding algorithm to recalculate a valid route around it.</p>
<p>This example is useful for prototyping interactive environments, where navigation must adapt to moving objects, barriers, or other gameplay elements affecting traversal.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Sectors 2D" id="navigation_sectors_2d" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 2D navigation paths using <i>Navigation Sector</i> objects and the <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to calculate and visualize 2D navigation paths using the <b>Navigation Sector</b> objects and <i>PathRoute</i> class. Unlike navigation meshes, sectors allow defining modular navigable areas that can be enabled, disabled, or moved dynamically at runtime.</p>
<p>This 2D version is well-suited for top-down navigation, grid-based layouts, or layered 2D gameplay. For more complex 3D navigation scenarios, see the <i>navigation_sectors_3d</i> sample.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Sectors 3D" id="navigation_sectors_3d" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 3D navigation paths using <i>Navigation Sector</i> objects and the <i>PathRoute</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to calculate and visualize 3D navigation paths using the <b>Navigation Sector</b> objects and <i>PathRoute</i> class via the C# API. Unlike navigation meshes, sectors allow defining modular navigable areas that can be enabled, disabled, or moved dynamically at runtime.</p>
<p>This setup is useful for multilevel structures or modular environments where the layout changes dynamically. For simpler 2D navigation scenarios, see the <i>navigation_sectors_2d</i> sample.</p> ]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Navigation Sectors 3D Demo" id="navigation_sectors_3d_demo" category_id="navigation">
<sdk_desc><![CDATA[Calculating and visualizing 3D navigation paths using <i>Navigation Sector</i> and the <i>PathRoute</i> class to track dynamic targets.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement 3D pathfinding logic using <b>Navigation Sector</b> and <i>PathRoute</i> class via the C# API. Robots autonomously fly and collect coins, which are dynamically placed at random locations within the navigation sector volume.</p>
<p>The main logic is implemented in the <b>PathRoute3DWithTarget</b> component. A <i>PathRoute</i> object is created to calculate a valid 3D path from the robot's current position to the target using <i>PathRoute.Create3D()</i>. Once a valid path is generated, the robot rotates toward the next point in the path and moves forward. If the path becomes invalid - for example, if the target ends up in an unreachable area, then the system selects a new target location and recalculates the route.</p>
<p>Target positions are chosen at random inside the volume of a <i>Navigation Sector</i>, using <i>Inside3D()</i> for validation. The route is automatically updated as the robot approaches the target. If the route is successfully resolved, the path is drawn on screen using <i>RenderVisualizer()</i>.</p>
<p>To help visualize active navigation areas, the <b>NavigationSectorVisualizer</b> component renders the geometry of all sectors during runtime.</p>
]]>
</brief>
</desc>
<tags>
<tag>Navigation & Pathfinding</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="HTTP Image Request" id="http_image_request" category_id="network">
<sdk_desc><![CDATA[This sample shows how to implement an asynchronous <i>HTTP</i> request to a <i>REST API</i> to download image files and apply them to scene objects at runtime.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to implement an asynchronous <i>HTTP</i> request to a <i>REST API</i> to download image files and apply them to scene objects at runtime.</p>
<p>Two requests are performed to retrieve sample image data:</p>
<p> - <b>eu.httpbin.org/image/png</b> - to download a <i>PNG</i> image</p>
<p> - <b>eu.httpbin.org/image/jpeg</b> - to download a <i>JPEG</i> image</p>
<p>Only <i>PNG</i> and <i>JPEG</i> formats are supported for runtime loading into an <i>Image</i> Class instance from raw data.</p>
<p>Once an image is retrieved, it is loaded from raw byte data using the <i>Image.Load()</i> method. If successful, the image is assigned to the albedo texture slot of the target material using <i>Material.SetTextureImage()</i>. The texture is applied at runtime to the specified surface of an object in the scene. If loading fails, the downloaded data is written to a file for further inspection.</p>
<p>This sample showcases a practical approach to fetching external media assets, validating them, and using them in your scenes or application logic.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
</tags>
</sample>
<sample title="HTTP Request Handling" img="yes" id="http_request_handling" category_id="network">
<sdk_desc><![CDATA[Implementing asynchronous <i>HTTP GET</i> requests to external <i>REST API</i> and displaying the retrieved data in the user interface.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to implement asynchronous <i>HTTP GET</i> requests to external <i>REST API</i> and display the retrieved data in the user interface.</p>
<p>For demonstration, the sample performs two consecutive requests to external weather <i>API</i> and displays the results in real time.</p>
<p> - <b>Geocoding</b> - resolving a location by name using <i>geocoding-api.open-meteo.com</i>.</p>
<p> - <b>Current weather conditions</b> - retrieving live meteorological data for the selected location using <i>api.open-meteo.com</i>.</p>
<p>The <i>JSON</i> response is processed using the <i>Json</i> Class and displayed in the sample <i>UI</i>. Additional response details can be viewed in the console output.</p>
<p>You can interactively test the workflow by entering a city name in the <i>UI</i>, viewing a list of possible matches, and selecting a specific location. This triggers a request for up-to-date weather data, which is then parsed and displayed in the <i>UI</i>.</p>
<p>Asynchronous processing ensures that network operations do not block or degrade the simulation performance.</p>
<p>This sample can serve as a foundation for integrating any external data providers.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
</tags>
</sample>
<sample title="TCP Sockets" id="tcp_sockets" category_id="network">
<sdk_desc><![CDATA[Establishing and managing <i>TCP</i> socket connections between a server and multiple clients each represented by a UNIGINE-application. Clients can connect to the server, exchange text messages via the Console, and receive camera transform updates from the server.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to establish and manage <i>TCP</i> socket connections between a server and multiple clients each represented by a UNIGINE-application. Clients can connect to the server, exchange text messages via the Console (<b>send_msg</b> command), and receive camera transform updates from the server.</p>
<p><b>You need to have two instances of this 'C# Samples' app running for this sample to work.</b></p>
<p>Each instance can operate in one of two modes: <i>Server</i> or <i>Client</i>. To select the mode click on the corresponding button below. There you can also specify the desired <i>host and port</i>.</p>
<p>The server uses a non-blocking socket to accept client connections and creates a dedicated background thread for each connection. The communication protocol is based on custom messages (e.g., text or camera transforms) packed and unpacked using <i>Blob</i> streams. On the client side, a socket is created and connected to the server. Incoming and outgoing messages are sent/received using two threadsafe queues. To send text messages to the peer use the sample-specific console command <b>send_msg</b> (e.g. <b>send_msg hello world</b>)</p>
<p>Incoming messages are parsed using message headers. Both client and server use message buffering, timeouts, and validation checks to maintain connection stability and prevent invalid data processing.</p>
<p>The sample provides options to configure the server address and port, switch between modes, and monitor active connections.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
<tag>Basic Recipes</tag>
</tags>
</sample>
<sample title="UDP Sockets" id="udp_sockets" category_id="network">
<sdk_desc><![CDATA[Using the sockets API to send and receive UDP messages in the network between two peers each represented by a UNIGINE-application.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to use the sockets API to send and receive UDP messages between two peers in the network.</p>
<p><b>You need to have two instances of this 'C# Samples' app running for this sample to work.</b></p>
<p>Each instance can operate in one of two modes: <i>Sender</i> or <i>Receiver</i>. To select the mode click on the corresponding button below. There you can also specify the <i>Receiver's hostname and port</i>.</p>
<p>In <i>Sender</i> mode the app packs the player's camera transform into a datagram and sends it to the <i>Receiver</i> on every engine update.</p>
<p>While in this mode you can also send text messages to the peer by using this sample-specific console command <b>send_msg</b> (e.g., <b>send_msg hello world</b>).</p>
<p>In <i>Receiver</i> mode the app receives and interprets incoming messages from the peer: the text messages are written to console, and the camera transforms are applied to the player.</p>
]]>
</brief>
</desc>
<tags>
<tag>Network</tag>
<tag>Basic Recipes</tag>
</tags>
</sample>
<sample title="Cluster" id="cluster" category_id="nodes">
<sdk_desc><![CDATA[Dynamic manipulation of <i>ObjectMeshCluster</i> in UNIGINE, showcasing how to add/remove mesh instances at runtime through user interaction.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates dynamic manipulation of <b>ObjectMeshCluster</b> in UNIGINE, showcasing how to add/remove mesh instances at runtime through user interaction. A <b>Mesh Cluster</b> allows you to bake identical meshes (with the same material applied to their surfaces) into a single object, which provides less cluttered spatial tree, reduces the number of texture fetches and speeds up rendering.</p>
<p><b>Core Features:</b></p>
<p> - <b>Placement and Removal</b> - click on empty ground adds a new mesh at the clicked position, click on existing cluster geometry removes the selected mesh instance from the cluster</p>
<p> - <b>Raycasting and Intersection Testing</b> - casts a ray from the camera through the mouse position to detect whether the user clicked on a cluster mesh or terrain</p>
<p><b>Use Cases:</b></p>
<p> - Scattering objects like rocks, grass, or debris</p>
<p> - Dynamic level editing and environment design</p>
<p> - Performance-sensitive applications with many similar mesh instances.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<b>Сlick</b> on an existing mesh removes it from the cluster.<br/><b>Сlick</b> in an empty space adds a new mesh.
]]>
</controls>
<tags>
<tag>Optimization</tag>
<tag>Objects</tag>
<tag>World Management</tag>
</tags>
</sample>
<sample title="Water Surface Parameters Fetch" id="water_surface_parameters_fetch" category_id="nodes">
<sdk_desc><![CDATA[This sample demonstrates how various parameters influence the accuracy of fetch and intersection operations on the Global Water object across different Beaufort levels.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how various parameters influence the accuracy of <b>fetch</b> (sampling water height and normal) and <b>intersection</b> (ray-water collision detection) operations on the <b>Global Water</b> object across different <b>Beaufort</b> levels (the Beaufort slider).</p>
<p>You can interactively adjust the following parameters:</p>
<p> - <b>Steepness Quality</b>: Controls wave detail resolution used in sampling.</p>
<p> - <b>Amplitude Threshold</b>: Filters out minor waves to improve performance at the cost of detail.</p>
<p> - <b>Precision</b>: Controls ray-water intersection accuracy. Lower values reduce jitter when intersecting at an angle.</p>
<p> - <b>Intersection Angle</b>: Adjusts the incoming ray direction for intersection tests, helping evaluate how steep angles affect detection stability.</p>
<p>The UI also allows you to:</p>
<p> - Select between <b>Fetch</b> and <b>Intersection</b> modes</p>
<p> - Show or hide <b>normals</b> at the sampled points</p>
<p> - Adjust the <b>number of samples</b> and <b>visual point size</b></p>
<p>Intersection rays are visualized with blue arrows. If jitter occurs at non-zero intersection angles, try lowering the <b>Precision</b> value.</p>
<p>This sample is useful for fine-tuning water interaction accuracy in physics, gameplay, and visual effects - especially when working with sloped or moving viewpoints (e.g., cameras, characters, or objects interacting with water).</p>
]]>
</brief>
</desc>
<tags>
<tag>Water</tag>
<tag>Maritime</tag>
<tag>Intersections</tag>
</tags>
</sample>
<sample title="Body Events" id="body_events" category_id="physics">
<sdk_desc><![CDATA[Demonstrating the usage of <i>Frozen, Position</i>, and <i>ContactEnter</i> events of the <i>Body</i> class via C# API.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use the <i>Frozen</i>, <i>Position</i>, and <i>ContactEnter</i> events of the <i>Body</i> class via the C# API. These events allow responding to physical state changes, such as when a rigid body comes to rest, moves, or collides with another object or surface.</p>
<p>The sample builds a pyramid of boxes by cloning a mesh and arranging it in several layers. Physics settings are adjusted to improve the stability of the stacked boxes and ensure accurate detection of movement or rest states.</p>
<p>This approach is useful for debugging physical behaviors, providing visual feedback in simulations, or triggering logic based on changing body states.</p>
]]>
</brief>
</desc>
<tags>
<tag>Physics</tag>
<tag>Systems</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Body Fracture Explosion" id="body_fracture_explosion" category_id="physics">
<sdk_desc><![CDATA[Simulating a radial explosion that triggers <i>BodyFracture</i> object to crack and applies forces to its pieces.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to simulate an explosion that fractures physical objects within its radius using the <i>BodyFracture</i> class. Each object affected by the explosion is dynamically fractured into separate physical fragments depending on its proximity to the center of the explosion and the decreasing explosion strength over distance.</p>
<p>The force applied to the fragments pushes them outward from the explosion center, creating a realistic dispersal effect. A built-in debug visualization clearly displays the explosion radius and the direction of the applied forces, making it easier to understand and adjust the fracture behavior and explosion dynamics.</p>
<p>Press <i>Explode!</i> to manually trigger the explosion.</p>
<p>This example is ideal for scenarios that require realistic destruction, dynamic fracture effects, or visual representations of physical object damage.</p>
]]>
</brief>
</desc>
<tags>
<tag>Physics</tag>
<tag>Systems</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Body Fracture Falling Spheres" id="body_fracture_falling_spheres" category_id="physics">
<sdk_desc><![CDATA[Continuously fracturing falling objects upon collision using the <i>BodyFracture</i> class.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates continuous fracturing of objects using <i>BodyFracture</i> class.</p>
<p>Spheres are periodically spawned every 3 seconds and fall freely under gravity. Upon collision with the ground, each sphere fractures dynamically into multiple physical fragments.</p>
<p>The sample includes a debug visualization that displays mesh wireframes, providing clear insight into internal mesh structure and fracture patterns generated upon impact.</p>
<p>This example can be used to explore and evaluate destruction mechanics, test mesh-based fracturing setups, and visually analyze breakage behavior in real-time scenarios.</p>
]]>
</brief>
</desc>
<tags>
<tag>Physics</tag>
<tag>Systems</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="Body Fracture Shooting Gallery" id="body_fracture_shooting_gallery" category_id="physics">
<sdk_desc><![CDATA[Implementation of a basic physics-driven shooting gallery using <i>Fracture Body</i>.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample shows how to simulate projectile-based interactions in a simple shooting gallery setup using <b>Fracture Body</b>. When the left mouse button is clicked, a projectile is spawned in front of the camera and propelled forward. Target objects in the scene react to the impact physically and can be fractured using the <b>Fracture Body</b> system to simulate realistic destruction effects.</p>
<p><b>Use Cases:</b></p>
<p> - Prototyping physics-based shooting mechanics.</p>
<p> - Demonstrating <b>Fracture Body</b> impulse interactions.</p>
<p> - Testing fracture behaviors in destructible environment setups.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[<p><b>LMB</b> - fire a projectile.</p>]]>
</controls>
<tags>
<tag>Basic Recipes</tag>
<tag>Physics</tag>
</tags>
</sample>
<sample title="Joint Events" id="joint_events" category_id="physics">
<sdk_desc><![CDATA[Demonstrating the usage of the <i>Broken</i> event of the <i>Joint</i> class via C# API.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates how to use the <i>Broken</i> event of the <i>Joint</i> class via the C# API. This event allows you to react when a joint is broken due to physical forces during the simulation.</p>
<p>A simple bridge structure is created by cloning a mesh and connecting multiple sections using hinge joints. Some sections are dynamic (<i>BodyRigid</i>) and others are static (<i>BodyDummy</i>) to anchor the ends. Additionally, a few weights are dropped onto the bridge to cause joint breakage. The scene is configured to showcase physically reactive behavior through joints under load. When a joint breaks, the lambda is triggered, changing the material of the connected objects to visually indicate the break.</p>
<p>You can use this for detecting breakage in joint-based systems or adding visual feedback to destruction mechanics.</p>
]]>
</brief>
</desc>
<tags>
<tag>Physics</tag>
<tag>Systems</tag>
<tag>Visualizer (Visual Debug)</tag>
</tags>
</sample>
<sample title="Physics Movement" id="physics_movement" category_id="physics">
<sdk_desc><![CDATA[Simple logic of moving an object using physical methods (by force or by impulse).]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates a simple logic of moving an object using physical methods (by force or by impulse).</p>
<p>You can choose the desired method and control maximum speed, rotation speed, and accelerations using sliders.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<p align=left><b>W/S</b> - Move forward/backward.<br/>
<b>A/D</b> - Turn left/right.<br/>
<b>SPACE</b> - Jump.<br/>
<b>SHIFT</b> - Brake.</p>
]]>
</controls>
<tags>
<tag>Physics</tag>
</tags>
</sample>
<sample title="Update Physics" id="update_physics" category_id="physics">
<sdk_desc><![CDATA[Demonstration of the difference between iplementation of physics-driven movement within the <i>update()</i> and <i>updatePhysics()</i> methods.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates the difference between <i>update()</i> and <i>updatePhysics()</i> methods.</p>
<p>The sample features two physics-enabled cubes that move back and forth along the X-axis. The movement logic is implemented via in the <i>UpdatePhysicsUsageController.cs</i> file.</p>
<p>Use <i>updatePhysics()</i> to implement continuous or physics-dependent operations (e.g., force application, collision response), as it runs at a fixed time step, unlike <i>update()</i> which depends on the rendering frame rate.</p>
<p>Use the <b>Max FPS</b> slider to change the target frame rate.</p>
]]>
</brief>
</desc>
<tags>
<tag>Physics</tag>
<tag>Logic</tag>
</tags>
</sample>
<sample title="CAD-Style Camera Panning" id="cad_style_camera_panning" category_id="player_controllers">
<sdk_desc><![CDATA[A camera moving parallel to the screen plane.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates a camera moving parallel to the screen plane using the <i>CameraPanning.cs</i> component assigned to a <i>PlayerDummy</i> node.]]>
</brief>
</desc>
<controls>
<![CDATA[
<p><b>RMB (Drag)</b> - Rotate the camera</p>
<p><b>LMB (Drag)</b> - Pan the camera</p>
<p><b>Mouse Wheel</b> - Zoom in and out</p>
]]>
</controls>
<tags>
<tag>Cameras</tag>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Camera First Person" id="camera_first_person" category_id="player_controllers">
<sdk_desc><![CDATA[A first-person spectator-style camera with free movement.]]></sdk_desc>
<desc>
<brief>
<![CDATA[This sample demonstrates a first-person spectator-style camera with free movement.]]>
</brief>
</desc>
<controls>
<![CDATA[
<p><b>W</b> - Move forward</p>
<p><b>S</b> - Move backward</p>
<p><b>A</b> - Move left</p>
<p><b>D</b> - Move right</p>
<p><b>Left Shift</b> - Increase movement speed</p>
<p><b>Mouse Movement</b> - Rotate the camera</p>
]]>
</controls>
<tags>
<tag>Cameras</tag>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Camera Zoom" id="camera_zoom" category_id="player_controllers">
<sdk_desc><![CDATA[Creating interactive camera system with adjustable zoom and focus on selectable scene targets.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates a zoom and camera focus system that allows the user to inspect predefined targets in the scene and adjust the zoom level. Three info boards are placed throughout the scene, each with an in-world GUI panel showing its distance from the player and its dimensions. These panels update automatically in real time based on the player's position.</p>
<p>The user can select any target using dedicated UI buttons, prompting the camera to focus on the selected object.</p>
<p>Zoom is controlled via a slider that adjusts the camera's field of view. As the FOV changes, related parameters such as mouse sensitivity and render distance scaling are adjusted as well to maintain a consistent experience. A reset button restores all values to default.</p>
<p>This setup is useful for scenarios that require object-focused viewing, such as inspection tools, scene walkthroughs, or any case where adjustable zoom and camera focus help users better understand or explore the scene.</p>
]]>
</brief>
</desc>
<tags>
<tag>Cameras</tag>
<tag>Transformations</tag>
<tag>Basic Recipes</tag>
</tags>
</sample>
<sample title="First-Person Controller" id="first_person_controller" category_id="player_controllers">
<sdk_desc><![CDATA[Implementation of a first-person character controller with an advanced movement system and collision detection.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates a first-person character controller implemented as a component attached to a <i>PlayerDummy</i>.</p>
<p>The controller uses Shape-Surface collisions to detect ground, walls, and slopes, and applies slope-aware movement to ensure stable walking on inclined geometry. It supports walking, running, jumping, air movement, smooth crouching, and camera rotation with vertical limits. Auto-stepping allows the character to traverse small obstacles, and Shape-Shape collisions are used to interact with physical objects by applying impulses.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<p><b>W/A/S/D</b> - control camera movement</p>
<p><b>Shift</b> - accelerate</p>
<p><b>Space</b> - jump</p>
<p><b>Ctrl</b> - crouch</p>
<p><b>Mouse movement</b> - look around</p>
]]>
</controls>
<tags>
<tag>Cameras</tag>
<tag>Basic Recipes</tag>
<tag>Intersections</tag>
<tag>Physics</tag>
</tags>
</sample>
<sample title="Observer Controller" id="observer_controller" category_id="player_controllers">
<sdk_desc><![CDATA[Implementation of a free-flying camera similar to the one used in the UnigineEditor (with zooming, panning, focusing and speed control).]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample replicates the free camera used in the UnigineEditor. The camera offers the following key features:</p>
<p> - <b>Fly-Through Mode</b> Freely move the camera in all directions using keyboard and mouse controls.</p>
<p> - <b>Focus on Objects</b> Center the camera on any selected object and adjust distance automatically.</p>
<p> - <b>Zoom & Pan</b> Zoom in and out, and pan while preserving view direction.</p>
<p> - <b>Speed Control Menu</b> Switch between predefined movement speeds (<b>1-3</b>) or adjust custom speed values.</p>
<p> - <b>Position Management</b> Set or teleport the camera to specific world coordinates through the menu.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<p> - <b>F3</b>: show/hide the camera control menu</p>
<p> - <b>RMB (hold)</b>: switch to Spectator mode</p>
<p> - <b>RMB + mouse</b>: look around</p>
<p> - <b>RMB + W/A/S/D, Q/E</b>: camera movement</p>
<p> - <b>Alt + RMB</b>: switch to zooming mode</p>
<p> - <b>Alt + MMB</b>: switch to panoramic movement mode</p>
<p> - <b>F</b>: focus on the object under the mouse cursor</p>
<p> - <b>1, 2, 3</b>: switch movement speed<br/><br/></p>
<p>You can customize the key bindings in the camera properties within the Editor.</p>
]]>
</controls>
<tags>
<tag>Complex Solutions</tag>
<tag>Cameras</tag>
</tags>
</sample>
<sample title="Orbit Camera Controller" id="orbit_camera_controller" category_id="player_controllers">
<sdk_desc><![CDATA[Demonstration of an orbital camera rotating around a target.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates an orbital camera rotating around a target.</p>
<p>The <i>CameraOrbit.cs</i> component enables orbit-style camera movement around a target object using a <i>PlayerDummy</i> node. Input is handled via the <i>CameraControls.cs</i> component, which provides configurable input controls for camera movement and zoom.</p>
<p>The camera behavior can be customized using the exposed parameters: <i>Angular Speed, Zoom Speed, Min/Max Distance</i>, and <i>Min/Max Vertical Angle</i>. The <i>Target</i> field defines the object the camera orbits around.</p>
]]>
</brief>
</desc>
<controls>
<![CDATA[
<p><b>Mouse Movement</b> - Rotate the camera</p>
<p><b>Mouse Wheel</b> - Zoom in and out</p>
]]>
</controls>
<tags>
<tag>Cameras</tag>
<tag>Input & Controls</tag>
</tags>
</sample>
<sample title="Persecutor Controller" id="persecutor_controller" category_id="player_controllers">
<sdk_desc><![CDATA[A third-person camera following a moving target.]]></sdk_desc>
<desc>
<brief>
<![CDATA[ <p>This sample demonstrates a camera following a moving target.</p>
<p>The <i>CameraPersecutor.cs</i> component implements a third-person follow camera that smoothly tracks a moving target defined in the <i>Target</i> field. The camera adjusts its distance, pitch, and yaw to maintain the desired view of the target, using the <i>PlayerDummy</i> node as its base.</p>
<p>Input is handled via the <i>CameraControls.cs</i> component and allows orbiting around the target as well as zooming in and out. The behavior is configurable through parameters such as <i>Angular Speed, Zoom Speed, Min/Max Distance, Min/Max Vertical Angle</i>, and the <i>Use Fixed Angles</i> toggle. The <i>Target</i> field can be manually assigned and defines the object the camera will follow.</p>
<p>The target movement is defined by the <i>CameraPersecutorTarget.cs</i> component, which moves the object along a circular path over time to demonstrate dynamic tracking.</p>
]]>
</brief>
</desc>
<controls>