OROCHI
 
Loading...
Searching...
No Matches
GxStruct.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_CORE_NAMESPACE_BEGIN()
14
15struct GxFloat3;
16struct GxFloat4;
17
18//===========================================================================
20//===========================================================================
22{
23 //-------------------------------------------------------------
25 //-------------------------------------------------------------
27public:
29 GX_FORCE_INLINE GxFloat2(void){}
31 GX_FORCE_INLINE GxFloat2(f32 x, f32 y) : _x(x), _y(y) {}
33 GX_FORCE_INLINE GxFloat2(const GxFloat3& float3);
35 GX_FORCE_INLINE GxFloat2(const GxFloat4& float4);
37 GX_FORCE_INLINE GxFloat2(const GxVector2& vector);
39 GX_FORCE_INLINE GxFloat2(const GxVector3& vector);
41 GX_FORCE_INLINE GxFloat2(const GxVector4& vector);
43 GX_FORCE_INLINE GxFloat2(const GxPoint2& point);
44
46 GX_FORCE_INLINE GxFloat2(const GxFloat2& float2) : _x(float2._x), _y(float2._y){}
47
49 //-------------------------------------------------------------
51 //-------------------------------------------------------------
53
55 GX_FORCE_INLINE GxFloat2& operator = (const GxFloat2& float2);
57 GX_FORCE_INLINE GxFloat2& operator = (const GxVector2& vector);
59 GX_FORCE_INLINE GxFloat2& operator = (const GxVector3& vector);
61 GX_FORCE_INLINE GxFloat2& operator = (const GxVector4& vector);
63 GX_FORCE_INLINE operator f32* (void){ return reinterpret_cast<f32*>(this); }
65 GX_FORCE_INLINE operator const f32* (void) const { return reinterpret_cast<const f32*>(this); }
66
68 //-------------------------------------------------------------
70 //-------------------------------------------------------------
72
73 union
74 {
75 f32 _x;
76 f32 _u;
77 };
78 union
79 {
80 f32 _y;
81 f32 _v;
82 };
83
85};
86
87//===========================================================================
89//===========================================================================
91{
92 //-------------------------------------------------------------
94 //-------------------------------------------------------------
96public:
98 GX_FORCE_INLINE GxFloat3(void) : _x(0.f), _y(0.f), _z(0.f){}
100 GX_FORCE_INLINE GxFloat3(f32 x, f32 y, f32 z) : _x(x), _y(y), _z(z){}
102 GX_FORCE_INLINE GxFloat3(const GxFloat4& float4);
104 GX_FORCE_INLINE GxFloat3(const GxVector3& vector);
106 GX_FORCE_INLINE GxFloat3(const GxVector4& vector);
107
109 GX_FORCE_INLINE GxFloat3(const GxFloat3& float3) : _x(float3._x), _y(float3._y), _z(float3._z){}
110
112 //-------------------------------------------------------------
114 //-------------------------------------------------------------
116
118 GX_FORCE_INLINE GxFloat3& operator = (const GxVector3& vector);
120 GX_FORCE_INLINE GxFloat3& operator = (const GxVector4& vector);
122 GX_FORCE_INLINE operator f32* (void){ return reinterpret_cast<f32*>(this); }
124 GX_FORCE_INLINE operator const f32* (void) const { return reinterpret_cast<const f32*>(this); }
125
127 //-------------------------------------------------------------
129 //-------------------------------------------------------------
131#if GX_DEVELOP
132 // 書き込み
133 b32 write(GxStreamWriter& writer);
134#endif //GX_DEVELOP
135
137 //-------------------------------------------------------------
139 //-------------------------------------------------------------
141
142 f32 _x;
143 f32 _y;
144 f32 _z;
145
147};
148
149//===========================================================================
151//===========================================================================
153{
154 //-------------------------------------------------------------
156 //-------------------------------------------------------------
158public:
160 GX_FORCE_INLINE GxFloat4(void) : _x(0.f), _y(0.f), _z(0.f), _w(0.f){}
162 GX_FORCE_INLINE GxFloat4(f32 x, f32 y, f32 z, f32 w) : _x(x), _y(y), _z(z), _w(w) {}
164 GX_FORCE_INLINE GxFloat4(const GxVector4& vector);
166 GX_FORCE_INLINE GxFloat4(const GxQuaternion& quaternion);
167
169 GX_FORCE_INLINE GxFloat4(const GxFloat4& float4) : _x(float4._x), _y(float4._y), _z(float4._z), _w(float4._w) {}
170
172 //-------------------------------------------------------------
174 //-------------------------------------------------------------
176
178 GX_FORCE_INLINE GxFloat4& operator = (const GxVector4& vector);
180 GX_FORCE_INLINE GxFloat4& operator = (const GxQuaternion& quaternion);
182 GX_FORCE_INLINE operator f32* (void){ return reinterpret_cast<f32*>(this); }
184 GX_FORCE_INLINE operator const f32* (void) const { return reinterpret_cast<const f32*>(this); }
185
187 //-------------------------------------------------------------
189 //-------------------------------------------------------------
191
192 f32 _x;
193 f32 _y;
194 f32 _z;
195 f32 _w;
196
198};
199
200struct GxDouble3;
201struct GxDouble4;
202
203//===========================================================================
205//===========================================================================
207{
208 //-------------------------------------------------------------
210 //-------------------------------------------------------------
212public:
214 GX_FORCE_INLINE GxDouble2(void) : _x(0), _y(0) {}
216 GX_FORCE_INLINE GxDouble2(f64 x, f64 y) : _x(x), _y(y) {}
218 GX_FORCE_INLINE GxDouble2(const GxDouble3& double3);
220 GX_FORCE_INLINE GxDouble2(const GxDouble4& double4);
222 GX_FORCE_INLINE GxDouble2(const GxVector2d& vector);
224 GX_FORCE_INLINE GxDouble2(const GxVector3d& vector);
226 GX_FORCE_INLINE GxDouble2(const GxVector4d& vector);
228 GX_FORCE_INLINE GxDouble2(const GxPoint2& point);
229
231 GX_FORCE_INLINE GxDouble2(const GxDouble2& double2) : _x(double2._x), _y(double2._y) {}
232
234 //-------------------------------------------------------------
236 //-------------------------------------------------------------
238
240 GX_FORCE_INLINE GxDouble2& operator = (const GxDouble2& double2);
242 GX_FORCE_INLINE GxDouble2& operator = (const GxVector2d& vector);
244 GX_FORCE_INLINE GxDouble2& operator = (const GxVector3d& vector);
246 GX_FORCE_INLINE GxDouble2& operator = (const GxVector4d& vector);
248 GX_FORCE_INLINE operator f64* (void) { return reinterpret_cast<f64*>(this); }
250 GX_FORCE_INLINE operator const f64* (void) const { return reinterpret_cast<const f64*>(this); }
251
253 //-------------------------------------------------------------
255 //-------------------------------------------------------------
257
258 union
259 {
260 f64 _x;
261 f64 _u;
262 };
263 union
264 {
265 f64 _y;
266 f64 _v;
267 };
268
270};
271
272//===========================================================================
274//===========================================================================
276{
277 //-------------------------------------------------------------
279 //-------------------------------------------------------------
281public:
283 GX_FORCE_INLINE GxDouble3(void) : _x(0), _y(0), _z(0) {}
285 GX_FORCE_INLINE GxDouble3(f64 x, f64 y, f64 z) : _x(x), _y(y), _z(z) {}
287 GX_FORCE_INLINE GxDouble3(const GxDouble4& double4);
289 GX_FORCE_INLINE GxDouble3(const GxVector3d& vector);
291 GX_FORCE_INLINE GxDouble3(const GxVector4d& vector);
292
294 GX_FORCE_INLINE GxDouble3(const GxDouble3& double3) : _x(double3._x), _y(double3._y), _z(double3._z) {}
295
297 //-------------------------------------------------------------
299 //-------------------------------------------------------------
301
303 GX_FORCE_INLINE GxDouble3& operator = (const GxVector3d& vector);
305 GX_FORCE_INLINE GxDouble3& operator = (const GxVector4d& vector);
307 GX_FORCE_INLINE operator f64* (void) { return reinterpret_cast<f64*>(this); }
309 GX_FORCE_INLINE operator const f64* (void) const { return reinterpret_cast<const f64*>(this); }
310
312 //-------------------------------------------------------------
314 //-------------------------------------------------------------
316#if GX_DEVELOP
317 // 書き込み
318 b32 write(GxStreamWriter& writer);
319#endif //GX_DEVELOP
320
322 //-------------------------------------------------------------
324 //-------------------------------------------------------------
326
327 f64 _x;
328 f64 _y;
329 f64 _z;
330
332};
333
334//===========================================================================
336//===========================================================================
338{
339 //-------------------------------------------------------------
341 //-------------------------------------------------------------
343public:
345 GX_FORCE_INLINE GxDouble4(void) : _x(0), _y(0), _z(0), _w(0) {}
347 GX_FORCE_INLINE GxDouble4(f64 x, f64 y, f64 z, f64 w) : _x(x), _y(y), _z(z), _w(w) {}
349 GX_FORCE_INLINE GxDouble4(const GxVector4d& vector);
350
352 GX_FORCE_INLINE GxDouble4(const GxDouble4& double4) : _x(double4._x), _y(double4._y), _z(double4._z), _w(double4._w) {}
353
355 //-------------------------------------------------------------
357 //-------------------------------------------------------------
359
361 GX_FORCE_INLINE GxDouble4& operator = (const GxVector4d& vector);
363 GX_FORCE_INLINE operator f64* (void) { return reinterpret_cast<f64*>(this); }
365 GX_FORCE_INLINE operator const f64* (void) const { return reinterpret_cast<const f64*>(this); }
366
368 //-------------------------------------------------------------
370 //-------------------------------------------------------------
372
373 f64 _x;
374 f64 _y;
375 f64 _z;
376 f64 _w;
377
379};
380
381//===========================================================================
383// GxFloat16という名前にすると GxFloat4などとややこしいのでGxF16になっています
384//===========================================================================
385struct GxF16
386{
387 //-------------------------------------------------------------
389 //-------------------------------------------------------------
391public:
393 GX_INLINE GxF16(void);
395 GX_INLINE GxF16(f32 valueF32);
397 GX_INLINE GxF16(const GxF16& valueF16);
398
400 GX_FORCE_INLINE operator f32() const;
401
403 //-------------------------------------------------------------
405 //-------------------------------------------------------------
407
409 static GX_FORCE_INLINE GxF16 f32ToF16(f32 valueF32);
411 static GX_FORCE_INLINE f32 f16ToF32(GxF16 valueF16);
412
414 //-------------------------------------------------------------
416 //-------------------------------------------------------------
418
420 constexpr u16 getValueU16(void) const { return _value; }
422 constexpr void setValueU16(u16 setValue) { _value = setValue; }
423
425 //-------------------------------------------------------------
427 //-------------------------------------------------------------
429
430private:
431 u16 _value;
432
434};
435
436//===========================================================================
438//===========================================================================
440{
441 //-------------------------------------------------------------
443 //-------------------------------------------------------------
445public:
447 GxF16x2(void){}
449 GX_INLINE GxF16x2(const GxF16x2& value) { *this = value; }
451 GX_INLINE GxF16x2(const GxFloat2& value) { *this = value; }
453 GX_INLINE GxF16x2(const GxVector2& value) { *this = value; }
454
456 //-------------------------------------------------------------
458 //-------------------------------------------------------------
460
462 GX_FORCE_INLINE GxF16x2& operator = (const GxF16x2& value);
464 GX_FORCE_INLINE GxF16x2& operator = (const GxFloat2& value);
466 GX_FORCE_INLINE GxF16x2& operator = (const GxVector2& value);
467
469 //-------------------------------------------------------------
471 //-------------------------------------------------------------
473public:
475
477};
478
479//===========================================================================
481//===========================================================================
483{
484 //-------------------------------------------------------------
486 //-------------------------------------------------------------
488public:
490 GxF16x4(void){}
492 GX_INLINE GxF16x4(const GxF16x4& value) { *this = value; }
494 GX_INLINE GxF16x4(const GxFloat3& value) { *this = GxFloat4(value._x, value._y, value._z, 0.0f); }
496 GX_INLINE GxF16x4(const GxFloat4& value) { *this = value; }
498 GX_INLINE GxF16x4(const GxVector3& value) { *this = GxVector4(value._x, value._y, value._z, 0.0f); }
500 GX_INLINE GxF16x4(const GxVector4& value) { *this = value; }
501
503 //-------------------------------------------------------------
505 //-------------------------------------------------------------
507
509 GX_FORCE_INLINE GxF16x4& operator = (const GxF16x4& value);
511 GX_FORCE_INLINE GxF16x4& operator = (const GxFloat4& value);
513 GX_FORCE_INLINE GxF16x4& operator = (const GxVector4& value);
514
516 //-------------------------------------------------------------
518 //-------------------------------------------------------------
520public:
522
524};
525
526//===========================================================================
528//===========================================================================
529struct GxU8N
530{
531 //-------------------------------------------------------------
533 //-------------------------------------------------------------
535public:
537 GX_INLINE GxU8N(void);
539 GX_INLINE GxU8N(f32 valueF32);
541 GX_INLINE GxU8N(const GxU8N& valueF16);
542
544 GX_FORCE_INLINE operator f32() const;
545
547 //-------------------------------------------------------------
549 //-------------------------------------------------------------
551
553 static GX_FORCE_INLINE GxU8N f32ToU8N(f32 valueF32);
555 static GX_FORCE_INLINE f32 u8NToF32(GxU8N valueU8N);
556
558 //-------------------------------------------------------------
560 //-------------------------------------------------------------
562
564 constexpr u8 getValueU8(void) const { return _value; }
566 constexpr void setValueU8(u8 setValue) { _value = setValue; }
567
569 //-------------------------------------------------------------
571 //-------------------------------------------------------------
573private:
574 u8 _value;
575
577};
578
579//===========================================================================
581//===========================================================================
583{
584 //-------------------------------------------------------------
586 //-------------------------------------------------------------
588public:
590 static constexpr u32 DIMENSION = 4;
591
593 //-------------------------------------------------------------
595 //-------------------------------------------------------------
597
599 GxU8Nx4(void){}
601 GX_INLINE GxU8Nx4(const GxU8Nx4& value) { *this = value; }
603 GX_INLINE GxU8Nx4(const GxFloat4& value) { *this = value; }
605 GX_INLINE GxU8Nx4(const GxVector4& value) { *this = value; }
606
608 //-------------------------------------------------------------
610 //-------------------------------------------------------------
612
614 GX_FORCE_INLINE GxU8Nx4& operator = (const GxU8Nx4& value);
616 GX_FORCE_INLINE GxU8Nx4& operator = (const GxFloat4& value);
618 GX_FORCE_INLINE GxU8Nx4& operator = (const GxVector4& value);
619
621 //-------------------------------------------------------------
623 //-------------------------------------------------------------
625
627 GX_FORCE_INLINE const GxU8N& operator[](u32 i) const { return _value[i]; }
629 GX_FORCE_INLINE GxU8N& operator[](u32 i) { return _value[i]; }
630
632 //-------------------------------------------------------------
634 //-------------------------------------------------------------
636private:
637 GxU8N _value[DIMENSION];
638
640};
641
642//===========================================================================
644//===========================================================================
646{
647 //-------------------------------------------------------------
649 //-------------------------------------------------------------
651public:
653 static constexpr u32 DIMENSION = 3;
655 static constexpr u32 SHIFT_X = 0;
657 static constexpr u32 SHIFT_Y = 11;
659 static constexpr u32 SHIFT_Z = 22;
660
662 //-------------------------------------------------------------
664 //-------------------------------------------------------------
666
670 GX_INLINE GxPackedNx3(const GxPackedNx3& value) { *this = value; }
672 GX_INLINE GxPackedNx3(const GxFloat3& value) { *this = value; }
674 GX_INLINE GxPackedNx3(const GxVector3& value) { *this = value; }
675
677 //-------------------------------------------------------------
679 //-------------------------------------------------------------
681
683 GX_FORCE_INLINE GxPackedNx3& operator = (const GxPackedNx3& value) { _value = value._value; return *this; }
685 GX_FORCE_INLINE GxPackedNx3& operator = (const GxFloat3& value);
687 GX_FORCE_INLINE GxPackedNx3& operator = (const GxVector3& value);
688
690 //-------------------------------------------------------------
692 //-------------------------------------------------------------
694
696 static GX_FORCE_INLINE u32 f32ToS10N(f32 valueF32);
698 static GX_FORCE_INLINE f32 s10NTof32(u32 valueS10N);
700 static GX_FORCE_INLINE u32 f32ToS11N(f32 valueF32);
702 static GX_FORCE_INLINE f32 s11NTof32(u32 valueS11N);
703
705 //-------------------------------------------------------------
707 //-------------------------------------------------------------
709
711 GX_FORCE_INLINE f32 getValueF32(u32 index) const;
713 GX_FORCE_INLINE void setValueF32(u32 index, f32 setValue);
714
716 //-------------------------------------------------------------
718 //-------------------------------------------------------------
720private:
721 u32 _value;
722
724};
725
726//===========================================================================
728//===========================================================================
729struct GxSize : public GxStructBase
730{
731 //-------------------------------------------------------------
733 //-------------------------------------------------------------
735public:
736 GX_RTTI_STRUCT(GxSize)
737
738
739 static const GxSize MIN;
741 static const GxSize MAX;
743 static const GxSize ZERO;
744
746 //-------------------------------------------------------------
748 //-------------------------------------------------------------
750
752 GX_FORCE_INLINE GxSize(void) : _width(0), _height(0){}
754 GX_FORCE_INLINE GxSize(s32 width, s32 height);
756 GX_FORCE_INLINE GxSize(const GxRect& rect);
757
759 GX_FORCE_INLINE GxSize(const GxSize& size);
760
762 //-------------------------------------------------------------
764 //-------------------------------------------------------------
766
768 GX_FORCE_INLINE GxSize& operator = (const GxSize& size);
770 GX_FORCE_INLINE GxSize& operator += (s32 scalar);
772 GX_FORCE_INLINE GxSize& operator -= (s32 scalar);
774 GX_FORCE_INLINE GxSize& operator *= (s32 scalar);
776 GX_FORCE_INLINE GxSize& operator /= (s32 scalar);
778 GX_FORCE_INLINE GxSize& operator += (const GxSize& size);
780 GX_FORCE_INLINE GxSize& operator -= (const GxSize& size);
782 GX_FORCE_INLINE GxSize& operator &= (const GxSize& size);
784 GX_FORCE_INLINE GxSize& operator |= (const GxSize& size);
786 friend GX_FORCE_INLINE const GxSize operator + (const GxSize& size, s32 scalar);
788 friend GX_FORCE_INLINE const GxSize operator - (const GxSize& size, s32 scalar);
790 friend GX_FORCE_INLINE const GxSize operator * (const GxSize& size, s32 scalar);
792 friend GX_FORCE_INLINE const GxSize operator * (s32 scalar, const GxSize& size);
794 friend GX_FORCE_INLINE const GxSize operator / (const GxSize& size, s32 scalar);
796 friend GX_FORCE_INLINE const GxSize operator + (const GxSize& size0, const GxSize& size1);
798 friend GX_FORCE_INLINE const GxSize operator - (const GxSize& size0, const GxSize& size1);
800 friend GX_FORCE_INLINE const GxSize operator & (const GxSize& size0, const GxSize& size1);
802 friend GX_FORCE_INLINE const GxSize operator | (const GxSize& size0, const GxSize& size1);
804 friend GX_FORCE_INLINE b32 operator == (const GxSize& size0, const GxSize& size1);
806 friend GX_FORCE_INLINE b32 operator != (const GxSize& size0, const GxSize& size1);
807
809 //-------------------------------------------------------------
811 //-------------------------------------------------------------
813
815 static GX_FORCE_INLINE const GxSize& getAddScalar(GxSize& dst, const GxSize& size, s32 scalar);
817 static GX_FORCE_INLINE const GxSize& getSubScalar(GxSize& dst, const GxSize& size, s32 scalar);
819 static GX_FORCE_INLINE const GxSize& getMulScalar(GxSize& dst, const GxSize& size, s32 scalar);
821 static GX_FORCE_INLINE const GxSize& getDivScalar(GxSize& dst, const GxSize& size, s32 scalar);
823 static GX_FORCE_INLINE const GxSize& getAddSize(GxSize& dst, const GxSize& size0, const GxSize& size1);
825 static GX_FORCE_INLINE const GxSize& getSubSize(GxSize& dst, const GxSize& size0, const GxSize& size1);
826
828 GX_INLINE b32 isIncluding(const GxPoint2& point) const;
829
831 //-------------------------------------------------------------
833 //-------------------------------------------------------------
835
837 GX_FORCE_INLINE const GxSize& addScalar(s32 scalar);
839 GX_FORCE_INLINE const GxSize& subScalar(s32 scalar);
841 GX_FORCE_INLINE const GxSize& mulScalar(s32 scalar);
843 GX_FORCE_INLINE const GxSize& divScalar(s32 scalar);
845 GX_FORCE_INLINE const GxSize& addSize(const GxSize& size);
847 GX_FORCE_INLINE const GxSize& subSize(const GxSize& size);
849 GX_FORCE_INLINE const GxSize& mulSize(const GxSize& size);
850
852 //-------------------------------------------------------------
854 //-------------------------------------------------------------
856
857 s32 _width;
859
861};
862
863//===========================================================================
865//===========================================================================
866struct GxPoint2 : public GxStructBase
867{
868 //-------------------------------------------------------------
870 //-------------------------------------------------------------
872public:
873 GX_RTTI_STRUCT(GxPoint2)
874
875
876 static const GxPoint2 ZERO;
877
879 //-------------------------------------------------------------
881 //-------------------------------------------------------------
883
885 GX_FORCE_INLINE GxPoint2(void) : _x(0), _y(0){}
887 GX_FORCE_INLINE GxPoint2(s32 x, s32 y);
889 GX_FORCE_INLINE GxPoint2(const GxPoint2& point);
891 GX_FORCE_INLINE GxPoint2(const GxVector2& vector);
892
894 //-----------------------------------------------------------
896 //-----------------------------------------------------------
898
900 GX_FORCE_INLINE GxPoint2& operator = (const GxPoint2& point);
902 GX_FORCE_INLINE GxPoint2& operator += (const GxPoint2& point);
904 GX_FORCE_INLINE GxPoint2& operator -= (const GxPoint2& point);
906 GX_FORCE_INLINE GxPoint2& operator += (const GxSize& size);
908 GX_FORCE_INLINE GxPoint2& operator -= (const GxSize& size);
910 friend GX_FORCE_INLINE const GxPoint2 operator + (const GxPoint2& point){ return point; }
912 friend GX_FORCE_INLINE const GxPoint2 operator - (const GxPoint2& point){ return GxPoint2( -point._x,-point._y ); }
914 friend GX_FORCE_INLINE const GxPoint2 operator + (const GxPoint2& point0, const GxPoint2& point1);
916 friend GX_FORCE_INLINE const GxPoint2 operator - (const GxPoint2& point0, const GxPoint2& point1);
918 friend GX_FORCE_INLINE const GxPoint2 operator + (const GxPoint2& point, const GxSize& size);
920 friend GX_FORCE_INLINE const GxPoint2 operator - (const GxPoint2& point, const GxSize& size);
922 friend GX_FORCE_INLINE b32 operator == (const GxPoint2& point0, const GxPoint2& point1);
924 friend GX_FORCE_INLINE b32 operator != (const GxPoint2& point0, const GxPoint2& point1);
925
927 //-----------------------------------------------------------
929 //-----------------------------------------------------------
931
933 f32 getSquareDistanceToSegment(GxPoint2 segmentStart, GxPoint2 segmentEnd) const;
934
936 //-------------------------------------------------------------
938 //-------------------------------------------------------------
940
941 s32 _x;
942 s32 _y;
943
945};
946
947//===========================================================================
949//===========================================================================
950struct GxRect : public GxStructBase
951{
952 //-------------------------------------------------------------
954 //-------------------------------------------------------------
956public:
957 GX_RTTI_STRUCT(GxRect)
958
959
960 static const GxRect MIN;
962 static const GxRect MAX;
964 static const GxRect ZERO;
965
967 enum class BASE
968 {
969 TOP_LEFT,
970 TOP_RIGHT,
973 };
974
976 //-------------------------------------------------------------
978 //-------------------------------------------------------------
980
982 GX_FORCE_INLINE GxRect(void) : _left(0), _top(0), _right(0), _bottom(0){}
984 GX_FORCE_INLINE GxRect(const s32 left, const s32 top, const s32 right, const s32 bottom) : _left(left), _top(top), _right(right), _bottom(bottom){}
986 GX_FORCE_INLINE GxRect(const GxSize& size) : _left(0), _top(0), _right(size._width), _bottom(size._height){}
988 GX_FORCE_INLINE GxRect(const GxPoint2& leftTop, const GxSize& size) : _left(leftTop._x), _top(leftTop._y), _right(leftTop._x+size._width), _bottom(leftTop._y+size._height){}
990 GX_FORCE_INLINE GxRect(const GxPoint2& leftTop, const GxPoint2& rightBottom) : _left(leftTop._x), _top(leftTop._y), _right(rightBottom._x), _bottom(rightBottom._y){}
991
993 GX_FORCE_INLINE GxRect(const GxRect& rect) : _left(rect._left), _top(rect._top), _right(rect._right), _bottom(rect._bottom){}
995 GX_FORCE_INLINE void initialize(s32 left, s32 top, s32 right, s32 bottom){ _left = left; _top = top; _right = right; _bottom = bottom; }
996
998 //-----------------------------------------------------------
1000 //-----------------------------------------------------------
1002
1004 GX_FORCE_INLINE GxRect& operator = (const GxRect& rect);
1006 GX_FORCE_INLINE GxRect& operator += (const GxRect& rect);
1008 GX_FORCE_INLINE GxRect& operator -= (const GxRect& rect);
1010 GX_FORCE_INLINE GxRect& operator += (const GxPoint2& point);
1012 GX_FORCE_INLINE GxRect& operator -= (const GxPoint2& point);
1014 GX_FORCE_INLINE GxRect& operator &= (const GxRect& rect);
1016 GX_FORCE_INLINE GxRect& operator |= (const GxRect& rect);
1018 friend GX_FORCE_INLINE const GxRect operator + (const GxRect& rect);
1020 friend GX_FORCE_INLINE const GxRect operator - (const GxRect& rect);
1022 friend GX_FORCE_INLINE const GxRect operator + (const GxRect& rect0, const GxRect& rect1);
1024 friend GX_FORCE_INLINE const GxRect operator - (const GxRect& rect0, const GxRect& rect1);
1026 friend GX_FORCE_INLINE const GxRect operator + (const GxRect& rect, const GxPoint2& point);
1028 friend GX_FORCE_INLINE const GxRect operator - (const GxRect& rect, const GxPoint2& point);
1030 friend GX_FORCE_INLINE const GxRect operator & (const GxRect& rect0, const GxRect& rect1);
1032 friend GX_FORCE_INLINE const GxRect operator | (const GxRect& rect0, const GxRect& rect1);
1034 friend GX_FORCE_INLINE b32 operator == (const GxRect& rect0, const GxRect& rect1);
1036 friend GX_FORCE_INLINE b32 operator != (const GxRect& rect0, const GxRect& rect1);
1037
1039 //-------------------------------------------------------------
1041 //-------------------------------------------------------------
1043
1045 constexpr s32 getWidth(void) const { return _right - _left; }
1047 constexpr s32 getHeight(void) const { return _bottom - _top; }
1049 GX_INLINE GxSize getSize(void) const { return GxSize(_right - _left, _bottom - _top); }
1051 GX_INLINE void setSize(const GxSize& size, BASE base = BASE::TOP_LEFT);
1052
1054 GX_INLINE GxPoint2 getLeftTop(void) const { return GxPoint2( _left,_top ); }
1056 GX_INLINE GxPoint2 getRightTop(void) const { return GxPoint2( _right,_top ); }
1058 GX_INLINE GxPoint2 getLeftBottom(void) const { return GxPoint2( _left,_bottom ); }
1060 GX_INLINE GxPoint2 getRightBottom(void) const { return GxPoint2( _right,_bottom ); }
1062 GX_INLINE GxPoint2 getCenter(void) const { return GxPoint2( (_left + _right) >> 1, (_top + _bottom) >> 1 ); }
1063
1065 GX_INLINE b32 isHit(const GxRect& rect) const;
1067 GX_INLINE b32 isIncluding(const GxRect& rect) const;
1069 GX_INLINE b32 isIncluding(const GxPoint2& point) const;
1070
1072 //-------------------------------------------------------------
1074 //-------------------------------------------------------------
1076
1078 constexpr void add(s32 x, s32 y){ _left -= x; _right += x; _top -= y; _bottom += y; }
1080 constexpr void add(s32 value){ _left -= value; _right += value; _top -= value; _bottom += value; }
1081
1083 //-------------------------------------------------------------
1085 //-------------------------------------------------------------
1087
1088 s32 _left;
1089 s32 _top;
1092
1094};
1095
1096//===========================================================================
1098//===========================================================================
1099struct GxRectF : public GxStructBase
1100{
1101 //-------------------------------------------------------------
1103 //-------------------------------------------------------------
1105public:
1106 GX_RTTI_STRUCT(GxRectF)
1107
1108
1109 static const GxRectF ZERO;
1110
1112 enum class BASE
1113 {
1114 TOP_LEFT,
1115 TOP_RIGHT,
1116 BOTTOM_LEFT,
1118 };
1119
1121 //-------------------------------------------------------------
1123 //-------------------------------------------------------------
1125
1127 GX_FORCE_INLINE GxRectF(void) : _left(0), _top(0), _right(0), _bottom(0){}
1129 GX_FORCE_INLINE GxRectF(const f32 left, const f32 top, const f32 right, const f32 bottom) : _left(left), _top(top), _right(right), _bottom(bottom){}
1131 GX_FORCE_INLINE GxRectF(const GxVector2& leftTop, const GxVector2& rightBottom) : _left(leftTop._x), _top(leftTop._y), _right(rightBottom._x), _bottom(rightBottom._y){}
1132
1134 GX_FORCE_INLINE GxRectF(const GxRectF& rect) : _left(rect._left), _top(rect._top), _right(rect._right), _bottom(rect._bottom){}
1136 GX_FORCE_INLINE void initialize(f32 left, f32 top, f32 right, f32 bottom){ _left = left; _top = top; _right = right; _bottom = bottom; }
1137
1139 //-----------------------------------------------------------
1141 //-----------------------------------------------------------
1143
1145 GX_FORCE_INLINE GxRectF& operator = (const GxRectF& rect);
1147 GX_FORCE_INLINE GxRectF& operator += (const GxRectF& rect);
1149 GX_FORCE_INLINE GxRectF& operator -= (const GxRectF& rect);
1151 GX_FORCE_INLINE GxRectF& operator += (const GxVector2& point);
1153 GX_FORCE_INLINE GxRectF& operator -= (const GxVector2& point);
1155 GX_FORCE_INLINE GxRectF& operator &= (const GxRectF& rect);
1157 GX_FORCE_INLINE GxRectF& operator |= (const GxRectF& rect);
1159 friend GX_FORCE_INLINE const GxRectF operator + (const GxRectF& rect);
1161 friend GX_FORCE_INLINE const GxRectF operator - (const GxRectF& rect);
1163 friend GX_FORCE_INLINE const GxRectF operator + (const GxRectF& rect0, const GxRectF& rect1);
1165 friend GX_FORCE_INLINE const GxRectF operator - (const GxRectF& rect0, const GxRectF& rect1);
1167 friend GX_FORCE_INLINE const GxRectF operator + (const GxRectF& rect, const GxVector2& point);
1169 friend GX_FORCE_INLINE const GxRectF operator - (const GxRectF& rect, const GxVector2& point);
1171 friend GX_FORCE_INLINE const GxRectF operator & (const GxRectF& rect0, const GxRectF& rect1);
1173 friend GX_FORCE_INLINE const GxRectF operator | (const GxRectF& rect0, const GxRectF& rect1);
1175 friend GX_FORCE_INLINE b32 operator == (const GxRectF& rect0, const GxRectF& rect1);
1177 friend GX_FORCE_INLINE b32 operator != (const GxRectF& rect0, const GxRectF& rect1);
1178
1180 //-------------------------------------------------------------
1182 //-------------------------------------------------------------
1184
1186 constexpr f32 getWidth(void) const { return _right - _left; }
1188 constexpr f32 getHeight(void) const { return _bottom - _top; }
1190 GX_INLINE GxSize getSize(void) const { return GxSize( s32(_right - _left), s32(_bottom - _top)); }
1192 GX_INLINE void setSize(const GxSize& size, BASE base = BASE::TOP_LEFT);
1194 GX_FORCE_INLINE const GxRectF& setGxRect(const GxRect& rect);
1195
1197 GX_INLINE GxVector2 getLeftTop(void) const { return GxVector2(_left, _top); }
1199 GX_INLINE GxVector2 getRightTop(void) const { return GxVector2(_right, _top); }
1201 GX_INLINE GxVector2 getLeftBottom(void) const { return GxVector2(_left, _bottom); }
1203 GX_INLINE GxVector2 getRightBottom(void) const { return GxVector2(_right, _bottom); }
1205 GX_INLINE GxVector2 getCenter(void) const { return GxVector2((_left + _right) / 2, (_top + _bottom) / 2); }
1206
1208 GX_INLINE b32 isHit(const GxRectF& rect) const;
1210 GX_INLINE b32 isIncluding(const GxRectF& rect) const;
1212 GX_INLINE b32 isIncluding(const GxVector2& point) const;
1213
1215 //-------------------------------------------------------------
1217 //-------------------------------------------------------------
1219
1221 constexpr void add(f32 x, f32 y){ _left -= x; _right += x; _top -= y; _bottom += y; }
1223 constexpr void add(f32 value){ _left -= value; _right += value; _top -= value; _bottom += value; }
1224
1226 //-------------------------------------------------------------
1228 //-------------------------------------------------------------
1230
1231 f32 _left;
1232 f32 _top;
1235
1237};
1238
1239//===========================================================================
1241//===========================================================================
1243{
1244 //-------------------------------------------------------------
1246 //-------------------------------------------------------------
1248public:
1249 GX_RTTI_STRUCT(GxFlag32Base)
1250
1251
1252 //-------------------------------------------------------------
1254 //-------------------------------------------------------------
1256
1258 GxFlag32Base(void) : _flag(0){}
1260 GxFlag32Base(u32 flag) : _flag(flag){}
1261#if GX_DEVELOP
1263 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
1264#endif //GX_DEVELOP
1265
1267 //-------------------------------------------------------------
1269 //-------------------------------------------------------------
1271
1273 constexpr u32 getFlag(void) const { return _flag; }
1275 constexpr void setFlag(u32 flag){ _flag = flag; }
1277 constexpr void clear(void){ _flag = 0; }
1278
1280 //-------------------------------------------------------------
1282 //-------------------------------------------------------------
1284protected:
1285 u32 _flag;
1286
1288};
1289
1290//===========================================================================
1292//===========================================================================
1293template<typename T> struct GxFlag32Index : public GxFlag32Base
1294{
1295 //-------------------------------------------------------------
1297 //-------------------------------------------------------------
1299public:
1302
1304 //-------------------------------------------------------------
1306 //-------------------------------------------------------------
1308
1310 GX_FORCE_INLINE GxFlag32Index<T>& operator &= (const GxFlag32Index<T>& flag) { _flag &= flag._flag; return *this; }
1312 GX_FORCE_INLINE GxFlag32Index<T>& operator |= (const GxFlag32Index<T>& flag) { _flag |= flag._flag; return *this; }
1313
1315 //-------------------------------------------------------------
1317 //-------------------------------------------------------------
1319
1321 GX_FORCE_INLINE b32 isFlag(T index) const { return (_flag & (1 << static_cast<s32>(index))) ? true : false; }
1325 GX_FORCE_INLINE void setFlag(T index, b32 enable)
1326 {
1327 GX_ASSERT((static_cast<s32>(index) >= 0) && (static_cast<s32>(index) < 32), "flag index error");
1328 enable ? _flag |= (1 << static_cast<s32>(index)) : _flag &= ~(1 << static_cast<s32>(index));
1329 }
1330
1332};
1333
1334//===========================================================================
1336//===========================================================================
1338{
1339 //-------------------------------------------------------------
1341 //-------------------------------------------------------------
1343public:
1345 GxFlag32Bit(u32 flag = 0) : GxFlag32Base(flag){}
1346
1348 //-------------------------------------------------------------
1350 //-------------------------------------------------------------
1352
1354 GX_FORCE_INLINE b32 isFlag(u32 flag) const { return (_flag & flag) ? true : false; }
1356 GX_FORCE_INLINE void setFlag(u32 flag, b32 enable){ enable ? _flag |= flag : _flag &= ~flag; }
1357
1359};
1360
1361//===========================================================================
1363//===========================================================================
1365{
1366 //-------------------------------------------------------------
1368 //-------------------------------------------------------------
1370public:
1371 // RTTI宣言
1372 GX_RTTI_STRUCT(GxFlag32Array)
1373
1374
1375 //-------------------------------------------------------------
1377 //-------------------------------------------------------------
1379public:
1381 GxFlag32Array(u32* pFlag = nullptr, u32 count = 0) : _pFlag(pFlag), _count(count){}
1383 void initialize(u32* pFlagArray, u32 count){ _pFlag = pFlagArray; _count = count; }
1384
1386 //-------------------------------------------------------------
1388 //-------------------------------------------------------------
1390
1392 void getPropertyFlag(void* const pValue, u32 index){ *( static_cast<b32* const>(pValue) ) = isFlag(index); }
1394 void setPropertyFlag(const void* const pValue, u32 index){ setFlag(index, *( static_cast<const b32* const>(pValue) ) ); }
1396 constexpr u32 getPropertyFlagCount(void) const { return _count; }
1398 constexpr void setPropertyFlagCount(u32){}
1399
1401 GX_FORCE_INLINE void clear(void){ clear(_pFlag, _count); }
1403 GX_FORCE_INLINE void setFlag(u32 flagIndex, b32 enable = true){ if( flagIndex < _count ){ setFlag(_pFlag, flagIndex, enable); } }
1404
1406 GX_FORCE_INLINE b32 isFlag(u32 flagIndex) const { if( flagIndex < _count ){ return isFlag(_pFlag, flagIndex); } return false; }
1408 GX_FORCE_INLINE u32 getSize(void) const { return getSize( _count ); }
1410 constexpr u32 getCount(void) const { return _count; }
1411
1413 static void clear(u32* pFlags, u32 flagCount);
1415 static void setFlag(u32* pFlags, u32 flagIndex, b32 enable);
1417 static b32 isFlag(const u32* pFlags, u32 flagIndex);
1419 static u32* getValuePointer(const u32* pFlags, u32 flagIndex);
1421 static u32 getSize(u32 count);
1422
1424 //-------------------------------------------------------------
1426 //-------------------------------------------------------------
1428protected:
1429 u32* _pFlag;
1431
1433};
1434
1435GX_CORE_NAMESPACE_END()
1436
1437#include "GxStruct.inl"
1438#include "GxVector.inl"
1439#include "GxVectord.inl"
1440#include "GxMatrix.inl"
1441#include "GxQuaternion.inl"
1442#include "GxColor.inl"
カラー
void GxTypedObject
その他
Definition GxDefine.h:213
クォータニオン
ベクトル
ベクトル(倍精度)
プロパティクラス
Definition GxProperty.h:48
実行時型情報クラス
Definition GxRtti.h:154
ストリーム書き込みクラス
Definition GxStreamWriter.h:19
2次元浮動小数点数(倍精度)クラス
Definition GxStruct.h:207
GX_FORCE_INLINE GxDouble2(f64 x, f64 y)
コンストラクタ
Definition GxStruct.h:216
GX_FORCE_INLINE GxDouble2(void)
デフォルトコンストラクタ
Definition GxStruct.h:214
f64 _x
X値
Definition GxStruct.h:260
GX_FORCE_INLINE GxDouble2 & operator=(const GxDouble2 &double2)
代入
Definition GxStruct.inl:322
f64 _v
V値
Definition GxStruct.h:266
f64 _y
Y値
Definition GxStruct.h:265
GX_FORCE_INLINE GxDouble2(const GxDouble2 &double2)
コピーコンストラクタ
Definition GxStruct.h:231
f64 _u
U値
Definition GxStruct.h:261
3次元浮動小数点数(倍精度)クラス
Definition GxStruct.h:276
GX_FORCE_INLINE GxDouble3(void)
デフォルトコンストラクタ
Definition GxStruct.h:283
f64 _x
X値
Definition GxStruct.h:327
f64 _z
Z値
Definition GxStruct.h:329
f64 _y
Y値
Definition GxStruct.h:328
GX_FORCE_INLINE GxDouble3(f64 x, f64 y, f64 z)
コンストラクタ
Definition GxStruct.h:285
GX_FORCE_INLINE GxDouble3(const GxDouble3 &double3)
コピーコンストラクタ
Definition GxStruct.h:294
GX_FORCE_INLINE GxDouble3 & operator=(const GxVector3d &vector)
代入
Definition GxStruct.inl:394
4次元浮動小数点数(倍精度)クラス
Definition GxStruct.h:338
GX_FORCE_INLINE GxDouble4(void)
デフォルトコンストラクタ
Definition GxStruct.h:345
f64 _z
Z値
Definition GxStruct.h:375
f64 _w
W値
Definition GxStruct.h:376
f64 _x
X値
Definition GxStruct.h:373
GX_FORCE_INLINE GxDouble4 & operator=(const GxVector4d &vector)
代入
Definition GxStruct.inl:435
f64 _y
Y値
Definition GxStruct.h:374
GX_FORCE_INLINE GxDouble4(const GxDouble4 &double4)
コピーコンストラクタ
Definition GxStruct.h:352
GX_FORCE_INLINE GxDouble4(f64 x, f64 y, f64 z, f64 w)
コンストラクタ
Definition GxStruct.h:347
16bit浮動小数
Definition GxStruct.h:386
static GX_FORCE_INLINE f32 f16ToF32(GxF16 valueF16)
16ビットから32ビットの変換
Definition GxStruct.inl:547
constexpr void setValueU16(u16 setValue)
u16で値を設定
Definition GxStruct.h:422
static GX_FORCE_INLINE GxF16 f32ToF16(f32 valueF32)
32ビットから16ビットの変換
Definition GxStruct.inl:486
GX_INLINE GxF16(void)
デフォルトコンストラクタ
Definition GxStruct.inl:450
constexpr u16 getValueU16(void) const
u16で値を取得
Definition GxStruct.h:420
16bit浮動小数2次元ベクトル
Definition GxStruct.h:440
GxF16 _value[2]
Definition GxStruct.h:474
GX_INLINE GxF16x2(const GxFloat2 &value)
コンストラクタ
Definition GxStruct.h:451
GX_INLINE GxF16x2(const GxF16x2 &value)
コンストラクタ
Definition GxStruct.h:449
GX_FORCE_INLINE GxF16x2 & operator=(const GxF16x2 &value)
代入
Definition GxStruct.inl:577
GX_INLINE GxF16x2(const GxVector2 &value)
コンストラクタ
Definition GxStruct.h:453
GxF16x2(void)
デフォルトコンストラクタ
Definition GxStruct.h:447
16bit浮動小数4次元ベクトル
Definition GxStruct.h:483
GX_INLINE GxF16x4(const GxFloat4 &value)
コンストラクタ
Definition GxStruct.h:496
GX_INLINE GxF16x4(const GxVector4 &value)
コンストラクタ
Definition GxStruct.h:500
GX_INLINE GxF16x4(const GxFloat3 &value)
コンストラクタ
Definition GxStruct.h:494
GxF16x4(void)
デフォルトコンストラクタ
Definition GxStruct.h:490
GxF16 _value[4]
Definition GxStruct.h:521
GX_INLINE GxF16x4(const GxF16x4 &value)
コンストラクタ
Definition GxStruct.h:492
GX_INLINE GxF16x4(const GxVector3 &value)
コンストラクタ
Definition GxStruct.h:498
GX_FORCE_INLINE GxF16x4 & operator=(const GxF16x4 &value)
代入
Definition GxStruct.inl:619
32ビットフラグ配列の操作
Definition GxStruct.h:1365
void initialize(u32 *pFlagArray, u32 count)
初期化
Definition GxStruct.h:1383
u32 * _pFlag
フラグデータ
Definition GxStruct.h:1429
static u32 * getValuePointer(const u32 *pFlags, u32 flagIndex)
フラグのポインタを取得(static関数)
Definition GxStruct.cpp:238
GX_FORCE_INLINE b32 isFlag(u32 flagIndex) const
フラグを判定
Definition GxStruct.h:1406
u32 _count
フラグ数
Definition GxStruct.h:1430
constexpr u32 getPropertyFlagCount(void) const
プロパティ用フラグ数取得
Definition GxStruct.h:1396
constexpr void setPropertyFlagCount(u32)
プロパティ用フラグ数設定(Dummy)
Definition GxStruct.h:1398
void setPropertyFlag(const void *const pValue, u32 index)
プロパティ用フラグ設定
Definition GxStruct.h:1394
constexpr u32 getCount(void) const
フラグ数を取得
Definition GxStruct.h:1410
GX_FORCE_INLINE void setFlag(u32 flagIndex, b32 enable=true)
フラグを設定
Definition GxStruct.h:1403
GX_FORCE_INLINE void clear(void)
クリア
Definition GxStruct.h:1401
GxFlag32Array(u32 *pFlag=nullptr, u32 count=0)
コンストラクタ
Definition GxStruct.h:1381
GX_FORCE_INLINE u32 getSize(void) const
サイズを取得
Definition GxStruct.h:1408
void getPropertyFlag(void *const pValue, u32 index)
プロパティ用フラグ取得
Definition GxStruct.h:1392
フラグ
Definition GxStruct.h:1243
u32 _flag
フラグ
Definition GxStruct.h:1285
constexpr u32 getFlag(void) const
フラグ直取得
Definition GxStruct.h:1273
constexpr void clear(void)
フラグ値のクリア
Definition GxStruct.h:1277
GxFlag32Base(u32 flag)
コンストラクタ
Definition GxStruct.h:1260
constexpr void setFlag(u32 flag)
フラグ直設定
Definition GxStruct.h:1275
ビット指定型フラグ
Definition GxStruct.h:1338
GX_FORCE_INLINE b32 isFlag(u32 flag) const
フラグ判定
Definition GxStruct.h:1354
GX_FORCE_INLINE void setFlag(u32 flag, b32 enable)
フラグ設定
Definition GxStruct.h:1356
GxFlag32Bit(u32 flag=0)
コンストラクタ
Definition GxStruct.h:1345
インデックス指定型フラグ
Definition GxStruct.h:1294
GX_FORCE_INLINE void setFlag(T index, b32 enable)
Definition GxStruct.h:1325
GX_FORCE_INLINE b32 isFlag(T index) const
フラグ直取得
Definition GxStruct.h:1321
GX_FORCE_INLINE GxFlag32Index< T > & operator&=(const GxFlag32Index< T > &flag)
論理積
Definition GxStruct.h:1310
GX_FORCE_INLINE GxFlag32Index< T > & operator|=(const GxFlag32Index< T > &flag)
論理和
Definition GxStruct.h:1312
GxFlag32Index(void)
コンストラクタ
Definition GxStruct.h:1301
2次元浮動小数点数クラス
Definition GxStruct.h:22
f32 _u
U値
Definition GxStruct.h:76
GX_FORCE_INLINE GxFloat2(void)
デフォルトコンストラクタ
Definition GxStruct.h:29
f32 _x
X値
Definition GxStruct.h:75
f32 _y
Y値
Definition GxStruct.h:80
GX_FORCE_INLINE GxFloat2(f32 x, f32 y)
コンストラクタ
Definition GxStruct.h:31
f32 _v
V値
Definition GxStruct.h:81
GX_FORCE_INLINE GxFloat2(const GxFloat2 &float2)
コピーコンストラクタ
Definition GxStruct.h:46
3次元浮動小数点数クラス
Definition GxStruct.h:91
GX_FORCE_INLINE GxFloat3(const GxFloat3 &float3)
コピーコンストラクタ
Definition GxStruct.h:109
GX_FORCE_INLINE GxFloat3(f32 x, f32 y, f32 z)
コンストラクタ
Definition GxStruct.h:100
f32 _y
Y値
Definition GxStruct.h:143
f32 _x
X値
Definition GxStruct.h:142
GX_FORCE_INLINE GxFloat3(void)
デフォルトコンストラクタ
Definition GxStruct.h:98
GX_FORCE_INLINE GxFloat3 & operator=(const GxVector3 &vector)
代入
Definition GxStruct.inl:166
f32 _z
Z値
Definition GxStruct.h:144
4次元浮動小数点数クラス
Definition GxStruct.h:153
GX_FORCE_INLINE GxFloat4 & operator=(const GxVector4 &vector)
代入
Definition GxStruct.inl:219
f32 _x
X値
Definition GxStruct.h:192
f32 _y
Y値
Definition GxStruct.h:193
f32 _z
Z値
Definition GxStruct.h:194
GX_FORCE_INLINE GxFloat4(void)
デフォルトコンストラクタ
Definition GxStruct.h:160
GX_FORCE_INLINE GxFloat4(f32 x, f32 y, f32 z, f32 w)
コンストラクタ
Definition GxStruct.h:162
f32 _w
W値
Definition GxStruct.h:195
GX_FORCE_INLINE GxFloat4(const GxFloat4 &float4)
コピーコンストラクタ
Definition GxStruct.h:169
32bit[-1, 1]正規化小数3次元ベクトル(11:11:10)
Definition GxStruct.h:646
GX_FORCE_INLINE f32 getValueF32(u32 index) const
f32で値を取得
Definition GxStruct.inl:902
GX_FORCE_INLINE GxPackedNx3 & operator=(const GxPackedNx3 &value)
代入
Definition GxStruct.h:683
static GX_FORCE_INLINE f32 s10NTof32(u32 valueS10N)
10ビットから32ビットの変換
Definition GxStruct.inl:829
static constexpr u32 SHIFT_Y
Y成分シフト量
Definition GxStruct.h:657
static GX_FORCE_INLINE u32 f32ToS10N(f32 valueF32)
32ビットから10ビットの変換
Definition GxStruct.inl:804
static constexpr u32 SHIFT_X
X成分シフト量
Definition GxStruct.h:655
static constexpr u32 DIMENSION
次元数
Definition GxStruct.h:653
GxPackedNx3(void)
デフォルトコンストラクタ
Definition GxStruct.h:668
GX_INLINE GxPackedNx3(const GxPackedNx3 &value)
コンストラクタ
Definition GxStruct.h:670
GX_FORCE_INLINE void setValueF32(u32 index, f32 setValue)
f32で値を設定
Definition GxStruct.inl:939
GX_INLINE GxPackedNx3(const GxVector3 &value)
コンストラクタ
Definition GxStruct.h:674
static GX_FORCE_INLINE f32 s11NTof32(u32 valueS11N)
11ビットから32ビットの変換
Definition GxStruct.inl:878
GX_INLINE GxPackedNx3(const GxFloat3 &value)
コンストラクタ
Definition GxStruct.h:672
static constexpr u32 SHIFT_Z
Z成分シフト量
Definition GxStruct.h:659
static GX_FORCE_INLINE u32 f32ToS11N(f32 valueF32)
32ビットから11ビットの変換
Definition GxStruct.inl:853
座標
Definition GxStruct.h:867
s32 _y
Y値
Definition GxStruct.h:942
GX_FORCE_INLINE GxPoint2 & operator-=(const GxPoint2 &point)
減算代入
Definition GxStruct.inl:1475
GX_FORCE_INLINE GxPoint2 & operator=(const GxPoint2 &point)
代入
Definition GxStruct.inl:1451
friend GX_FORCE_INLINE b32 operator==(const GxPoint2 &point0, const GxPoint2 &point1)
一致
Definition GxStruct.inl:1556
friend GX_FORCE_INLINE const GxPoint2 operator-(const GxPoint2 &point)
負ベクトル
Definition GxStruct.h:912
GX_FORCE_INLINE GxPoint2(void)
コンストラクタ
Definition GxStruct.h:885
friend GX_FORCE_INLINE const GxPoint2 operator+(const GxPoint2 &point)
正ベクトル
Definition GxStruct.h:910
friend GX_FORCE_INLINE b32 operator!=(const GxPoint2 &point0, const GxPoint2 &point1)
不一致
Definition GxStruct.inl:1567
f32 getSquareDistanceToSegment(GxPoint2 segmentStart, GxPoint2 segmentEnd) const
線分との距離の2乗を取得
Definition GxStruct.cpp:128
static const GxPoint2 ZERO
原点座標
Definition GxStruct.h:876
s32 _x
X値
Definition GxStruct.h:941
GX_FORCE_INLINE GxPoint2 & operator+=(const GxPoint2 &point)
加算代入
Definition GxStruct.inl:1463
クォータニオン
Definition GxQuaternion.h:19
実数矩形
Definition GxStruct.h:1100
friend GX_FORCE_INLINE b32 operator!=(const GxRectF &rect0, const GxRectF &rect1)
不一致
Definition GxStruct.inl:2056
f32 _left
左辺
Definition GxStruct.h:1231
GX_INLINE GxVector2 getLeftBottom(void) const
左下を取得
Definition GxStruct.h:1201
GX_INLINE b32 isHit(const GxRectF &rect) const
衝突判定
Definition GxStruct.inl:2066
GX_INLINE GxVector2 getCenter(void) const
中央を取得
Definition GxStruct.h:1205
friend GX_FORCE_INLINE b32 operator==(const GxRectF &rect0, const GxRectF &rect1)
一致
Definition GxStruct.inl:2045
GX_FORCE_INLINE GxRectF(const f32 left, const f32 top, const f32 right, const f32 bottom)
コンストラクタ
Definition GxStruct.h:1129
GX_FORCE_INLINE GxRectF(void)
デフォルトコンストラクタ
Definition GxStruct.h:1127
GX_FORCE_INLINE GxRectF & operator+=(const GxRectF &rect)
加算
Definition GxStruct.inl:1874
f32 _bottom
底辺
Definition GxStruct.h:1234
f32 _top
上辺
Definition GxStruct.h:1232
GX_INLINE b32 isIncluding(const GxRectF &rect) const
内包判定
Definition GxStruct.inl:2081
friend GX_FORCE_INLINE const GxRectF operator-(const GxRectF &rect)
Definition GxStruct.inl:1968
constexpr f32 getHeight(void) const
高さを取得
Definition GxStruct.h:1188
GX_FORCE_INLINE const GxRectF & setGxRect(const GxRect &rect)
GxRect型をセット(セット後に自身を返す)
Definition GxStruct.inl:2136
GX_FORCE_INLINE GxRectF & operator-=(const GxRectF &rect)
減算
Definition GxStruct.inl:1888
BASE
基準位置
Definition GxStruct.h:1113
@ BOTTOM_RIGHT
右下
@ TOP_LEFT
左上
@ BOTTOM_LEFT
左下
@ TOP_RIGHT
右上
friend GX_FORCE_INLINE const GxRectF operator&(const GxRectF &rect0, const GxRectF &rect1)
論理積
Definition GxStruct.inl:2023
GX_INLINE GxVector2 getLeftTop(void) const
左上を取得
Definition GxStruct.h:1197
GX_FORCE_INLINE GxRectF(const GxRectF &rect)
コピーコンストラクタ
Definition GxStruct.h:1134
friend GX_FORCE_INLINE const GxRectF operator+(const GxRectF &rect)
Definition GxStruct.inl:1958
f32 _right
右辺
Definition GxStruct.h:1233
GX_INLINE void setSize(const GxSize &size, BASE base=BASE::TOP_LEFT)
サイズの変更
Definition GxStruct.inl:2108
GX_FORCE_INLINE GxRectF & operator|=(const GxRectF &rect)
論理和
Definition GxStruct.inl:1944
GX_INLINE GxVector2 getRightBottom(void) const
右下を取得
Definition GxStruct.h:1203
GX_FORCE_INLINE GxRectF & operator=(const GxRectF &rect)
代入
Definition GxStruct.inl:1860
GX_INLINE GxVector2 getRightTop(void) const
右上を取得
Definition GxStruct.h:1199
constexpr void add(f32 value)
拡大・縮小
Definition GxStruct.h:1223
constexpr f32 getWidth(void) const
幅を取得
Definition GxStruct.h:1186
constexpr void add(f32 x, f32 y)
拡大・縮小
Definition GxStruct.h:1221
GX_FORCE_INLINE GxRectF & operator&=(const GxRectF &rect)
論理積
Definition GxStruct.inl:1930
GX_FORCE_INLINE void initialize(f32 left, f32 top, f32 right, f32 bottom)
初期化
Definition GxStruct.h:1136
GX_FORCE_INLINE GxRectF(const GxVector2 &leftTop, const GxVector2 &rightBottom)
コンストラクタ
Definition GxStruct.h:1131
GX_INLINE GxSize getSize(void) const
サイズを取得
Definition GxStruct.h:1190
friend GX_FORCE_INLINE const GxRectF operator|(const GxRectF &rect0, const GxRectF &rect1)
論理和
Definition GxStruct.inl:2034
static const GxRectF ZERO
(0, 0, 0, 0)
Definition GxStruct.h:1109
矩形
Definition GxStruct.h:951
static const GxRect MIN
(max, max, min, min)
Definition GxStruct.h:960
constexpr void add(s32 value)
拡大・縮小
Definition GxStruct.h:1080
friend GX_FORCE_INLINE b32 operator!=(const GxRect &rect0, const GxRect &rect1)
不一致
Definition GxStruct.inl:1776
GX_FORCE_INLINE GxRect(const GxPoint2 &leftTop, const GxPoint2 &rightBottom)
コンストラクタ
Definition GxStruct.h:990
GX_FORCE_INLINE GxRect & operator+=(const GxRect &rect)
加算
Definition GxStruct.inl:1594
GX_INLINE GxPoint2 getLeftBottom(void) const
左下を取得
Definition GxStruct.h:1058
friend GX_FORCE_INLINE const GxRect operator&(const GxRect &rect0, const GxRect &rect1)
論理積
Definition GxStruct.inl:1743
GX_FORCE_INLINE GxRect(const GxSize &size)
コンストラクタ
Definition GxStruct.h:986
GX_FORCE_INLINE GxRect & operator|=(const GxRect &rect)
論理和
Definition GxStruct.inl:1664
GX_INLINE GxPoint2 getLeftTop(void) const
左上を取得
Definition GxStruct.h:1054
GX_FORCE_INLINE GxRect & operator&=(const GxRect &rect)
論理積
Definition GxStruct.inl:1650
GX_FORCE_INLINE void initialize(s32 left, s32 top, s32 right, s32 bottom)
初期化
Definition GxStruct.h:995
GX_FORCE_INLINE GxRect & operator-=(const GxRect &rect)
減算
Definition GxStruct.inl:1608
friend GX_FORCE_INLINE const GxRect operator+(const GxRect &rect)
Definition GxStruct.inl:1678
static const GxRect MAX
(min, min, max, max)
Definition GxStruct.h:962
s32 _bottom
底辺
Definition GxStruct.h:1091
GX_INLINE b32 isIncluding(const GxRect &rect) const
内包判定
Definition GxStruct.inl:1801
friend GX_FORCE_INLINE const GxRect operator-(const GxRect &rect)
Definition GxStruct.inl:1688
GX_INLINE GxSize getSize(void) const
サイズを取得
Definition GxStruct.h:1049
GX_INLINE GxPoint2 getRightBottom(void) const
右下を取得
Definition GxStruct.h:1060
friend GX_FORCE_INLINE const GxRect operator|(const GxRect &rect0, const GxRect &rect1)
論理和
Definition GxStruct.inl:1754
static const GxRect ZERO
(0, 0, 0, 0)
Definition GxStruct.h:964
friend GX_FORCE_INLINE b32 operator==(const GxRect &rect0, const GxRect &rect1)
一致
Definition GxStruct.inl:1765
GX_FORCE_INLINE GxRect & operator=(const GxRect &rect)
代入
Definition GxStruct.inl:1580
GX_INLINE void setSize(const GxSize &size, BASE base=BASE::TOP_LEFT)
サイズの変更
Definition GxStruct.inl:1829
GX_FORCE_INLINE GxRect(void)
デフォルトコンストラクタ
Definition GxStruct.h:982
GX_FORCE_INLINE GxRect(const s32 left, const s32 top, const s32 right, const s32 bottom)
コンストラクタ
Definition GxStruct.h:984
constexpr void add(s32 x, s32 y)
拡大・縮小
Definition GxStruct.h:1078
GX_INLINE GxPoint2 getRightTop(void) const
右上を取得
Definition GxStruct.h:1056
GX_FORCE_INLINE GxRect(const GxPoint2 &leftTop, const GxSize &size)
コンストラクタ
Definition GxStruct.h:988
GX_INLINE b32 isHit(const GxRect &rect) const
衝突判定
Definition GxStruct.inl:1786
BASE
基準位置
Definition GxStruct.h:968
@ BOTTOM_RIGHT
右下
@ TOP_LEFT
左上
@ BOTTOM_LEFT
左下
@ TOP_RIGHT
右上
GX_INLINE GxPoint2 getCenter(void) const
中央を取得
Definition GxStruct.h:1062
constexpr s32 getWidth(void) const
幅を取得
Definition GxStruct.h:1045
constexpr s32 getHeight(void) const
高さを取得
Definition GxStruct.h:1047
GX_FORCE_INLINE GxRect(const GxRect &rect)
コピーコンストラクタ
Definition GxStruct.h:993
s32 _top
上辺
Definition GxStruct.h:1089
s32 _left
左辺
Definition GxStruct.h:1088
s32 _right
右辺
Definition GxStruct.h:1090
サイズ
Definition GxStruct.h:730
GX_FORCE_INLINE const GxSize & subScalar(s32 scalar)
スカラ減算
Definition GxStruct.inl:1338
GX_FORCE_INLINE GxSize & operator+=(s32 scalar)
スカラ加算代入
Definition GxStruct.inl:1017
GX_FORCE_INLINE GxSize & operator=(const GxSize &size)
代入
Definition GxStruct.inl:1005
friend GX_FORCE_INLINE const GxSize operator&(const GxSize &size0, const GxSize &size1)
論理積
Definition GxStruct.inl:1192
friend GX_FORCE_INLINE const GxSize operator/(const GxSize &size, s32 scalar)
スカラ除算
Definition GxStruct.inl:1156
friend GX_FORCE_INLINE const GxSize operator|(const GxSize &size0, const GxSize &size1)
論理和
Definition GxStruct.inl:1203
GX_FORCE_INLINE GxSize & operator&=(const GxSize &size)
論理積
Definition GxStruct.inl:1083
GX_FORCE_INLINE GxSize & operator-=(s32 scalar)
スカラ減算代入
Definition GxStruct.inl:1028
GX_FORCE_INLINE const GxSize & mulScalar(s32 scalar)
スカラ乗算
Definition GxStruct.inl:1351
static const GxSize MIN
最小
Definition GxStruct.h:739
GX_FORCE_INLINE GxSize(void)
デフォルトコンストラクタ
Definition GxStruct.h:752
GX_FORCE_INLINE GxSize & operator|=(const GxSize &size)
論理和
Definition GxStruct.inl:1095
static GX_FORCE_INLINE const GxSize & getSubScalar(GxSize &dst, const GxSize &size, s32 scalar)
スカラ減算を取得
Definition GxStruct.inl:1252
GX_INLINE b32 isIncluding(const GxPoint2 &point) const
内包判定
Definition GxStruct.inl:1403
static const GxSize ZERO
0
Definition GxStruct.h:743
GX_FORCE_INLINE GxSize & operator*=(s32 scalar)
スカラ乗算代入
Definition GxStruct.inl:1039
GX_FORCE_INLINE const GxSize & subSize(const GxSize &size)
サイズ減算
Definition GxStruct.inl:1390
s32 _width
Definition GxStruct.h:857
static GX_FORCE_INLINE const GxSize & getDivScalar(GxSize &dst, const GxSize &size, s32 scalar)
スカラ除算を取得
Definition GxStruct.inl:1282
s32 _height
高さ
Definition GxStruct.h:858
static GX_FORCE_INLINE const GxSize & getAddSize(GxSize &dst, const GxSize &size0, const GxSize &size1)
サイズ加算を取得
Definition GxStruct.inl:1297
GX_FORCE_INLINE GxSize & operator/=(s32 scalar)
スカラ除算代入
Definition GxStruct.inl:1050
GX_FORCE_INLINE const GxSize & addSize(const GxSize &size)
サイズ加算
Definition GxStruct.inl:1377
GX_FORCE_INLINE const GxSize & mulSize(const GxSize &size)
サイズ乗算
GX_FORCE_INLINE const GxSize & addScalar(s32 scalar)
スカラ加算
Definition GxStruct.inl:1325
static GX_FORCE_INLINE const GxSize & getSubSize(GxSize &dst, const GxSize &size0, const GxSize &size1)
サイズ減算を取得
Definition GxStruct.inl:1312
static GX_FORCE_INLINE const GxSize & getMulScalar(GxSize &dst, const GxSize &size, s32 scalar)
スカラ乗算を取得
Definition GxStruct.inl:1267
friend GX_FORCE_INLINE const GxSize operator*(const GxSize &size, s32 scalar)
スカラ乗算
Definition GxStruct.inl:1132
friend GX_FORCE_INLINE const GxSize operator+(const GxSize &size, s32 scalar)
スカラ加算
Definition GxStruct.inl:1108
static GX_FORCE_INLINE const GxSize & getAddScalar(GxSize &dst, const GxSize &size, s32 scalar)
スカラ加算を取得
Definition GxStruct.inl:1237
friend GX_FORCE_INLINE b32 operator!=(const GxSize &size0, const GxSize &size1)
不一致
Definition GxStruct.inl:1225
friend GX_FORCE_INLINE const GxSize operator-(const GxSize &size, s32 scalar)
スカラ減算
Definition GxStruct.inl:1120
friend GX_FORCE_INLINE b32 operator==(const GxSize &size0, const GxSize &size1)
一致
Definition GxStruct.inl:1214
GX_FORCE_INLINE const GxSize & divScalar(s32 scalar)
スカラ除算
Definition GxStruct.inl:1364
static const GxSize MAX
最大
Definition GxStruct.h:741
Definition GxBase.h:24
8bit[0, 1]正規化小数
Definition GxStruct.h:530
static GX_FORCE_INLINE f32 u8NToF32(GxU8N valueU8N)
8ビットから32ビットの変換
Definition GxStruct.inl:715
static GX_FORCE_INLINE GxU8N f32ToU8N(f32 valueF32)
32ビットから8ビットの変換
Definition GxStruct.inl:700
constexpr u8 getValueU8(void) const
u8で値を取得する
Definition GxStruct.h:564
constexpr void setValueU8(u8 setValue)
u8で値を設定する
Definition GxStruct.h:566
GX_INLINE GxU8N(void)
デフォルトコンストラクタ
Definition GxStruct.inl:665
32bit[0, 1]正規化小数4次元ベクトル(8:8:8:8)
Definition GxStruct.h:583
GX_INLINE GxU8Nx4(const GxVector4 &value)
コンストラクタ
Definition GxStruct.h:605
GxU8Nx4(void)
デフォルトコンストラクタ
Definition GxStruct.h:599
GX_FORCE_INLINE const GxU8N & operator[](u32 i) const
const配列
Definition GxStruct.h:627
GX_FORCE_INLINE GxU8N & operator[](u32 i)
配列
Definition GxStruct.h:629
GX_INLINE GxU8Nx4(const GxFloat4 &value)
コンストラクタ
Definition GxStruct.h:603
GX_FORCE_INLINE GxU8Nx4 & operator=(const GxU8Nx4 &value)
代入
Definition GxStruct.inl:728
static constexpr u32 DIMENSION
次元数
Definition GxStruct.h:590
GX_INLINE GxU8Nx4(const GxU8Nx4 &value)
コンストラクタ
Definition GxStruct.h:601
2次元ベクトル
Definition GxVector.h:34
2次元ベクトル(倍精度)
Definition GxVectord.h:25
3次元ベクトル
Definition GxVector.h:245
f32 _z
Z値
Definition GxVector.h:572
f32 _y
Y値
Definition GxVector.h:571
f32 _x
X値
Definition GxVector.h:570
3次元ベクトル(倍精度)
Definition GxVectord.h:235
4次元ベクトル
Definition GxVector.h:582
4次元ベクトル(倍精度)
Definition GxVectord.h:497
32bitブーリアン
Definition GxDefine.h:173