Nuclide
Software Development Kit for id Technology (BETA)
Loading...
Searching...
No Matches
XRInput.h
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
22
25typedef enum : __uint64
26{
27 XR_INPUT_UNKNOWN,
28 XR_INPUT_HEAD,
30 XR_INPUT_LEFT,
31 XR_INPUT_RIGHT
32} xrinput_t;
33
35#define XR_STATUS_ORG (1u<<0u)
37#define XR_STATUS_ANG (1u<<1u)
39#define XR_STATUS_VEL (1u<<2u)
41#define XR_STATUS_AVEL (1u<<3u)
42
59 public:
60 void NSXRInput( void );
61
63 virtual void SetType( xrinput_t );
64
66 virtual void SetParentSpace( NSXRSpace );
67
69 virtual vector GetOrigin( void );
70
72 virtual vector GetAngles( void );
73
75 virtual vector GetVelocity( void );
76
78 virtual vector GetAngularVelocity( void );
79
81 virtual unsigned int GetStatus( void );
82
84 virtual unsigned int GetWeapon( void );
85
87 virtual xrinput_t GetType( void );
88
90 virtual bool IsAvailable( void );
91
93 virtual void InputFrame( void );
94
96 virtual void PrintInfo( void );
97
98 private:
100 NSXRSpace m_xrSpace;
101 vector m_vecOrigin;
102 vector m_vecAngles;
103 vector m_vecVelocity;
104 vector m_vecAVelocity;
105 __uint64 m_iStatus;
106 __uint64 m_iWeapon;
107
108 xrinput_t m_inputType;
109};
virtual vector GetAngularVelocity(void)
Returns the rotational movement of this NSXRInput.
Definition XRInput.qc:67
virtual void PrintInfo(void)
Debug function that can be called every single frame.
Definition XRInput.qc:158
virtual bool IsAvailable(void)
Returns if this NSXRInput is available/active.
Definition XRInput.qc:139
virtual vector GetAngles(void)
Returns the direction this NSXRInput is facing.
Definition XRInput.qc:46
virtual unsigned int GetStatus(void)
Returns the status of the NSXRInput.
Definition XRInput.qc:73
virtual vector GetOrigin(void)
Returns the world space position of this NSXRInput.
Definition XRInput.qc:35
virtual void InputFrame(void)
Run every single input event.
Definition XRInput.qc:91
virtual void SetParentSpace(NSXRSpace)
Sets which NSXRSpace this input belongs to.
Definition XRInput.qc:152
virtual xrinput_t GetType(void)
Returns the type of NSXRInput, check xrinput_t for details.
Definition XRInput.qc:85
void NSXRInput(void)
Definition XRInput.qc:18
virtual void SetType(xrinput_t)
Sets the NSXRInput type.
Definition XRInput.qc:146
virtual unsigned int GetWeapon(void)
Returns the weapon this NSXRInput is wielding.
Definition XRInput.qc:79
virtual vector GetVelocity(void)
Returns the current velocity of this NSXRInput.
Definition XRInput.qc:61
This class represents a local client space in the world.
Definition XRSpace.h:30
void ncEntity(void)
The constructor.
Definition Entity.qc:29