reckfellENGINE

OpenXRActionMap

Stored OpenXR action-set and interaction-profile structure.

On this page
class OpenXRActionMapReckfellSharpInherits Resource

OpenXRActionMap stores set/profile resources rather than current controller values. A new instance is empty. Startup loads the map at xr/openxr/default_action_map; creating or saving a different resource does not rebuild an attached XR session.

This complete executed helper creates gameplay/select with two Simple Controller bindings and can save .rdata. It neither enables XR nor simulates a controller:

C#
using Reckfell;

public static class SelectionActionMap
{
    // Caller owns the map. This builds resources; it does not start an XR session.
    public static OpenXRActionMap Create()
    {
        var map = new OpenXRActionMap();
        using var set = new OpenXRActionSet
        {
            ResourceName = "gameplay", LocalizedName = "Gameplay", Priority = 0
        };
        using var select = new OpenXRAction
        {
            ResourceName = "select", LocalizedName = "Select",
            ActionType = OpenXRAction.ActionTypeEnum.Bool,
            ToplevelPaths = ["/user/hand/left", "/user/hand/right"]
        };
        set.AddAction(select);
        map.AddActionSet(set);

        using var profile = new OpenXRInteractionProfile
        {
            InteractionProfilePath = "/interaction_profiles/khr/simple_controller"
        };
        using var left = new OpenXRIPBinding
        {
            Action = select, BindingPath = "/user/hand/left/input/select/click"
        };
        using var right = new OpenXRIPBinding
        {
            Action = select, BindingPath = "/user/hand/right/input/select/click"
        };
        using var bindings = new Reckfell.Collections.Array { left, right };
        profile.Bindings = bindings;
        map.AddInteractionProfile(profile);
        return map;
    }

    public static Error Save(string path = "asset://openxr_action_map.rdata")
    {
        using var map = Create();
        return ResourceSaver.Save(map, path);
    }
}

ActionSets and InteractionProfiles return shared Arrays. Self-assigning such a list clears it because the setter clears the existing container first. Duplicate() the container before replacement. GetActionSets().Clear() also edits the map, without Changed. Prefer Add/Remove methods for ordinary edits. SetActionSets itself emits no Changed. A container copy does not copy resources inside it.

AddActionSet deduplicates one resource identity, not distinct resources with matching names. FindActionSet uses ResourceName; FindInteractionProfile uses the full profile path. A profile belongs to one map and transfers when added elsewhere. CreateDefaultActionSets appends rather than resets: repeated calls create another reckfell set.

Structure, signals, arrays, profile transfer, defaults and saving with independent reload were checked in the installed Windows runtime. OpenXR remained disabled: input, headset profile acceptance, haptics and XR sessions were not tested. See the action-map guide for connection steps.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

OpenXRActionMapConstructor
# OpenXRActionMap
C#
public OpenXRActionMap();

Creates an empty map without sets or profiles. Creates no default actions, XR session or file automatically.

Properties2

ActionSetsProperty
# ActionSets
C#
public Reckfell.Collections.Array ActionSets { get; set; }

Action-set resource list. The getter returns a shared Array, not an independent copy: Clear() edits the map without Changed. The setter clears the current list, then adds valid sets without repeated resource identities; it emits no Changed and does not check ResourceName uniqueness. Assigning its own getter array clears the list. Duplicate() the container before replacement; prefer AddActionSet/RemoveActionSet for ordinary edits.

InteractionProfilesProperty
# InteractionProfiles
C#
public Reckfell.Collections.Array InteractionProfiles { get; set; }

Interaction-profile resource list. The getter returns a shared Array. The setter clears previous ownership links, then adds profiles through AddInteractionProfile; multiple Changed notifications are possible. Self-assignment of the shared array clears the list: use a separate container, such as Duplicate(), for replacement. A profile belongs to one map; moving it removes it from the previous map. These are binding resources, not connected-controller reports.

Methods15

AddActionSetvoid
# AddActionSet
C#
public void AddActionSet(OpenXRActionSet actionSet);

Adds an existing non-null set resource and emits Changed. Repeating the same resource is ignored without a signal. Distinct resources with identical ResourceName are not considered the same set; validate names separately. A set resource can be stored in multiple maps.

Parameters
NameTypeDefault
actionSetOpenXRActionSet—
actionSet

Existing non-null set resource; operations use resource identity rather than matching names.

AddInteractionProfilevoid
# AddInteractionProfile
C#
public void AddInteractionProfile(OpenXRInteractionProfile interactionProfile);

Adds a non-null profile and emits Changed. Repeating the same resource does nothing. If owned by another map, the profile is removed there and transferred here. Prepares resource data; does not register a new profile in a running runtime.

Parameters
NameTypeDefault
interactionProfileOpenXRInteractionProfile—
interactionProfile

Existing non-null profile resource; adding may transfer it from a previous map.

CreateDefaultActionSetsvoid
# CreateDefaultActionSets
C#
public void CreateDefaultActionSets();

Adds the standard reckfell set and default profiles/actions. Does not clear the map: repeated calls create another set with the same name. Use on a new empty map, not as reset. Saves no file and attaches no sets to an XR session.

FindActionSetOpenXRActionSet
# FindActionSet
C#
public OpenXRActionSet FindActionSet(string name);

Returns the first set with the exact ResourceName, or null. Case-sensitive; does not use LocalizedName. Check the result before accessing the set.

Parameters
NameTypeDefault
namestring—
name

Exact ResourceName of the desired set, not LocalizedName.

Returns OpenXRActionSet

First set with the exact ResourceName, or null.

FindInteractionProfileOpenXRInteractionProfile
# FindInteractionProfile
C#
public OpenXRInteractionProfile FindInteractionProfile(string name);

Returns the first profile with the exact InteractionProfilePath, or null. Despite parameter name being name, it expects the full profile path, not ResourceName or a label.

Parameters
NameTypeDefault
namestring—
name

Complete InteractionProfilePath, for example /interaction_profiles/khr/simple_controller.

Returns OpenXRInteractionProfile

First profile with the exact InteractionProfilePath, or null.

GetActionSetOpenXRActionSet
# GetActionSet
C#
public OpenXRActionSet GetActionSet(int idx);

Reads an existing set resource at index 0…GetActionSetCount()-1. References the same resource; editing its properties affects other users. Check bounds before calling.

Parameters
NameTypeDefault
idxint—
idx

Index from 0 inclusive to the corresponding Count exclusive. Check the count before calling.

Returns OpenXRActionSet

Existing set resource at a valid index; not a copy.

GetActionSetCountint
# GetActionSetCount
C#
public int GetActionSetCount();

Number of set resources in this map. Not the count of active sets or sets attached to an XR session.

Returns int

Map-resource set count, initially 0.

GetActionSetsReckfell.Collections.Array
# GetActionSets
C#
public Reckfell.Collections.Array GetActionSets();

Action-set resource list. The getter returns a shared Array, not an independent copy: Clear() edits the map without Changed. The setter clears the current list, then adds valid sets without repeated resource identities; it emits no Changed and does not check ResourceName uniqueness. Assigning its own getter array clears the list. Duplicate() the container before replacement; prefer AddActionSet/RemoveActionSet for ordinary edits.

Returns Reckfell.Collections.Array

Shared map Array; do not clear or assign it back without a separate container copy.

GetInteractionProfileOpenXRInteractionProfile
# GetInteractionProfile
C#
public OpenXRInteractionProfile GetInteractionProfile(int idx);

Reads the profile resource at index 0…GetInteractionProfileCount()-1. Returns the same resource, not an independent copy; check bounds first.

Parameters
NameTypeDefault
idxint—
idx

Index from 0 inclusive to the corresponding Count exclusive. Check the count before calling.

Returns OpenXRInteractionProfile

Existing profile resource at a valid index; not a copy.

GetInteractionProfileCountint
# GetInteractionProfileCount
C#
public int GetInteractionProfileCount();

Number of profiles in the map resource. Not a count of controllers, headsets or profiles supported by a connected runtime.

Returns int

Profile-resource count, initially 0.

GetInteractionProfilesReckfell.Collections.Array
# GetInteractionProfiles
C#
public Reckfell.Collections.Array GetInteractionProfiles();

Interaction-profile resource list. The getter returns a shared Array. The setter clears previous ownership links, then adds profiles through AddInteractionProfile; multiple Changed notifications are possible. Self-assignment of the shared array clears the list: use a separate container, such as Duplicate(), for replacement. A profile belongs to one map; moving it removes it from the previous map. These are binding resources, not connected-controller reports.

Returns Reckfell.Collections.Array

Shared profile Array; directly editing the container changes the map resource.

RemoveActionSetvoid
# RemoveActionSet
C#
public void RemoveActionSet(OpenXRActionSet actionSet);

Removes the supplied resource from this map if present and emits Changed. Does not search by name, destroy external references or disable an attached runtime set.

Parameters
NameTypeDefault
actionSetOpenXRActionSet—
actionSet

Existing non-null set resource; operations use resource identity rather than matching names.

RemoveInteractionProfilevoid
# RemoveInteractionProfile
C#
public void RemoveInteractionProfile(OpenXRInteractionProfile interactionProfile);

Removes an existing profile resource from this map, clears its map ownership and emits Changed. Does nothing when absent. Does not rebuild an attached session’s bindings.

Parameters
NameTypeDefault
interactionProfileOpenXRInteractionProfile—
interactionProfile

Existing non-null profile resource; adding may transfer it from a previous map.

SetActionSetsvoid
# SetActionSets
C#
public void SetActionSets(Reckfell.Collections.Array actionSets);

Action-set resource list. The getter returns a shared Array, not an independent copy: Clear() edits the map without Changed. The setter clears the current list, then adds valid sets without repeated resource identities; it emits no Changed and does not check ResourceName uniqueness. Assigning its own getter array clears the list. Duplicate() the container before replacement; prefer AddActionSet/RemoveActionSet for ordinary edits.

Parameters
NameTypeDefault
actionSetsReckfell.Collections.Array—
actionSets

Separate Array of OpenXRActionSet resources. When starting from this map’s getter, Duplicate() the container first; self-assignment loses the list.

SetInteractionProfilesvoid
# SetInteractionProfiles
C#
public void SetInteractionProfiles(Reckfell.Collections.Array interactionProfiles);

Interaction-profile resource list. The getter returns a shared Array. The setter clears previous ownership links, then adds profiles through AddInteractionProfile; multiple Changed notifications are possible. Self-assignment of the shared array clears the list: use a separate container, such as Duplicate(), for replacement. A profile belongs to one map; moving it removes it from the previous map. These are binding resources, not connected-controller reports.

Parameters
NameTypeDefault
interactionProfilesReckfell.Collections.Array—
interactionProfiles

Separate Array of non-null OpenXRInteractionProfile resources. Do not pass this map’s shared getter array without Duplicate().

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.