Nuclide
Software Development Kit for id Tech
NSXRInput.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016-2022 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
25typedef enum
26{
33
35#define XR_STATUS_ORG (1u<<0)
37#define XR_STATUS_ANG (1u<<1)
39#define XR_STATUS_VEL (1u<<2)
41#define XR_STATUS_AVEL (1u<<3)
42
56class NSXRInput {
57 public:
58 void NSXRInput( void );
59
61 virtual void SetType( xrinput_t );
62
64 virtual void SetParentSpace( NSXRSpace );
65
67 virtual vector GetOrigin( void );
68
70 virtual vector GetAngles( void );
71
73 virtual vector GetVelocity( void );
74
76 virtual vector GetAngularVelocity( void );
77
79 virtual unsigned int GetStatus( void );
80
82 virtual unsigned int GetWeapon( void );
83
85 virtual xrinput_t GetType( void );
86
88 virtual bool IsAvailable( void );
89
91 virtual void InputFrame( void );
92
94 virtual void PrintInfo( void );
95
96 private:
98 NSXRSpace m_xrSpace;
99 vector m_vecOrigin;
100 vector m_vecAngles;
101 vector m_vecVelocity;
102 vector m_vecAVelocity;
103 unsigned int m_iStatus;
104 unsigned int m_iWeapon;
105
106 xrinput_t m_inputType;
107};
xrinput_t
Various input device types.
Definition: NSXRInput.h:26
@ XR_INPUT_RIGHT
Device represents a right hand.
Definition: NSXRInput.h:31
@ XR_INPUT_LEFT
Device represents a left hand.
Definition: NSXRInput.h:30
@ XR_INPUT_UNKNOWN
Unknown device.
Definition: NSXRInput.h:27
@ XR_INPUT_HEAD
Device represents a single head.
Definition: NSXRInput.h:28
This class represents an input device in the world.
Definition: NSXRInput.h:56
virtual vector GetAngularVelocity(void)
Returns the rotational movement of this NSXRInput.
Definition: NSXRInput.qc:63
virtual void PrintInfo(void)
Debug function that can be called every single frame.
Definition: NSXRInput.qc:154
virtual bool IsAvailable(void)
Returns if this NSXRInput is available/active.
Definition: NSXRInput.qc:135
virtual vector GetAngles(void)
Returns the direction this NSXRInput is facing.
Definition: NSXRInput.qc:42
virtual unsigned int GetStatus(void)
Returns the status of the NSXRInput.
Definition: NSXRInput.qc:69
virtual vector GetOrigin(void)
Returns the world space position of this NSXRInput.
Definition: NSXRInput.qc:31
virtual void InputFrame(void)
Run every single input event.
Definition: NSXRInput.qc:87
virtual void SetParentSpace(NSXRSpace)
Sets which NSXRSpace this input belongs to.
Definition: NSXRInput.qc:148
virtual xrinput_t GetType(void)
Returns the type of NSXRInput, check xrinput_t for details.
Definition: NSXRInput.qc:81
void NSXRInput(void)
Definition: NSXRInput.qc:18
virtual void SetType(xrinput_t)
Sets the NSXRInput type.
Definition: NSXRInput.qc:142
virtual unsigned int GetWeapon(void)
Returns the weapon this NSXRInput is wielding.
Definition: NSXRInput.qc:75
virtual vector GetVelocity(void)
Returns the current velocity of this NSXRInput.
Definition: NSXRInput.qc:57
This class represents a local client space in the world.
Definition: NSXRSpace.h:28
vector(vector) normalize