OROCHI
 
Loading...
Searching...
No Matches
GxInputPad.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12#if defined(_WINDOWS)
13#pragma warning ( disable:4668)
14#endif //_WINDOWS
15
16GX_CORE_NAMESPACE_BEGIN()
17
18class GxUnitLocate;
19class GxPadRecorder;
21//===========================================================================
23//===========================================================================
24class GxPad : public GxInputDevice
25{
26 //-------------------------------------------------------------
28 //-------------------------------------------------------------
30public:
31 GX_RTTI_ABSTRACT_CLASS(GxPad, GxInputDevice)
32 // GxClassBase継承クラス用禁止宣言
34
35
36 enum class TOUCH_PANEL
37 {
38 FRONT = 0,
39 MAX,
40 };
41 class GxTouch;
42 class GxMotion;
43
44 class GxVibration;
45
46 // ボタン定義 PS4/PSP2 | XBOX
47 static constexpr u32 BUTTON_NULL = 0;
48 static constexpr u32 SELECT = (1 << 0);
49 static constexpr u32 START = (1 << 1);
50 static constexpr u32 LEFT_UP = (1 << 2);
51 static constexpr u32 LEFT_RIGHT = (1 << 3);
52 static constexpr u32 LEFT_DOWN = (1 << 4);
53 static constexpr u32 LEFT_LEFT = (1 << 5);
54 static constexpr u32 RIGHT_UP = (1 << 6);
55 static constexpr u32 RIGHT_RIGHT = (1 << 7);
56 static constexpr u32 RIGHT_DOWN = (1 << 8);
57 static constexpr u32 RIGHT_LEFT = (1 << 9);
58 static constexpr u32 LEFT_1 = (1 << 10);
59 static constexpr u32 RIGHT_1 = (1 << 11);
60 static constexpr u32 LEFT_2 = (1 << 12);
61 static constexpr u32 RIGHT_2 = (1 << 13);
62 static constexpr u32 LEFT_3 = (1 << 14);
63 static constexpr u32 RIGHT_3 = (1 << 15);
64
65 // アナログスティック定義
66 static constexpr u32 STICK_LEFT_UP = (1 << 16);
67 static constexpr u32 STICK_LEFT_RIGHT = (1 << 17);
68 static constexpr u32 STICK_LEFT_DOWN = (1 << 18);
69 static constexpr u32 STICK_LEFT_LEFT = (1 << 19);
70 static constexpr u32 STICK_RIGHT_UP = (1 << 20);
71 static constexpr u32 STICK_RIGHT_RIGHT = (1 << 21);
72 static constexpr u32 STICK_RIGHT_DOWN = (1 << 22);
73 static constexpr u32 STICK_RIGHT_LEFT = (1 << 23);
74
75 // 決定/キャンセルボタン定義
76 static constexpr u32 OK = (1 << 24);
77 static constexpr u32 CANCEL = (1 << 25);
78
79 // NX
80 static constexpr u32 MINUS_NX = (1 << 0);
81 static constexpr u32 PLUS_NX = (1 << 1);
82 static constexpr u32 LEFT_SL_NX = (1 << 26);
83 static constexpr u32 LEFT_SR_NX = (1 << 27);
84 static constexpr u32 RIGHT_SL_NX = (1 << 28);
85 static constexpr u32 RIGHT_SR_NX = (1 << 29);
86
87 // アナログスティック軸定義
88 static constexpr u32 STICK_LEFT_AXIS_X = 0;
89 static constexpr u32 STICK_LEFT_AXIS_Y = 1;
90 static constexpr u32 STICK_RIGHT_AXIS_X = 2;
91 static constexpr u32 STICK_RIGHT_AXIS_Y = 3;
92
93 // 全てのボタン定義
94 static constexpr u32 BUTTON_ALL = 0xFFFFFFFF;
95 // 物理ボタン最大数
96 static constexpr u32 PHISICAL_BUTTON_MAX = 24;
97 // ボタン最大数
98 static constexpr u32 BUTTON_MAX = 26;
99 // アナログスティックの最大値
100 static constexpr s32 STICK_VALUE_MAX = 32767;
101 // アナログスティックの最小値
102 static constexpr s32 STICK_VALUE_MIN = -32768;
103 // アナログトリガーの最大値
104 static constexpr u32 TRIGGER_VALUE_MAX = 255;
106 enum class PAD_RECORDER
107 {
108 STOP = 0,
109 RECORD,
110 PLAY,
111 };
113 struct GxInputData : public GxStructBase
114 {
115 //-------------------------------------------------------------
117 //-------------------------------------------------------------
119
120 GX_RTTI_STRUCT(GxInputData);
121
123 //-------------------------------------------------------------
125 //-------------------------------------------------------------
127
129 GX_FORCE_INLINE void clear(void){ GX_MEMSET(this, 0, sizeof(GxInputData)); }
130
132 //-------------------------------------------------------------
134 //-------------------------------------------------------------
136
137 u32 _on;
144
146 };
149 {
150 //-------------------------------------------------------------
152 //-------------------------------------------------------------
154
156 u32 _old;
158 s32 _repeatCount[BUTTON_MAX];
163
165 };
168 {
169 //-------------------------------------------------------------
171 //-------------------------------------------------------------
173
174 GX_RTTI_STRUCT(GxMarginData)
175
176
177 //-------------------------------------------------------------
179 //-------------------------------------------------------------
181
183 GxMarginData(void);
184
186 //-------------------------------------------------------------
188 //-------------------------------------------------------------
190
197
204
211
213 };
214
215#if defined(_PS4) || defined(_PS5)
217 struct GxTrackerData : public GxStructBase
218 {
219 //-------------------------------------------------------------
221 //-------------------------------------------------------------
223 public:
224 GX_RTTI_STRUCT(GxTrackerData)
225
226
227 //-------------------------------------------------------------
229 //-------------------------------------------------------------
231
233 GxTrackerData(void){ clear(); }
235 GX_FORCE_INLINE void clear(void){ _poseMatrix = GxMatrix44::IDENTITY; }
236
238 //-------------------------------------------------------------
240 //-------------------------------------------------------------
242
243 GxMatrix44 _poseMatrix;
244
246 };
247#endif // _PS4
248
250 GX_FORCE_INLINE static s32 RatioToStick(f32 ratio) { return static_cast<s32>(static_cast<f32>(STICK_VALUE_MAX) * ratio); }
252 GX_FORCE_INLINE static s32 RatioToTrigger(f32 ratio) { return static_cast<s32>(static_cast<f32>(TRIGGER_VALUE_MAX) * ratio); }
253
255 //-------------------------------------------------------------
257 //-------------------------------------------------------------
259
261 GxPad(void);
263 ~GxPad(void) override;
265 b32 initialize(void) override;
267 void clear(void) override;
268
270 //-----------------------------------------------------------
272 //-----------------------------------------------------------
274
276 void getInputDataDevice(void) override;
278 void update(void) override;
279#if GX_DEVELOP
281 void startRecord(void);
282#endif //GX_DEVELOP
284 void startPlay(void);
286 void stopPadRecorder(void);
288 void saveInput(void) override;
290 void loadInput(void) override;
291#if GX_DEVELOP
293 void developRender(void) override {}
294protected:
296 void developRenderButton(const GxPoint2& position);
298 GX_FORCE_INLINE void getRatioStickLeftXProperty(void* const pValue) const { *static_cast<f32*>(pValue) = getRatioStickLeftX(); }
300 GX_FORCE_INLINE void getRatioStickLeftYProperty(void* const pValue) const { *static_cast<f32*>(pValue) = getRatioStickLeftY(); }
302 GX_FORCE_INLINE void getRatioStickRightXProperty(void* const pValue) const { *static_cast<f32*>(pValue) = getRatioStickRightX(); }
304 GX_FORCE_INLINE void getRatioStickRightYProperty(void* const pValue) const { *static_cast<f32*>(pValue) = getRatioStickRightY(); }
306 GX_FORCE_INLINE void getRatioTriggerLeftProperty(void* const pValue) const { *static_cast<f32*>(pValue) = getRatioTriggerLeft(); }
308 GX_FORCE_INLINE void getRatioTriggerRightProperty(void* const pValue) const { *static_cast<f32*>(pValue) = getRatioTriggerRight(); }
309#endif //GX_DEVELOP
310protected:
312 virtual void updateTouch(void);
314 virtual void updateMotion(void);
316 virtual void updateVibration(void);
317private:
319 void loadResourceRecorder(PAD_RECORDER padRecorder);
320
322 //-----------------------------------------------------------
324 //-----------------------------------------------------------
326public:
328 GX_FORCE_INLINE const GxInputData& getInputData(void) const { return _inputData; }
330 GX_FORCE_INLINE void setInputData(const GxInputData& inputData){ GX_MEMCPY(&_inputData, &inputData, sizeof(GxInputData)); }
331
333 GX_FORCE_INLINE s32 getStickLeftX(void) const { return _inputData._stickLeftX; }
335 GX_FORCE_INLINE s32 getStickLeftY(void) const { return _inputData._stickLeftY; }
337 GX_FORCE_INLINE s32 getStickRightX(void) const { return _inputData._stickRightX; }
339 GX_FORCE_INLINE s32 getStickRightY(void) const { return _inputData._stickRightY; }
341 GX_FORCE_INLINE u8 getTriggerLeft(void) const { return _inputData._triggerLeft; }
343 GX_FORCE_INLINE u8 getTriggerRight(void) const { return _inputData._triggerRight; }
344
346 GX_FORCE_INLINE b32 isOn(u32 bit = BUTTON_ALL) const { return (_inputData._on & bit) ? true : false; }
348 GX_FORCE_INLINE b32 isOld(u32 bit = BUTTON_ALL) const { return (_old & bit) ? true : false; }
350 GX_FORCE_INLINE b32 isTrigger(u32 bit = BUTTON_ALL) const { return (_trigger & bit) ? true : false; }
352 GX_FORCE_INLINE b32 isRelease(u32 bit = BUTTON_ALL) const { return (_release & bit) ? true : false; }
354 GX_FORCE_INLINE b32 isChange(u32 bit = BUTTON_ALL) const { return (_change & bit) ? true : false; }
356 GX_FORCE_INLINE b32 isRepeat(u32 bit = BUTTON_ALL) const { return (_repeat & bit) ? true : false; }
357
358 // 互換性のため On/Off, アナログ, XY軸を同じ値で設定する
360 constexpr void setMarginStickLeft(u32 margin){ _margin._stickLeftAnalogX = _margin._stickLeftAnalogY = _margin._stickLeftX = _margin._stickLeftY = static_cast<s32>(margin); }
362 constexpr void setMarginStickRight(u32 margin){ _margin._stickRightAnalogX = _margin._stickRightAnalogY = _margin._stickRightX = _margin._stickRightY = static_cast<s32>(margin); }
364 constexpr void setMarginTriggerLeft(u8 margin){ _margin._triggerLeftAnalog = _margin._triggerLeft = margin; }
366 constexpr void setMarginTriggerRight(u8 margin){ _margin._triggerRightAnalog = _margin._triggerRight = margin; }
367
369 constexpr void setMarginStickLeftOnOff(u32 marginX, u32 marginY){ _margin._stickLeftX = static_cast<s32>(marginX); _margin._stickLeftY = static_cast<s32>(marginY); }
371 constexpr void setMarginStickRightOnOff(u32 marginX, u32 marginY){ _margin._stickRightX = static_cast<s32>(marginX); _margin._stickRightY = static_cast<s32>(marginY); }
373 constexpr void setMarginTriggerLeftOnOff(u8 margin){ _margin._triggerLeft = margin; }
375 constexpr void setMarginTriggerRightOnOff(u8 margin){ _margin._triggerRight = margin; }
376
378 constexpr void setMarginStickLeftAnalog(u32 marginX, u32 marginY){ _margin._stickLeftAnalogX = static_cast<s32>(marginX); _margin._stickLeftAnalogY = static_cast<s32>(marginY); }
380 constexpr void setMarginStickRightAnalog(u32 marginX, u32 marginY){ _margin._stickRightAnalogX = static_cast<s32>(marginX); _margin._stickRightAnalogY = static_cast<s32>(marginY); }
382 constexpr void setMarginTriggerLeftAnalog(u8 margin){ _margin._triggerLeftAnalog = margin; }
384 constexpr void setMarginTriggerRightAnalog(u8 margin){ _margin._triggerRightAnalog = margin; }
385
387 constexpr void setMarginStickLeftClip(u32 clipX, u32 clipY){ _margin._stickLeftClipX = static_cast<s32>(clipX); _margin._stickLeftClipY = static_cast<s32>(clipY); }
389 constexpr void setMarginStickRightClip(u32 clipX, u32 clipY){ _margin._stickRightClipX = static_cast<s32>(clipX); _margin._stickRightClipY = static_cast<s32>(clipY); }
391 constexpr void setMarginTriggerLeftClip(u8 clip){ _margin._triggerLeftClip = clip; }
393 constexpr void setMarginTriggerRightClip(u8 clip){ _margin._triggerRightClip = clip; }
394
396 GX_FORCE_INLINE f32 getRatioStickLeftX(void) const { return getRatioStick(_inputData._stickLeftX, _margin._stickLeftAnalogX, _margin._stickLeftClipX); }
398 GX_FORCE_INLINE f32 getRatioStickLeftY(void) const { return getRatioStick(_inputData._stickLeftY, _margin._stickLeftAnalogY, _margin._stickLeftClipY); }
400 GX_FORCE_INLINE f32 getRatioStickRightX(void) const { return getRatioStick(_inputData._stickRightX, _margin._stickRightAnalogX, _margin._stickRightClipX); }
402 GX_FORCE_INLINE f32 getRatioStickRightY(void) const { return getRatioStick(_inputData._stickRightY, _margin._stickRightAnalogY, _margin._stickRightClipY); }
404 GX_FORCE_INLINE f32 getRatioTriggerLeft(void) const { return getRatioTrigger(_inputData._triggerLeft, _margin._triggerLeftAnalog, _margin._triggerLeftClip); }
406 GX_FORCE_INLINE f32 getRatioTriggerRight(void) const { return getRatioTrigger(_inputData._triggerRight, _margin._triggerRightAnalog, _margin._triggerRightClip); }
407
409 constexpr GxResPadRecorder* getResourcePadRecorder(void) const { return _pResourceRecorder; }
411 constexpr PAD_RECORDER getPadRecorderStatus(void) const { return _recorderStatus; }
412protected:
414 void setResourcePadRecorder(GxResPadRecorder* pResource);
416 f32 getRatioStick(s32 value, s32 margin, s32 clip = 0) const;
418 f32 getRatioTrigger(s32 value, s32 margin, s32 clip = 0) const;
420 GX_FORCE_INLINE b32 isOk(void) override { return isTrigger(OK); }
422 GX_FORCE_INLINE b32 isCancel(void) override { return isTrigger(CANCEL); }
423public:
425 constexpr GxTouch* getTouch(TOUCH_PANEL panel) const { return _pTouch[static_cast<s32>(panel)]; }
427 constexpr GxMotion* getMotion(void) const { return _pMotion; }
428
429#if defined(_PS4)
431 constexpr GxTrackerData* getTrackerData(void) const { return _pTrackerData; }
432#endif // _PS4
433
435 constexpr GxVibration* getVibration(void) const { return _pVibration; }
436
438 constexpr GxUnitLocate* getUnit(void) const { return _pUnit; }
440 constexpr void setUnit(GxUnitLocate* pUnit){ _pUnit = pUnit; }
441
443 //-------------------------------------------------------------
445 //-------------------------------------------------------------
447protected:
449 u32 _old;
451
452private:
453 GxPadRecorder* _pRecorder;
454 GxResPadRecorder* _pResourceRecorder;
455 PAD_RECORDER _recorderStatus;
456 s32 _repeatCount[BUTTON_MAX];
457 u32 _trigger;
458 u32 _release;
459 u32 _change;
460 u32 _repeat;
461 GxMarginData _margin;
462 GxSaveData _saveData;
463 GxUnitLocate* _pUnit;
464
465protected:
467protected:
468 GxTouch* _pTouch[static_cast<s32>(TOUCH_PANEL::MAX)];
470#if defined(_PS4) || defined(_PS5)
471 GxTrackerData* _pTrackerData;
472#endif // _PS4 || _PS5
474};
475
476//===========================================================================
478//===========================================================================
480{
481 //-------------------------------------------------------------
483 //-------------------------------------------------------------
485public:
486 GX_RTTI_CLASS(GxPad::GxVibration, GxClassBase)
487 // GxClassBase継承クラス用禁止宣言
489
490
491 enum class MOTOR
492 {
493 LEFT = 0,
494 RIGHT,
495 MAX,
496
497 BIG = LEFT,
498 SMALL = RIGHT,
499 };
500
502 class GxMotor : public GxClassBase
503 {
504 //-------------------------------------------------------------
506 //-------------------------------------------------------------
508 public:
509 GX_RTTI_CLASS(GxMotor, GxClassBase)
510 // GxClassBase継承クラス用禁止宣言
512
513
515 {
516 //-------------------------------------------------------------
518 //-------------------------------------------------------------
520 public:
521 GX_RTTI_CLASS(GxInformation, GxClassBase)
522
523
524 //-------------------------------------------------------------
526 //-------------------------------------------------------------
528
530 GxInformation(void) : _time(0.f), _power(0.f){}
532 ~GxInformation(void) override {}
534 const GxInformation& operator = (const GxInformation& information);
535
537 //-------------------------------------------------------------
539 //-------------------------------------------------------------
541
542 f32 _time;
543 f32 _power;
544#if defined(_NX64)
545 GxNativeInputVibration _vibration;
546#endif // _NX64
547
549 };
551 static constexpr u32 VIBRATION_DATA_MAX = 16;
553 static const f32 STOP_TIME;
555 static const f32 INVALID_TIME;
556
558 //-------------------------------------------------------------
560 //-------------------------------------------------------------
562
564 GxMotor(void);
566 ~GxMotor(void) override {}
567
569 //-------------------------------------------------------------
571 //-------------------------------------------------------------
573
575 void update(void);
577 void addRequest(f32 time, f32 power);
578
579#if defined(_NX64)
581 void addRequest(f32 time, const GxNativeInputVibration& value);
582#endif // _NX64
583
585 GX_FORCE_INLINE void stop(void){ addRequest(STOP_TIME, 0.0f); }
586
587 private:
589 void clear(void);
590
592 //-------------------------------------------------------------
594 //-------------------------------------------------------------
596 public:
598 constexpr f32 getPower(void) const { return _power; }
599
600#if defined(_NX64)
602 GX_FORCE_INLINE const GxNativeInputVibration& getValue(void) const { return _nativeVibration; }
603#endif // _NX64
604
606 //-------------------------------------------------------------
608 //-------------------------------------------------------------
610 private:
611 GxInformation _vibration[VIBRATION_DATA_MAX];
612 GxInformation _request[GxThread::HARDWARE_THREAD_MAX][VIBRATION_DATA_MAX];
613 f32 _power;
614#if defined(_NX64)
615 GxNativeInputVibration _nativeVibration;
616#endif // _NX64
618 };
619
621 //-------------------------------------------------------------
623 //-------------------------------------------------------------
625
627 GxVibration(void);
629 ~GxVibration(void) override {}
630
632 //-------------------------------------------------------------
634 //-------------------------------------------------------------
636
638 void update(void);
639
640#if defined(_NX64)
642 void updateStyle(const GxNativePadId& padId);
644 void apply(void);
645#endif // _NX64
646
648 //-------------------------------------------------------------
650 //-------------------------------------------------------------
652
654 GX_FORCE_INLINE GxMotor* getMotor(MOTOR motor){ return &_motor[static_cast<s32>(motor)]; }
655
656#if defined(_NX64)
658 // JoyConの形態が分かっていれば getMotor() を使用しても良い
659 GxMotor* getMotorLeft(void);
661 // 振動が1つしかない形態では getMotorLeft() と同じポインタを返す
662 GxMotor* getMotorRight(void);
664 constexpr u32 getHandleCount(void) const { return _handleCount; }
665#endif // _NX64
666
668 //-------------------------------------------------------------
670 //-------------------------------------------------------------
672private:
673 GxMotor _motor[static_cast<s32>(MOTOR::MAX)];
674
675#if defined(_NX64)
676 GxNativeInputVibrationHandle _handles[static_cast<s32>(MOTOR::MAX)];
677 u32 _handleCount;
678#endif // _NX64
679
681};
682
684#if !defined(GX_TOUCH_POINT_MAX)
685#define GX_TOUCH_POINT_MAX 6
686#endif // !GX_TOUCH_POINT_MAX
687
688//===========================================================================
690//===========================================================================
692{
693 //-------------------------------------------------------------
695 //-------------------------------------------------------------
697public:
698 GX_RTTI_CLASS(GxPad::GxTouch, GxClassBase)
699 // GxClassBase継承クラス用禁止宣言
701
702private:
703#if defined(_PS4) || defined(_WINDOWS) || defined(_PS5)
704 friend class GxPadPs4;
705
707 struct GxTouchInformation : public GxStructBase
708 {
709 //-------------------------------------------------------------
711 //-------------------------------------------------------------
713 public:
714 GX_RTTI_STRUCT(GxTouchInformation)
715
716
717 struct GxTouchResolution : public GxStructBase
718 {
719 //-------------------------------------------------------------
721 //-------------------------------------------------------------
723 public:
724 GX_RTTI_STRUCT(GxTouchResolution)
725
726
727 //-------------------------------------------------------------
729 //-------------------------------------------------------------
731
732 u16 _x;
733 u16 _y;
734
736 };
737
739 //-------------------------------------------------------------
741 //-------------------------------------------------------------
743
744 f32 _pixelDensity;
745 GxTouchResolution _resolution;
746
748 };
749#endif //_PS4 || _WINDOWS || _PS5
750
752 struct GxTouchPointData : public GxStructBase
753 {
754 //-------------------------------------------------------------
756 //-------------------------------------------------------------
758 public:
759 GX_RTTI_STRUCT(GxTouchPointData)
760
761
762 //-------------------------------------------------------------
764 //-------------------------------------------------------------
766
767 s16 _x;
768 s16 _y;
769
770 //TODO:refactoring:move platform-specific code to sub-classes
771#if defined(_PS4) || defined(_WINDOWS) || defined(_NX64) || defined(_PS5)
772 u8 _id;
773#endif //_PS4 || _WINDOWS || _NX64 || _PS5
774
776 };
777
779 struct GxTouchData : public GxStructBase
780 {
781 //-------------------------------------------------------------
783 //-------------------------------------------------------------
785 public:
786 GX_RTTI_STRUCT(GxTouchData)
787
788
789 //-------------------------------------------------------------
791 //-------------------------------------------------------------
793
795 GX_FORCE_INLINE void clear(void){ GX_MEMSET(this, 0, sizeof(GxTouchData)); }
796
798 //-------------------------------------------------------------
800 //-------------------------------------------------------------
802
803 u32 _positionCount;
804 GxTouchPointData _point[GX_TOUCH_POINT_MAX];
805
807 };
808
810 //-------------------------------------------------------------
812 //-------------------------------------------------------------
814public:
816 GxTouch(void);
818 GxTouch(u32 panelNo);
820 ~GxTouch(void) override {}
822 void initialize(void);
823
825 //-------------------------------------------------------------
827 //-------------------------------------------------------------
829
831 void update(void);
832private:
834 void clear(void);
836 void outputError(s32 error);
837
839 //-------------------------------------------------------------
841 //-------------------------------------------------------------
843public:
845 GX_FORCE_INLINE b32 isEnable(void) const { return _enable; }
847 void setEnable(b32 on);
848
850 constexpr u32 getTouchCount(void) const { return _touchData._positionCount; }
852 GX_FORCE_INLINE GxPoint2 getPoint(u32 pointNo) const { return GxPoint2(static_cast<s32>(_touchData._point[pointNo]._x), static_cast<s32>(_touchData._point[pointNo]._y)); }
853
854#if defined(_PS4) || defined(_WINDOWS) || defined(_PS5)
856 constexpr s32 getHandle(void) const { return _handle; }
858 constexpr void setHandle(s32 handle){ _handle = handle; }
860 constexpr f32 getTouchPixelDensity(void) const { return _touchInformation._pixelDensity; }
862 GX_FORCE_INLINE GxPoint2 getTouchResolution(void) const { return GxPoint2(_touchInformation._resolution._x, _touchInformation._resolution._y); }
863#endif //_PS4 || _WINDOWS || _PS5
865 //-------------------------------------------------------------
867 //-------------------------------------------------------------
869private:
870#if defined(_PS4) || defined(_WINDOWS) || defined(_PS5)
871 GxTouchInformation _touchInformation;
872#endif //_PS4 || _WINDOWS || _PS5
873 GxTouchData _touchData;
874 b32 _enable;
875
876#if defined(_WINDOWS) || defined(_PS4) || defined(_PS5)
877 s32 _handle;
878#endif //_WINDOWS || _PS4 || _PS5
880};
881
882//===========================================================================
884//===========================================================================
886{
887 //-------------------------------------------------------------
889 //-------------------------------------------------------------
891public:
892 GX_RTTI_CLASS(GxPad::GxMotion, GxClassBase)
893 // GxClassBase継承クラス用禁止宣言
895
896private:
897#if defined(_WINDOWS) || defined(_PS4) || defined(_PS5)
898 friend class GxPadPs4;
899#elif defined(_NX64)
900 friend class GxPadNX;
901 static constexpr u32 SENSOR_HANDLE_COUNT_MAX = 2; // LR
902#endif //_NX64
903
905 struct GxLocationData : public GxStructBase
906 {
907 //-------------------------------------------------------------
909 //-------------------------------------------------------------
911 public:
912 GX_RTTI_STRUCT(GxLocationData)
913
914
915 //-------------------------------------------------------------
917 //-------------------------------------------------------------
919
920 GxVector3 _accelerometer;
921 GxVector3 _gyro;
922
924 };
926 struct GxMotionData : public GxStructBase
927 {
928 //-------------------------------------------------------------
930 //-------------------------------------------------------------
932 public:
933 GX_RTTI_STRUCT(GxMotionData)
934
935
936 //-------------------------------------------------------------
938 //-------------------------------------------------------------
940
942 GX_FORCE_INLINE void clear(void) { GX_MEMSET(this, 0, sizeof(GxMotionData)); }
943
945 //-------------------------------------------------------------
947 //-------------------------------------------------------------
949
950 GxVector3 _acceleration;
951 GxVector3 _angularVelocity;
952 GxQuaternion _deviceQuaternion;
953#if defined(_NX64)
954 GxVector3 _angle;
955#endif // _NX64
956
958 };
959
961 //-------------------------------------------------------------
963 //-------------------------------------------------------------
965public:
967 GxMotion(void);
969 ~GxMotion(void) override;
970
972 //-------------------------------------------------------------
974 //-------------------------------------------------------------
976
978 void update(void);
979private:
981 void outputError(s32 error);
982
984 //-------------------------------------------------------------
986 //-------------------------------------------------------------
988public:
990 GX_FORCE_INLINE b32 isEnable(void) const { return _enable; }
992 void setEnable(b32 on);
993
995 GX_FORCE_INLINE const GxVector3& getAcceleration(void) const { return _motionData._acceleration; }
997 GX_FORCE_INLINE const GxVector3& getAngularVelocity(void) const { return _motionData._angularVelocity; }
999 GX_FORCE_INLINE const GxQuaternion& getRotationQuaternion(void) const { return _motionData._deviceQuaternion; }
1000
1001#if defined(_NX64)
1003 GX_FORCE_INLINE const GxVector3& getAccelerationLeft(void) const { return _motionData._acceleration; }
1005 GX_FORCE_INLINE const GxVector3& getAngularVelocityLeft(void) const { return _motionData._angularVelocity; }
1007 GX_FORCE_INLINE const GxQuaternion& getRotationQuaternionLeft(void) const { return _motionData._deviceQuaternion; }
1009 GX_FORCE_INLINE const GxVector3& getAngleLeft(void) const { return _motionData._angle; }
1010
1012 GX_FORCE_INLINE const GxVector3& getAccelerationRight(void) const { return _motionData2._acceleration; }
1014 GX_FORCE_INLINE const GxVector3& getAngularVelocityRight(void) const { return _motionData2._angularVelocity; }
1016 GX_FORCE_INLINE const GxQuaternion& getRotationQuaternionRight(void) const { return _motionData2._deviceQuaternion; }
1018 GX_FORCE_INLINE const GxVector3& getAngleRight(void) const { return _motionData2._angle; }
1019
1021 constexpr u32 getHandleCount(void) const { return _handleCount; }
1023 const nn::hid::SixAxisSensorState* getSensorStateRawLeft(void) const;
1025 const nn::hid::SixAxisSensorState* getSensorStateRawRight(void) const;
1026
1027private:
1029 void setSensorEnable(b32 on);
1031 void updateStyle(const GxNativePadId& padId);
1032#endif // _NX64
1033
1035 //-------------------------------------------------------------
1037 //-------------------------------------------------------------
1039private:
1040 GxMotionData _motionData;
1041#if defined(_NX64)
1042 GxMotionData _motionData2;
1043 GxNativePadAxisState _states[SENSOR_HANDLE_COUNT_MAX][GX_TOUCH_POINT_MAX];
1044 GxNativePadAxisHandle _handles[SENSOR_HANDLE_COUNT_MAX];
1045 u32 _handleCount;
1046#endif // _NX64
1047
1048 b32 _enable;
1049
1051};
1052
1053#if defined(_WINDOWS) || defined(_XBOX_XS)
1054//===========================================================================
1056//===========================================================================
1057class GxPadXbox : public GxPad
1058{
1059 //-------------------------------------------------------------
1061 //-------------------------------------------------------------
1063public:
1064 GX_RTTI_CLASS(GxPadXbox, GxPad)
1065 // GxClassBase継承クラス用禁止宣言
1066 GX_PROHIBIT_CLASS_BASE(GxPadXbox);
1067private:
1069 static constexpr s32 RETRY_WAIT_COUNT = 30;
1070
1072 //-------------------------------------------------------------
1074 //-------------------------------------------------------------
1076public:
1078 GxPadXbox(void) : _enableFlag(false){}
1080 ~GxPadXbox(void) override {}
1082 b32 initialize(void) override;
1084 GX_FORCE_INLINE void clear(void) override { Super::clear(); }
1085
1087 //-----------------------------------------------------------
1089 //-----------------------------------------------------------
1091
1093 void getInputDataDevice(void) override;
1094protected:
1096 void updateVibration(void) override;
1097
1099 //-----------------------------------------------------------
1101 //-----------------------------------------------------------
1103public:
1105 GX_FORCE_INLINE b32 isEnable(void) const override { return _enableFlag; }
1106
1108 //-------------------------------------------------------------
1110 //-------------------------------------------------------------
1112private:
1113 s32 _retryWaitCounter;
1114 b32 _enableFlag;
1115
1117};
1118#endif //_WINDOWS || _XBOX_XS
1119
1120#if defined(_WINDOWS) || defined(_PS4) || defined(_PS5)
1121//===========================================================================
1123//===========================================================================
1124class GxPadPs4 : public GxPad
1125{
1126 //-------------------------------------------------------------
1128 //-------------------------------------------------------------
1130public:
1131 GX_RTTI_CLASS(GxPadPs4, GxPad)
1132 // GxClassBase継承クラス用禁止宣言
1133 GX_PROHIBIT_CLASS_BASE(GxPadPs4);
1134
1135 friend class GxSysInput;
1136
1138 //-------------------------------------------------------------
1140 //-------------------------------------------------------------
1142public:
1144 GxPadPs4(void);
1146 ~GxPadPs4(void) override {}
1148 b32 initialize(void) override;
1149
1151 //-----------------------------------------------------------
1153 //-----------------------------------------------------------
1156 void getInputDataDevice(void) override;
1157
1159 static b32 loadPadFunctions(void);
1161 static void unloadPadFunctions(void);
1162
1163protected:
1165 void updateVibration(void) override;
1166
1168 void updateEnable(void);
1169
1171 void updateRegistrationOfTracking(void);
1172
1174 virtual void onChangeUserId(void);
1175
1177 //-----------------------------------------------------------
1179 //-----------------------------------------------------------
1181public:
1182 // ユーザーIDは GxSysInput で管理される
1184 GX_FORCE_INLINE s32 getUserId(void) const override { return _userId; }
1186 void setUserId(s32 id) override;
1187
1189 GX_FORCE_INLINE b32 isEnable(void) const override { return _isEnable; }
1191 GX_FORCE_INLINE virtual void setEnable(b32 isEnable) { _isEnable = isEnable; }
1192
1194 GX_FORCE_INLINE virtual s32 getHandle(void) const { return _handle; }
1196 GX_FORCE_INLINE virtual void setHandle(s32 handle) { _handle = handle; }
1197
1199 GX_FORCE_INLINE static b32 isUseVrTracker(void) { return _isUseVrTracker; }
1201 GX_FORCE_INLINE static void setUseVrTracker( b32 isUse ){ _isUseVrTracker = isUse; }
1202
1203public:
1205 // (デフォルトは true でデッドゾーンは無反応)
1206 GX_FORCE_INLINE void setStickClamp(b32 enable) { _isStickClamp = enable; }
1208 // デバイス固有の値は 0~255 の範囲で中心は 128 になります。
1209 constexpr u8 getStickDeadZoneLeft(void) const { return _deadZoneLeft; }
1211 // デバイス固有の値は 0~255 の範囲で中心は 128 になります。
1212 constexpr u8 getStickDeadZoneRight(void) const { return _deadZoneRight; }
1213
1215 //-------------------------------------------------------------
1217 //-------------------------------------------------------------
1219private:
1220 b32 _isStickClamp;
1221 u8 _deadZoneLeft;
1222 u8 _deadZoneRight;
1223
1224 b32 _isEnable;
1225 s32 _handle;
1226 s32 _userId;
1227
1228 static b32 _isUseVrTracker;
1229
1230 b32 _isRegisteredToVrTracker;
1231
1233};
1234#endif //_WINDOWS || _PS4 || _PS5
1235
1236#if defined(_NX64)
1237//===========================================================================
1239//===========================================================================
1240class GxPadNX : public GxPad
1241{
1242 //-------------------------------------------------------------
1244 //-------------------------------------------------------------
1246public:
1247 GX_RTTI_CLASS(GxPadNX, GxPad)
1248 // GxClassBase継承クラス用禁止宣言
1249 GX_PROHIBIT_CLASS_BASE(GxPadNX)
1250
1251
1252 enum class PAD_STYLE
1253 {
1254 UNKNOWN,
1255 FULLKEY,
1256 HANDHELD,
1257 HANDHELD_DUAL,
1258 DUAL,
1259 LEFT,
1260 RIGHT,
1261 };
1262
1264 enum PAD_STYLE_MASK
1265 {
1266 PAD_STYLE_MASK_FULLKEY = 0x01,
1267 PAD_STYLE_MASK_DUAL = 0x02,
1268 PAD_STYLE_MASK_LEFT = 0x04,
1269 PAD_STYLE_MASK_RIGHT = 0x08,
1270 };
1271
1273 //-------------------------------------------------------------
1275 //-------------------------------------------------------------
1277public:
1279 GxPadNX(void);
1281 ~GxPadNX(void) override {}
1283 b32 initialize(void) override;
1284
1286 //-----------------------------------------------------------
1288 //-----------------------------------------------------------
1290protected:
1292 void updatePadColor(PAD_STYLE newStyle);
1293
1295 void getInputDataDevice(void) override;
1296
1298 void updateVibration(void) override;
1299
1301 //-----------------------------------------------------------
1303 //-----------------------------------------------------------
1305public:
1307 GX_FORCE_INLINE b32 isEnable(void) const override { return _enableFlag; }
1309 constexpr GxNativePadId getNpadId(void) const { return _padId; }
1311 constexpr PAD_STYLE getStyle(void) const { return _style; }
1313 GX_FORCE_INLINE const GxColor& getMainColorLeft(void) const { return _mainColorL; }
1315 GX_FORCE_INLINE const GxColor& getSubColorLeft(void) const { return _subColorL; }
1317 GX_FORCE_INLINE const GxColor& getMainColorRight(void) const { return _mainColorR; }
1319 GX_FORCE_INLINE const GxColor& getSubColorRight(void) const { return _subColorR; }
1320
1322 //-------------------------------------------------------------
1324 //-------------------------------------------------------------
1326private:
1327 b32 _enableFlag;
1328 PAD_STYLE _style;
1329 GxColor _mainColorL;
1330 GxColor _subColorL;
1331 GxColor _mainColorR;
1332 GxColor _subColorR;
1333 GxNativePadId _padId;
1334
1336};
1337#endif //_NX64
1338
1339#if defined(_WINDOWS)
1340//===========================================================================
1342//===========================================================================
1343class GxPadPc : public GxPad
1344{
1345 //-------------------------------------------------------------
1347 //-------------------------------------------------------------
1349public:
1350 GX_RTTI_CLASS(GxPadPc, GxPad)
1351 // GxClassBase継承クラス用禁止宣言
1352 GX_PROHIBIT_CLASS_BASE(GxPadPc);
1353
1355 enum class TRIGGER_TYPE
1356 {
1357 DIGITAL,
1358 ANALOG,
1359 };
1360
1362 struct GxRemapData : public GxStructBase
1363 {
1364 //-------------------------------------------------------------
1366 //-------------------------------------------------------------
1368 public:
1369 // RTTI
1370 GX_RTTI_STRUCT(GxRemapData)
1371
1372
1373 static constexpr u32 MAX_BUTTONS = 16;
1375 static constexpr u32 MAX_AXES = 4;
1376
1378 //-------------------------------------------------------------
1380 //-------------------------------------------------------------
1382
1384 GxRemapData(void) { initializeDefault(); }
1386 void initializeDefault(void);
1387
1389 //-------------------------------------------------------------
1391 //-------------------------------------------------------------
1393
1395 void remap(GxPad::GxInputData& dstData, const DIJOYSTATE2& src) const;
1397 void swapButton(u32 buttonIdA, u32 buttonIdB);
1399 void swapStickAxis(u32 stickIdA, u32 stickIdB);
1401 void setStickReverse(b32 leftX, b32 leftY, b32 rightX, b32 rightY);
1403 void getStickReverse(b32* pLeftX, b32* pLeftY, b32* pRightX, b32* pRightY) const;
1405 void setStickOffset(s32 leftOffX, s32 leftOffY, s32 rightOffX, s32 rightOffY);
1407 void getStickOffset(s32* pLeftOffX, s32* pLeftOffY, s32* pRightOffX, s32* pRightOffY) const;
1408
1410 //-------------------------------------------------------------
1412 //-------------------------------------------------------------
1414
1415 s32 _stickLeftOffsetX;
1416 s32 _stickLeftOffsetY;
1417 s32 _stickRightOffsetX;
1418 s32 _stickRightOffsetY;
1419 s32 _stickLeftReverseX;
1420 s32 _stickLeftReverseY;
1421 s32 _stickRightReverseX;
1422 s32 _stickRightReverseY;
1423 u8 _remapButtons[MAX_BUTTONS];
1424 u8 _remapSticks[MAX_AXES];
1425
1427 };
1428
1430 //-------------------------------------------------------------
1432 //-------------------------------------------------------------
1434
1436 GxPadPc(void);
1438 ~GxPadPc(void) override;
1440 b32 initialize(void) override;
1442 GX_FORCE_INLINE void clear(void) override { Super::clear(); }
1443
1445 //-----------------------------------------------------------
1447 //-----------------------------------------------------------
1449
1451 void getInputDataDevice(void) override;
1452private:
1454 static b32 isPadXbox(const GUID* pGuid);
1456 static BOOL CALLBACK enumDeviceCallback(const DIDEVICEINSTANCE* pDeviceInstance, void* pContext);
1458 static BOOL CALLBACK enumObjectsCallback(const DIDEVICEOBJECTINSTANCE* pDeviceObjectInstance, void* pContext);
1460 b32 createDirectInputDevice(void);
1462 void releaseDirectInputDevice(void);
1463
1465 //-----------------------------------------------------------
1467 //-----------------------------------------------------------
1469public:
1471 GX_FORCE_INLINE b32 isEnable(void) const override { return _enableFlag; }
1473 constexpr IDirectInputDevice8* getDirectInputDevice(void) const { return _pDirectInputDevice; }
1475 constexpr u32 getNumButtons(void) const { return _numButtons; }
1477 constexpr u32 getNumPOVs(void) const { return _numPOVs; }
1479 constexpr u32 getNumAxes(void) const { return _numAxes; }
1481 GX_FORCE_INLINE const GxString& getProductGUID(void) const { return _productGUID; }
1483 GX_FORCE_INLINE const GxString& getProductName(void) const { return _productName; }
1485 GX_FORCE_INLINE GxRemapData* getRemapData(void) { return &_remapData; }
1486
1488 //-------------------------------------------------------------
1490 //-------------------------------------------------------------
1492private:
1493 IDirectInputDevice8* _pDirectInputDevice;
1494 TRIGGER_TYPE _triggerType;
1495 b32 _enableFlag;
1496 u32 _numButtons;
1497 u32 _numPOVs;
1498 u32 _numAxes;
1499 GxString _productGUID;
1500 GxString _productName;
1501
1502 // キャリブレーション関連
1503 GxRemapData _remapData;
1504
1506};
1507
1508#if GX_DEVELOP
1509//===========================================================================
1511//===========================================================================
1512class GxPadVirtual : public GxPad
1513{
1514 //-------------------------------------------------------------
1516 //-------------------------------------------------------------
1518public:
1519 GX_RTTI_CLASS(GxPadVirtual, GxPad)
1520 // GxClassBase継承クラス用禁止宣言
1521 GX_PROHIBIT_CLASS_BASE(GxPadVirtual);
1522
1524 //-------------------------------------------------------------
1526 //-------------------------------------------------------------
1528
1530 GxPadVirtual(void){}
1532 ~GxPadVirtual(void) override {}
1533
1535 //-----------------------------------------------------------
1537 //-----------------------------------------------------------
1539
1541 void getInputDataDevice(void) override;
1543 GX_FORCE_INLINE void developRender(void) override {}
1544
1546 //-----------------------------------------------------------
1548 //-----------------------------------------------------------
1550
1552 b32 isEnable(void) const override;
1553
1555};
1556#endif //GX_DEVELOP
1557#endif //WINDOWS
1558
1559//===========================================================================
1561//===========================================================================
1562class GxPadNetwork : public GxPad
1563{
1564 //-------------------------------------------------------------
1566 //-------------------------------------------------------------
1568public:
1569 GX_RTTI_CLASS(GxPadNetwork, GxPad)
1570 // GxClassBase継承クラス用禁止宣言
1572
1573
1574 //-------------------------------------------------------------
1576 //-------------------------------------------------------------
1578
1582 ~GxPadNetwork(void) override {}
1583
1585 //-----------------------------------------------------------
1587 //-----------------------------------------------------------
1589
1591 GX_FORCE_INLINE void getInputDataDevice(void) override {}
1592
1594 //-----------------------------------------------------------
1596 //-----------------------------------------------------------
1598
1600 GX_FORCE_INLINE b32 isEnable(void) const override { return true; }
1601
1603};
1604
1605GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
@ MAX
定義数
#define GX_TOUCH_POINT_MAX
タッチの最大数
Definition GxInputPad.h:685
@ FRONT
表をカリングする(右手系)
@ UNKNOWN
未定義
オブジェクト基底クラス
Definition GxBase.h:88
constexpr GxClassBaseRoot & operator=(const GxClassBaseRoot &)
代入演算子
Definition GxBase.h:64
入力デバイスクラス
Definition GxSysInput.h:78
モーションセンサークラス
Definition GxInputPad.h:886
GX_FORCE_INLINE const GxQuaternion & getRotationQuaternion(void) const
回転を取得
Definition GxInputPad.h:999
GX_FORCE_INLINE const GxVector3 & getAngularVelocity(void) const
ジャイロの測定値を取得
Definition GxInputPad.h:997
GX_FORCE_INLINE b32 isEnable(void) const
有効判定
Definition GxInputPad.h:990
GX_FORCE_INLINE const GxVector3 & getAcceleration(void) const
加速度の測定値を取得
Definition GxInputPad.h:995
タッチセンサークラス
Definition GxInputPad.h:692
constexpr u32 getTouchCount(void) const
タッチ数を取得
Definition GxInputPad.h:850
GX_FORCE_INLINE GxPoint2 getPoint(u32 pointNo) const
タッチ点を取得
Definition GxInputPad.h:852
GX_FORCE_INLINE b32 isEnable(void) const
有効判定
Definition GxInputPad.h:845
~GxTouch(void) override
デストラクタ
Definition GxInputPad.h:820
情報
Definition GxInputPad.h:515
f32 _time
振動時間
Definition GxInputPad.h:542
f32 _power
振動値
Definition GxInputPad.h:543
~GxInformation(void) override
デストラクタ
Definition GxInputPad.h:532
モータークラス
Definition GxInputPad.h:503
constexpr f32 getPower(void) const
振動値を取得
Definition GxInputPad.h:598
~GxMotor(void) override
デストラクタ
Definition GxInputPad.h:566
static constexpr u32 VIBRATION_DATA_MAX
振動情報数
Definition GxInputPad.h:551
static const f32 INVALID_TIME
無効時間定義
Definition GxInputPad.h:555
void addRequest(f32 time, f32 power)
リクエストを追加
Definition GxInputPad.cpp:855
GxMotor(void)
コンストラクタ
Definition GxInputPad.cpp:789
static const f32 STOP_TIME
停止時間定義
Definition GxInputPad.h:553
GX_FORCE_INLINE void stop(void)
停止
Definition GxInputPad.h:585
void update(void)
更新
Definition GxInputPad.cpp:798
パッド振動クラス
Definition GxInputPad.h:480
~GxVibration(void) override
デストラクタ
Definition GxInputPad.h:629
GxVibration(void)
コンストラクタ
Definition GxInputPad.cpp:680
GX_FORCE_INLINE GxMotor * getMotor(MOTOR motor)
モーター情報を取得
Definition GxInputPad.h:654
MOTOR
振動モーター数
Definition GxInputPad.h:492
@ RIGHT
右モーター
@ MAX
モーター数
@ LEFT
左モーター
@ SMALL
小モーター
@ BIG
大モーター
パッドクラス
Definition GxInputPad.h:25
GX_FORCE_INLINE f32 getRatioStickRightY(void) const
右スティックY軸のパッド入力比率取得 (-1.0~1.0, アナログ入力マージンが適用されます)
Definition GxInputPad.h:402
u32 _old
前フレームの押し状態
Definition GxInputPad.h:449
GX_FORCE_INLINE u8 getTriggerRight(void) const
右トリガーの値取得 (マージンを適用しない値 0~TRIGGER_VALUE_MAX)
Definition GxInputPad.h:343
constexpr void setMarginTriggerRightAnalog(u8 margin)
右トリガーのアナログ入力マージンを設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:384
GX_FORCE_INLINE void setInputData(const GxInputData &inputData)
入力データの設定
Definition GxInputPad.h:330
GX_FORCE_INLINE b32 isRelease(u32 bit=BUTTON_ALL) const
放した瞬間判定
Definition GxInputPad.h:352
constexpr void setMarginStickLeftAnalog(u32 marginX, u32 marginY)
左スティックのアナログ入力マージンを設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:378
constexpr void setMarginTriggerRightOnOff(u8 margin)
右トリガーの On/Off 判定しきい値を設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:375
constexpr void setUnit(GxUnitLocate *pUnit)
操作ユニットの設定
Definition GxInputPad.h:440
constexpr void setMarginTriggerLeftAnalog(u8 margin)
左トリガーのアナログ入力マージンを設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:382
GX_FORCE_INLINE f32 getRatioStickLeftX(void) const
左スティックX軸のパッド入力比率取得 (-1.0~1.0, アナログ入力マージンが適用されます)
Definition GxInputPad.h:396
constexpr void setMarginStickRightClip(u32 clipX, u32 clipY)
右スティックのアナログ入力切り捨て値を設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:389
constexpr GxMotion * getMotion(void) const
モーションセンサー情報の取得
Definition GxInputPad.h:427
constexpr void setMarginTriggerLeftOnOff(u8 margin)
左トリガーの On/Off 判定しきい値を設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:373
GX_FORCE_INLINE b32 isCancel(void) override
キャンセルボタンの判定
Definition GxInputPad.h:422
constexpr void setMarginStickLeftClip(u32 clipX, u32 clipY)
左スティックのアナログ入力切り捨て値を設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:387
constexpr GxVibration * getVibration(void) const
振動情報の取得
Definition GxInputPad.h:435
GX_FORCE_INLINE u8 getTriggerLeft(void) const
左トリガーの値取得 (マージンを適用しない値 0~TRIGGER_VALUE_MAX)
Definition GxInputPad.h:341
GX_FORCE_INLINE s32 getStickRightY(void) const
右スティック縦の値取得 (マージンを適用しない値 STICK_VALUE_MIN~STICK_VALUE_MAX)
Definition GxInputPad.h:339
constexpr void setMarginStickRightOnOff(u32 marginX, u32 marginY)
右スティックの On/Off 判定しきい値を設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:371
GxInputData _inputData
入力データ
Definition GxInputPad.h:448
GX_FORCE_INLINE f32 getRatioStickRightX(void) const
右スティックX軸のパッド入力比率取得 (-1.0~1.0, アナログ入力マージンが適用されます)
Definition GxInputPad.h:400
constexpr void setMarginStickRight(u32 margin)
右スティックの On/Off、アナログ入力マージンを設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:362
u32 _oldTemporary
前フレーム用に保存しておく情報
Definition GxInputPad.h:450
constexpr GxResPadRecorder * getResourcePadRecorder(void) const
パッドレコーダーリソースの取得
Definition GxInputPad.h:409
GX_FORCE_INLINE b32 isOn(u32 bit=BUTTON_ALL) const
押し状態判定
Definition GxInputPad.h:346
constexpr void setMarginTriggerRightClip(u8 clip)
右トリガーのアナログ入力切り捨て値を設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:393
constexpr void setMarginTriggerRight(u8 margin)
右トリガーの On/Off、アナログ入力マージンを設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:366
GX_FORCE_INLINE b32 isTrigger(u32 bit=BUTTON_ALL) const
押した瞬間判定
Definition GxInputPad.h:350
constexpr GxTouch * getTouch(TOUCH_PANEL panel) const
タッチセンサー情報の取得
Definition GxInputPad.h:425
GX_FORCE_INLINE const GxInputData & getInputData(void) const
入力データの取得
Definition GxInputPad.h:328
GX_FORCE_INLINE b32 isOk(void) override
決定ボタンの判定
Definition GxInputPad.h:420
constexpr void setMarginTriggerLeft(u8 margin)
左トリガーの On/Off、アナログ入力マージンを設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:364
static GX_FORCE_INLINE s32 RatioToTrigger(f32 ratio)
Ratio からトリガー値へ変換する
Definition GxInputPad.h:252
GX_FORCE_INLINE f32 getRatioTriggerLeft(void) const
左トリガーのパッド入力比率取得 (0.0~1.0, アナログ入力マージンが適用されます)
Definition GxInputPad.h:404
GX_FORCE_INLINE f32 getRatioTriggerRight(void) const
右トリガーのパッド入力比率取得 (0.0~1.0, アナログ入力マージンが適用されます)
Definition GxInputPad.h:406
GX_FORCE_INLINE b32 isOld(u32 bit=BUTTON_ALL) const
前フレームの押し状態判定
Definition GxInputPad.h:348
constexpr PAD_RECORDER getPadRecorderStatus(void) const
パッドレコーダー状態の取得
Definition GxInputPad.h:411
constexpr void setMarginTriggerLeftClip(u8 clip)
左トリガーのアナログ入力切り捨て値を設定 (0~TRIGGER_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:391
GX_FORCE_INLINE s32 getStickLeftY(void) const
左スティック縦の値取得 (マージンを適用しない値 STICK_VALUE_MIN~STICK_VALUE_MAX)
Definition GxInputPad.h:335
GX_FORCE_INLINE f32 getRatioStickLeftY(void) const
左スティックY軸のパッド入力比率取得 (-1.0~1.0, アナログ入力マージンが適用されます)
Definition GxInputPad.h:398
GX_FORCE_INLINE b32 isRepeat(u32 bit=BUTTON_ALL) const
リピート判定
Definition GxInputPad.h:356
PAD_RECORDER
パッドレコーダーの状態
Definition GxInputPad.h:107
constexpr void setMarginStickLeft(u32 margin)
左スティックの On/Off、アナログ入力マージンを設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:360
GxMotion * _pMotion
モーションセンサー情報
Definition GxInputPad.h:469
TOUCH_PANEL
タッチパネル定義
Definition GxInputPad.h:37
static GX_FORCE_INLINE s32 RatioToStick(f32 ratio)
Ratio からスティック値へ変換する
Definition GxInputPad.h:250
GX_FORCE_INLINE s32 getStickRightX(void) const
右スティック横の値取得 (マージンを適用しない値 STICK_VALUE_MIN~STICK_VALUE_MAX)
Definition GxInputPad.h:337
GX_FORCE_INLINE s32 getStickLeftX(void) const
左スティック横の値取得 (マージンを適用しない値 STICK_VALUE_MIN~STICK_VALUE_MAX)
Definition GxInputPad.h:333
constexpr void setMarginStickLeftOnOff(u32 marginX, u32 marginY)
左スティックの On/Off 判定しきい値を設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:369
GxVibration * _pVibration
振動情報
Definition GxInputPad.h:466
constexpr void setMarginStickRightAnalog(u32 marginX, u32 marginY)
右スティックのアナログ入力マージンを設定 (0~STICK_VALUE_MAX の範囲で指定)
Definition GxInputPad.h:380
GX_FORCE_INLINE b32 isChange(u32 bit=BUTTON_ALL) const
On,Off変化判定
Definition GxInputPad.h:354
constexpr GxUnitLocate * getUnit(void) const
操作ユニットの取得
Definition GxInputPad.h:438
ネットワークパッドクラス
Definition GxInputPad.h:1563
~GxPadNetwork(void) override
デストラクタ
Definition GxInputPad.h:1582
GX_FORCE_INLINE b32 isEnable(void) const override
有効判定
Definition GxInputPad.h:1600
GX_FORCE_INLINE void getInputDataDevice(void) override
デバイスから入力を取得
Definition GxInputPad.h:1591
入力パッドレコーダー処理クラス
Definition GxPadRecorder.h:21
入力パッドレコーダーリソースクラス
Definition GxResPadRecorder.h:19
入力システムクラス
Definition GxSysInput.h:217
座標ユニット基礎クラス
Definition GxUnitLocate.h:23
Definition GxColor.h:21
4×4行列(行優先)
Definition GxMatrix.h:607
static const GxMatrix44 IDENTITY
単位行列
Definition GxMatrix.h:618
入力情報
Definition GxInputPad.h:114
s32 _stickRightY
右スティック縦
Definition GxInputPad.h:141
GX_FORCE_INLINE void clear(void)
クリア
Definition GxInputPad.h:129
s32 _stickLeftY
左スティック縦
Definition GxInputPad.h:139
s32 _stickRightX
右スティック横
Definition GxInputPad.h:140
s32 _stickLeftX
左スティック横(-32768 and 32767)
Definition GxInputPad.h:138
u32 _on
押し状態
Definition GxInputPad.h:137
u8 _triggerRight
右トリガー
Definition GxInputPad.h:143
u8 _triggerLeft
左トリガー(0 and 255)
Definition GxInputPad.h:142
マージン関連
Definition GxInputPad.h:168
s32 _stickLeftY
左スティック Y軸 の On/Off 入力判定しきい値
Definition GxInputPad.h:192
u8 _triggerLeft
左トリガの On/Off 入力判定しきい値
Definition GxInputPad.h:195
u8 _triggerLeftAnalog
左トリガのアナログ入力マージン
Definition GxInputPad.h:202
u8 _triggerRight
右トリガの On/Off 入力判定しきい値
Definition GxInputPad.h:196
u8 _triggerLeftClip
左トリガのアナログ入力切り捨て
Definition GxInputPad.h:209
s32 _stickRightAnalogX
右スティック X軸 のアナログ入力マージン
Definition GxInputPad.h:200
s32 _stickRightClipX
右スティック X軸 のアナログ入力切り捨て
Definition GxInputPad.h:207
s32 _stickLeftClipX
左スティック X軸 のアナログ入力切り捨て
Definition GxInputPad.h:205
u8 _triggerRightClip
右トリガのアナログ入力切り捨て
Definition GxInputPad.h:210
s32 _stickRightClipY
右スティック Y軸 のアナログ入力切り捨て
Definition GxInputPad.h:208
s32 _stickRightAnalogY
右スティック Y軸 のアナログ入力マージン
Definition GxInputPad.h:201
s32 _stickLeftAnalogY
左スティック Y軸 のアナログ入力マージン
Definition GxInputPad.h:199
s32 _stickLeftX
左スティック X軸 の On/Off 入力判定しきい値
Definition GxInputPad.h:191
s32 _stickRightY
右スティック Y軸 の On/Off 入力判定しきい値
Definition GxInputPad.h:194
s32 _stickLeftAnalogX
左スティック X軸 のアナログ入力マージン
Definition GxInputPad.h:198
s32 _stickLeftClipY
左スティック Y軸 のアナログ入力切り捨て
Definition GxInputPad.h:206
u8 _triggerRightAnalog
右トリガのアナログ入力マージン
Definition GxInputPad.h:203
s32 _stickRightX
右スティック X軸 の On/Off 入力判定しきい値
Definition GxInputPad.h:193
保存情報
Definition GxInputPad.h:149
u32 _trigger
押した瞬間
Definition GxInputPad.h:159
GxInputData _inputData
入力情報
Definition GxInputPad.h:155
u32 _repeat
リピート
Definition GxInputPad.h:162
u32 _old
前フレームの押し状態
Definition GxInputPad.h:156
u32 _release
放した瞬間
Definition GxInputPad.h:160
u32 _change
On,Off変化
Definition GxInputPad.h:161
u32 _oldTemporary
前フレーム用に保存しておく情報
Definition GxInputPad.h:157
座標
Definition GxStruct.h:867
クォータニオン
Definition GxQuaternion.h:19
文字列型クラス
Definition GxString.h:18
Definition GxBase.h:24
3次元ベクトル
Definition GxVector.h:245
32bitブーリアン
Definition GxDefine.h:173