This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Basics

Camera Zoom#

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.

The user can select any target using dedicated UI buttons, prompting the camera to focus on the selected object.

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.

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.


SDK Path: <SDK_INSTALLATION>source/basics/camera_zoom

Component System#

This sample illustrates how to implement your application's logic via a set of building blocks - components, and assign these blocks to nodes. A logic component integrates a node, a property, and a C++ class containing logic implementation.

The sample includes a controllable pawn with basic movement, rotating boxes that periodically spawn projectiles, and a floating UI label displaying health, survival time, and active component count.

The sample demonstrates how to:

  • Decompose application logic into modular, reusable components
  • Create and assign custom logic components at runtime
  • Implement interaction between independently managed components.

More details about the Component System sample are available in the official documentation linked below.

https://developer.unigine.com/docs/code/usage/using_component_system/index?rlang=cpp
SDK Path: <SDK_INSTALLATION>source/basics/component_system

Euler Angles#

This sample demonstrates how the order of angles affects the resulting rotation. You can also observe different ways of decomposing the current rotation by various angle sequences.

This example helps to understand 3D rotations using Euler angles. It shows how different sequences can lead to different orientations in space.


SDK Path: <SDK_INSTALLATION>source/basics/euler_angles

IFps Usage#

This sample demonstrates the importance of using Game::getIFps() to implement movement logic independent of the frame rate.

The sample features two cubes moving back and forth along the X-axis. Their movement is implemented in the IFpsMovementController.cpp file. Use the Max FPS slider to change the target frame rate.

The green cube uses Game::getIFps() to scale its movement by the frame time delta. This ensures consistent speed across varying frame rates.

The red cube does not use Game::getIFps() and simply applies constant translation per frame, which results in inconsistent behavior when frame rate changes

This sample demonstrates why using time-based logic is essential for consistent results at different frame rates.


SDK Path: <SDK_INSTALLATION>source/basics/ifps_usage

Intersection Bound#

This example demonstrates how to detect intersections between a frustum, sphere, or box and the bounding boxes of nodes. For clarity, the boundaries of the nodes are displayed in the scene, allowing for a quick visual assessment of when the nodes intersect the specified volumes.

The init() function creates three types of bounding volumes: a frustum, a sphere, and a box. The update() function performs the intersection checks. It uses the World::getIntersection() function to get a list of nodes that intersect the given boundaries and changes their color using the change_color() function.

This approach can be used to implement systems for determining which objects fall within a bounding volume and triggering events, such as starting dialogues, spawning enemies, activating effects, or any other reaction.


SDK Path: <SDK_INSTALLATION>source/basics/bound_intersection

Intersection Ray#

This example demonstrates how to find intersections with geometry using raycasting taking into account different Intersection bitmasks (using first 8 bits out of 32).

Raycasting involves detecting intersections with scene objects along the path of a ray cast from point A to point B. This process is visualized in the sample via a laser ray representation (laser length depends on the ray length).

In the update() method, the World::getIntersection() function checks for ray intersections with scene objects based on a specified intersection mask. If the ray hits an object with a matching mask (one bit at least), an intersection is detected. After that, the ray is updated and visual spark effects are rendered at the intersection point.

You can change the laser's intersection mask by toggling the corresponding checkboxes. If a wall's mask bit doesn't match the laser's mask, the laser will pass through.

Using raycasting makes it easy to implement various game mechanics, such as shooting or target detection during navigation.


SDK Path: <SDK_INSTALLATION>source/basics/ray_intersection

Node Spawner Grid#

This sample shows how to create nodes and place them across a grid. Spawning from the center is also available.
SDK Path: <SDK_INSTALLATION>source/basics/node_spawner_grid

Node Spawner Timer#

A simple node spawner creates nodes at a set spawn frequency.

The sample will be useful for generating game objects with a certain periodicity - for example, enemies, bonuses, effects or other elements of the game world.


SDK Path: <SDK_INSTALLATION>source/basics/node_spawner_timer

Simple Movement#

Different ways to specify object transformations during movement and rotation.

The sample illustrates that using either of the following methods will lead to the same result.

Red cube is controlled using translate() and rotate().

Green cube: setPosition() and setRotation().

Blue cube: setTransform().


SDK Path: <SDK_INSTALLATION>source/basics/simple_movement

Trajectory#

This sample demonstrates three types of movement along a predefined path:

  • Red plane: linear interpolation.
  • Blue plane: spline interpolation.
  • Green plane: path from a file.

The sample contains the PathTrajectorySaver component that illustrates how to create your own path file, which is opened via the WorldTransformPath node. Each path can be toggled on and off, and you can switch between the cameras to have a first-person view from each plane.


SDK Path: <SDK_INSTALLATION>source/basics/trajectory

Trigger Buttons#

Demonstration of various types of interactable buttons and levers.
SDK Path: <SDK_INSTALLATION>source/basics/trigger_buttons

Triggers#

This sample illustrates how to implement a simple trigger component in three different ways:

  • Intersection Trigger performs the bound check via World::getIntersection().
  • Math Trigger performs the check if the object is inside the trigger sphere or cube using the object coordinates (the simplest and most performance-friendly way).
  • World Trigger uses the WorldTrigger node.

SDK Path: <SDK_INSTALLATION>source/basics/triggers

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2025-06-30
Build: ()