75 lines
2.1 KiB
C++
75 lines
2.1 KiB
C++
// -*-c++-*-
|
|
// SPDX-License-Identifier: LGPL-2.1-only
|
|
// Copyright (C) 2021 James Hogan <james@albanarts.com>
|
|
|
|
#ifndef OSGXR_InteractionProfile
|
|
#define OSGXR_InteractionProfile 1
|
|
|
|
#include <osgXR/Export>
|
|
|
|
#include <osg/Referenced>
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace osgXR {
|
|
|
|
class Action;
|
|
class Manager;
|
|
|
|
/**
|
|
* Represents a group of suggested bindings for a specific interaction profile.
|
|
* This class allow the application to suggest bindings for actions to specific
|
|
* input paths for a given interaction profile. If the OpenXR runtime recognises
|
|
* the profile it may use the suggested bindings to bind actions to whichever
|
|
* input devices the user may have, even without a specific binding to that
|
|
* device.
|
|
*/
|
|
class OSGXR_EXPORT InteractionProfile : public osg::Referenced
|
|
{
|
|
public:
|
|
|
|
/**
|
|
* Construct an interaction profile.
|
|
* The OpenXR interaction profile path is constructed as
|
|
* "/interaction_profiles/@p vendor /@p type ".
|
|
* @param manager The VR manager object to add the action set to.
|
|
* @param vendor Vendor segment of OpenXR interaction profile path.
|
|
* @param type Type segment of OpenXR interaction profile path.
|
|
*/
|
|
InteractionProfile(Manager *manager,
|
|
const std::string &vendor,
|
|
const std::string &type);
|
|
|
|
/// Destructor
|
|
~InteractionProfile();
|
|
|
|
// Accessors
|
|
|
|
/// Get the vendor segment of the OpenXR interaction profile path.
|
|
const std::string &getVendor() const;
|
|
|
|
/// Get the type segment of the OpenXR interaction profile path.
|
|
const std::string &getType() const;
|
|
|
|
/**
|
|
* Suggest a binding for an action.
|
|
* @param action The action to bind.
|
|
* @param binding The OpenXR path to bind the action to.
|
|
*/
|
|
void suggestBinding(Action *action, const std::string &binding);
|
|
|
|
class Private;
|
|
|
|
private:
|
|
|
|
std::unique_ptr<Private> _private;
|
|
|
|
// Copying not permitted
|
|
InteractionProfile(const InteractionProfile ©);
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|