Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
RawController Class Referencefinal

Represents a controller used for debug, where all raw buttons are shown. More...

#include <RawController.hpp>

Public Member Functions

bool activate (int id) override
 
void deactivate () override
 
void update () override
 
- Public Member Functions inherited from Controller
 Controller ()
 Constructor.
 
virtual bool activate (int id)=0
 
virtual void deactivate ()=0
 
virtual void update ()=0
 
bool pressed (const Controller::Input &input) const
 
bool triggered (const Controller::Input &input, bool absorb=false)
 
float axis (const Controller::Input &input) const
 
int id () const
 
std::string name () const
 
std::string guid () const
 
virtual ~Controller ()=default
 Destructor.
 
 Controller (const Controller &)=delete
 
Controlleroperator= (const Controller &)=delete
 
 Controller (Controller &&)=delete
 
Controlleroperator= (Controller &&)=delete
 

Public Attributes

std::vector< float > allAxes
 Raw intensity values on all axes.
 
std::vector< Controller::ControllerButtonallButtons
 State of each button.
 

Private Attributes

int _rawAxesCount = 0
 Number of axes returned by the system.
 
int _rawButtonsCount = 0
 Number of buttons returned by the system.
 

Additional Inherited Members

- Public Types inherited from Controller
enum  Input {
  ButtonX , ButtonY , ButtonA , ButtonB ,
  BumperL1 , TriggerL2 , ButtonL3 , BumperR1 ,
  TriggerR2 , ButtonR3 , ButtonUp , ButtonLeft ,
  ButtonDown , ButtonRight , ButtonLogo , ButtonMenu ,
  ButtonView , PadLeftX , PadLeftY , PadRightX ,
  PadRightY , InputCount
}
 Controller inputs, based on the Xbox controller layout.
 
- Static Public Member Functions inherited from Controller
static void saveConfiguration (const std::string &outputPath, const std::string &guid, const std::string &name, const std::vector< int > &axesMapping, const std::vector< int > &buttonsMapping)
 
static bool parseConfiguration (const std::string &settingsContent, std::vector< int > &axesMapping, std::vector< int > &buttonsMapping)
 
- Protected Member Functions inherited from Controller
void reset ()
 
- Protected Attributes inherited from Controller
ControllerButton _buttons [Controller::Input::InputCount]
 States of all possible buttons.
 
float _axes [Controller::Input::InputCount]
 States of all possible axis.
 
int _id = -1
 Joystick ID (or -1 if no joystick is connected).
 
std::string _name = "Unknown"
 Name of the joystick.
 
std::string _guid = "0x0"
 GUID of the joystick.
 

Detailed Description

Represents a controller used for debug, where all raw buttons are shown.

Inherits Controller.

Member Function Documentation

◆ activate()

bool RawController::activate ( int  id)
overridevirtual

Enable the controller.

Parameters
idthe ID of the controller.
Returns
true if the controller was correctly setup

Implements Controller.

◆ deactivate()

void RawController::deactivate ( )
overridevirtual

Disable the controller.

Implements Controller.

◆ update()

void RawController::update ( )
overridevirtual

Update the internal controller state (once per frame).

Implements Controller.


The documentation for this class was generated from the following files: