Introduction

As mentioned before each step of a pipelined process is translated to an Action Blueprint. This Blueprint contains information to define the Action’s behavior.

../../../_images/Slide91.PNG

The Action object reflects a flexible structural module, capable to generate complex behaviours from basic ones. This is also the concept idea behind scenegraph; provide developers with fundamental elements and tools to implement scenarios from basic principles. Each Action blueprint describes the behaviour in means of physical actions in the virtual environment.

../../../_images/Slide121.PNG

In technical details, each Action script implements the IAction interface, which defines the basic rules every Action should follow. This interface ensures that all Actions will have the same methods.

../../../_images/Slide111.PNG

The methods and properties of IAction interface are explained in detail below.

/// <summary>
/// This Inteface nedds to be implemented for every Action
/// Describes the functionalities the Actions should have
/// </summary>
class MAGES_SDK_API IIAction
{
        GENERATED_BODY()

public:
    /// <summary>
    /// Get the name of the action
    /// </summary>
    FString GetActionName();

    /// <summary>
    /// Get the actor referring to the current Action in Unreal.
    /// This implements the core of unreal's scenegraph.
    /// </summary>
    AAction* GetActionNode();

    /// <summary>
    /// Sets the alternative path for current Action
    /// -1 : Default path
    /// </summary>
    int32 GetAlternativePath();

    /// <summary>
    /// Go to Next Action
    /// Completes the current Action by finilizing and cleaning it
    /// Destroys prefabs, holograms
    /// Also plays animations to set the next one
    /// </summary>
    virtual void Perform() = 0;

    /// <summary>
    /// Go to Previous Action
    /// Resets current Action by finilizing and cleaning it
    /// Destroys prefabs, holograms
    /// Plays Undo animations
    /// </summary>
    virtual void Undo() = 0;

    /// <summary>
    /// Initialize current Action by spawning the necessary blueprints
    /// Sets each Action properties to run correctly
    /// </summary>
    virtual void Initialize() = 0;

    /// <summary>
    /// Sets Holograms for current Action
    /// </summary>
    virtual void InitializeHolograms() = 0;

    /// <summary>
    /// Used only for Combined Actions
    /// Sets the next sub-Action to run after Performing the current one
    /// </summary>
    /// <param name="action">The next Action to run</param>
    virtual void SetNextModule(Action action) = 0;

    /// <summary>
    /// Used only for Parallel Actions
    /// Sets the next action which can be in a different path of scenegraph
    /// </summary>
    /// <param name="Action">The next Action to run</param>
    /// <param name="pathToSet">The different path</param>
    virtual void SetNextModulePath(FORamaVRSetPath Action, int pathToSet) = 0;
};

Action Prototypes

At this point, we have described the basic interface each Action should implement to be initialized and performed properly. With this interface, a developer can generate action scripts that behave in a common ruleset, following the scenegraph pipeline.

To make our system more efficient we have to limit the capabilities of the Action entity to target simple but commonly used behaviours/tasks in training scenarios. Modelling those behaviours, we will generate a pool of generic behavioural patterns and tasks from which we will develop scenarios that are more specific.

Therefore, MAGES SDK introduces several specific Action behaviors that developers can utilize to simulate training scenarios. These are called Action Prototypes and are the following:

Each Action Prototype inherits from BasePrototype, a base class that utilizes a common set of methods and properties for every prototype.