-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLKit.framework.h
5305 lines (4454 loc) · 197 KB
/
GLKit.framework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========== GLKit.framework/Headers/GLKEffectPropertyLight.h
//
// GLKEffectPropertyLight.h
// GLKEffects
//
// Copyright (c) 2011-2012 Apple Inc. All rights reserved.
//
#import <GLKit/GLKitBase.h>
#import <GLKit/GLKEffectProperty.h>
#import <GLKit/GLKEffectPropertyTransform.h>
typedef NS_ENUM(GLint, GLKLightingType)
{
GLKLightingTypePerVertex,
GLKLightingTypePerPixel
} NS_ENUM_AVAILABLE(10_8, 5_0);
/*
GLKEffectPropertyLight
GLKEffectPropertyLight provides a single directional or spot light for an GLKEffect
in accordance with the OpenGL ES 1.1 specification.
Per the OpenGL ES 1.1 specification, light position and directions are transformed
by the modelview matrix. Accordingly, GLKEffectPropertyLight has a transform property.
If light transformation is required the transform property must be explicitly set
for light properties.
In order for lighting calculations to function properly, clients of GLKEffectPropertyLight
must enable the vertex attribute array GLKVertexAttribNormal to provide normals for
lighting calculations. The normals are always normalized.
The default values for GLKEffectPropertyLight properties are as follows:
{ 0, 0, 1, 0}, // position
{ 0, 0, 0, 1}, // ambient color
{ 1, 1, 1, 1}, // diffuse color
{ 1, 1, 1, 1}, // specular color
{ 0, 0, -1}, // spot direction
0, // spot exponent
180, // spot cutoff
1, // constant attenuation
0, // linear attenuation
0, // quadratic attenuation
Note that, as with OpenGL ES 1.1 differentiation between a directional and spot light
pivots on the value specified for _spotCutoff. A _spotCutoff of 180.0, the default
value, indicates a directional light while values less than 180.0 indicates a
spot light.
*/
NS_ASSUME_NONNULL_BEGIN
OPENGL_DEPRECATED(10.8,10.14) OPENGLES_DEPRECATED(ios(5.0,12.0), tvos(9.0,12.0))
@interface GLKEffectPropertyLight : GLKEffectProperty
{
@private
// Light parameters
GLboolean _enabled;
GLKVector4 _position;
GLKVector4 _ambientColor, _diffuseColor, _specularColor;
GLKVector3 _spotDirection;
GLfloat _spotExponent, _spotCutoff;
GLfloat _constantAttenuation, _linearAttenuation, _quadraticAttenuation;
// Transform for independent transformation of light position and direction
GLKEffectPropertyTransform *_transform;
}
// Properties // Default Value
@property (nonatomic, assign) GLboolean enabled; // GL_TRUE
@property (nonatomic, assign) GLKVector4 position; // { 0.0, 0.0, 0.0, 1.0 }
@property (nonatomic, assign) GLKVector4 ambientColor; // { 0.0, 0.0, 0.0, 1.0 }
@property (nonatomic, assign) GLKVector4 diffuseColor; // { 1.0, 1.0, 1.0, 1.0 }
@property (nonatomic, assign) GLKVector4 specularColor; // { 1.0, 1.0, 1.0, 1.0 }
@property (nonatomic, assign) GLKVector3 spotDirection; // { 0.0, 0.0, -1.0 }
@property (nonatomic, assign) GLfloat spotExponent; // 0.0
@property (nonatomic, assign) GLfloat spotCutoff; // 180.0
@property (nonatomic, assign) GLfloat constantAttenuation, linearAttenuation, quadraticAttenuation; // 1.0, 0.0, 0.0
@property (nonatomic, retain) GLKEffectPropertyTransform *transform; // All identity matrices
@end
NS_ASSUME_NONNULL_END
// ========== GLKit.framework/Headers/GLKView.h
//
// GLKView.h
// GLKit
//
// Copyright (c) 2011-2012, Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GLKit/GLKitBase.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/*
Enums for color buffer formats.
*/
typedef NS_ENUM(GLint, GLKViewDrawableColorFormat)
{
GLKViewDrawableColorFormatRGBA8888 = 0,
GLKViewDrawableColorFormatRGB565,
GLKViewDrawableColorFormatSRGBA8888,
} NS_ENUM_AVAILABLE(10_8, 5_0);
/*
Enums for depth buffer formats.
*/
typedef NS_ENUM(GLint, GLKViewDrawableDepthFormat)
{
GLKViewDrawableDepthFormatNone = 0,
GLKViewDrawableDepthFormat16,
GLKViewDrawableDepthFormat24,
} NS_ENUM_AVAILABLE(10_8, 5_0);
/*
Enums for stencil buffer formats.
*/
typedef NS_ENUM(GLint, GLKViewDrawableStencilFormat)
{
GLKViewDrawableStencilFormatNone = 0,
GLKViewDrawableStencilFormat8,
} NS_ENUM_AVAILABLE(10_8, 5_0);
/*
Enums for MSAA.
*/
typedef NS_ENUM(GLint, GLKViewDrawableMultisample)
{
GLKViewDrawableMultisampleNone = 0,
GLKViewDrawableMultisample4X,
} NS_ENUM_AVAILABLE(10_8, 5_0);
@class EAGLContext;
@protocol GLKViewDelegate;
#pragma mark -
#pragma mark GLKView
#pragma mark -
OPENGLES_DEPRECATED(ios(5.0,12.0), tvos(9.0,12.0))
API_UNAVAILABLE(macos)
@interface GLKView : UIView <NSCoding>
{
}
- (instancetype)initWithFrame:(CGRect)frame context:(EAGLContext *)context;
@property (nullable, nonatomic, assign) IBOutlet id <GLKViewDelegate> delegate;
@property (nonatomic, retain) EAGLContext *context;
@property (nonatomic, readonly) NSInteger drawableWidth;
@property (nonatomic, readonly) NSInteger drawableHeight;
@property (nonatomic) GLKViewDrawableColorFormat drawableColorFormat;
@property (nonatomic) GLKViewDrawableDepthFormat drawableDepthFormat;
@property (nonatomic) GLKViewDrawableStencilFormat drawableStencilFormat;
@property (nonatomic) GLKViewDrawableMultisample drawableMultisample;
/*
Binds the context and drawable. This needs to be called when the currently bound framebuffer
has been changed during the draw method.
*/
- (void)bindDrawable;
/*
deleteDrawable is normally invoked by the GLKViewController when an application is backgrounded, etc.
It is the responsibility of the developer to call deleteDrawable when a GLKViewController isn't being used.
*/
- (void)deleteDrawable;
/*
Returns a UIImage of the resulting draw. Snapshot should never be called from within the draw method.
*/
@property (readonly, strong) UIImage *snapshot;
/*
Controls whether the view responds to setNeedsDisplay. If true, then the view behaves similarily to a UIView.
When the view has been marked for display, the draw method is called during the next drawing cycle. If false,
the view's draw method will never be called during the next drawing cycle. It is expected that -display will be
called directly in this case. enableSetNeedsDisplay is automatically set to false when used in conjunction with
the GLKViewController. This value is true by default.
*/
@property (nonatomic) BOOL enableSetNeedsDisplay;
/*
-display should be called when the view has been set to ignore calls to setNeedsDisplay. This method is used by
the GLKViewController to invoke the draw method. It can also be used when not using a GLKViewController and custom
control of the display loop is needed.
*/
- (void)display;
@end
#pragma mark -
#pragma mark GLKViewDelegate
#pragma mark -
@protocol GLKViewDelegate <NSObject>
@required
/*
Required method for implementing GLKViewDelegate. This draw method variant should be used when not subclassing GLKView.
This method will not be called if the GLKView object has been subclassed and implements -(void)drawRect:(CGRect)rect.
*/
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect;
@end
NS_ASSUME_NONNULL_END
// ========== GLKit.framework/Headers/GLKMatrix3.h
//
// GLKMatrix3.h
// GLKit
//
// Copyright (c) 2011-2012, Apple Inc. All rights reserved.
//
#ifndef __GLK_MATRIX_3_H
#define __GLK_MATRIX_3_H
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <GLKit/GLKMathTypes.h>
#include <GLKit/GLKVector3.h>
#include <GLKit/GLKQuaternion.h>
#if defined(__ARM_NEON__)
#include <arm_neon.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#pragma mark -
#pragma mark Prototypes
#pragma mark -
extern const GLKMatrix3 GLKMatrix3Identity;
GLK_INLINE GLKMatrix3 GLKMatrix3Make(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeAndTranspose(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithArray(float values[9]);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithArrayAndTranspose(float values[9]);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithRows(GLKVector3 row0,
GLKVector3 row1,
GLKVector3 row2);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithColumns(GLKVector3 column0,
GLKVector3 column1,
GLKVector3 column2);
/*
The quaternion will be normalized before conversion.
*/
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithQuaternion(GLKQuaternion quaternion);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeScale(float sx, float sy, float sz);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeRotation(float radians, float x, float y, float z);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeXRotation(float radians);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeYRotation(float radians);
GLK_INLINE GLKMatrix3 GLKMatrix3MakeZRotation(float radians);
/*
Returns the upper left 2x2 portion of the 3x3 matrix.
*/
GLK_INLINE GLKMatrix2 GLKMatrix3GetMatrix2(GLKMatrix3 matrix);
GLK_INLINE GLKVector3 GLKMatrix3GetRow(GLKMatrix3 matrix, int row);
GLK_INLINE GLKVector3 GLKMatrix3GetColumn(GLKMatrix3 matrix, int column);
GLK_INLINE GLKMatrix3 GLKMatrix3SetRow(GLKMatrix3 matrix, int row, GLKVector3 vector);
GLK_INLINE GLKMatrix3 GLKMatrix3SetColumn(GLKMatrix3 matrix, int column, GLKVector3 vector);
GLK_INLINE GLKMatrix3 GLKMatrix3Transpose(GLKMatrix3 matrix);
GLKMatrix3 GLKMatrix3Invert(GLKMatrix3 matrix, bool *isInvertible);
GLKMatrix3 GLKMatrix3InvertAndTranspose(GLKMatrix3 matrix, bool *isInvertible);
GLK_INLINE GLKMatrix3 GLKMatrix3Multiply(GLKMatrix3 matrixLeft, GLKMatrix3 matrixRight);
GLK_INLINE GLKMatrix3 GLKMatrix3Add(GLKMatrix3 matrixLeft, GLKMatrix3 matrixRight);
GLK_INLINE GLKMatrix3 GLKMatrix3Subtract(GLKMatrix3 matrixLeft, GLKMatrix3 matrixRight);
GLK_INLINE GLKMatrix3 GLKMatrix3Scale(GLKMatrix3 matrix, float sx, float sy, float sz);
GLK_INLINE GLKMatrix3 GLKMatrix3ScaleWithVector3(GLKMatrix3 matrix, GLKVector3 scaleVector);
/*
The last component of the GLKVector4, scaleVector, is ignored.
*/
GLK_INLINE GLKMatrix3 GLKMatrix3ScaleWithVector4(GLKMatrix3 matrix, GLKVector4 scaleVector);
GLK_INLINE GLKMatrix3 GLKMatrix3Rotate(GLKMatrix3 matrix, float radians, float x, float y, float z);
GLK_INLINE GLKMatrix3 GLKMatrix3RotateWithVector3(GLKMatrix3 matrix, float radians, GLKVector3 axisVector);
/*
The last component of the GLKVector4, axisVector, is ignored.
*/
GLK_INLINE GLKMatrix3 GLKMatrix3RotateWithVector4(GLKMatrix3 matrix, float radians, GLKVector4 axisVector);
GLK_INLINE GLKMatrix3 GLKMatrix3RotateX(GLKMatrix3 matrix, float radians);
GLK_INLINE GLKMatrix3 GLKMatrix3RotateY(GLKMatrix3 matrix, float radians);
GLK_INLINE GLKMatrix3 GLKMatrix3RotateZ(GLKMatrix3 matrix, float radians);
GLK_INLINE GLKVector3 GLKMatrix3MultiplyVector3(GLKMatrix3 matrixLeft, GLKVector3 vectorRight);
GLK_INLINE void GLKMatrix3MultiplyVector3Array(GLKMatrix3 matrix, GLKVector3 *__nonnull vectors, size_t vectorCount);
#pragma mark -
#pragma mark Implementations
#pragma mark -
GLK_INLINE GLKMatrix3 GLKMatrix3Make(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22)
{
GLKMatrix3 m = { m00, m01, m02,
m10, m11, m12,
m20, m21, m22 };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeAndTranspose(float m00, float m01, float m02,
float m10, float m11, float m12,
float m20, float m21, float m22)
{
GLKMatrix3 m = { m00, m10, m20,
m01, m11, m21,
m02, m12, m22 };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithArray(float values[9])
{
GLKMatrix3 m = { values[0], values[1], values[2],
values[3], values[4], values[5],
values[6], values[7], values[8] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithArrayAndTranspose(float values[9])
{
GLKMatrix3 m = { values[0], values[3], values[6],
values[1], values[4], values[7],
values[2], values[5], values[8] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithRows(GLKVector3 row0,
GLKVector3 row1,
GLKVector3 row2)
{
GLKMatrix3 m = { row0.v[0], row1.v[0], row2.v[0],
row0.v[1], row1.v[1], row2.v[1],
row0.v[2], row1.v[2], row2.v[2] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithColumns(GLKVector3 column0,
GLKVector3 column1,
GLKVector3 column2)
{
GLKMatrix3 m = { column0.v[0], column0.v[1], column0.v[2],
column1.v[0], column1.v[1], column1.v[2],
column2.v[0], column2.v[1], column2.v[2] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeWithQuaternion(GLKQuaternion quaternion)
{
quaternion = GLKQuaternionNormalize(quaternion);
float x = quaternion.q[0];
float y = quaternion.q[1];
float z = quaternion.q[2];
float w = quaternion.q[3];
float _2x = x + x;
float _2y = y + y;
float _2z = z + z;
float _2w = w + w;
GLKMatrix3 m = { 1.0f - _2y * y - _2z * z,
_2x * y + _2w * z,
_2x * z - _2w * y,
_2x * y - _2w * z,
1.0f - _2x * x - _2z * z,
_2y * z + _2w * x,
_2x * z + _2w * y,
_2y * z - _2w * x,
1.0f - _2x * x - _2y * y };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeScale(float sx, float sy, float sz)
{
GLKMatrix3 m = GLKMatrix3Identity;
m.m[0] = sx;
m.m[4] = sy;
m.m[8] = sz;
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeRotation(float radians, float x, float y, float z)
{
GLKVector3 v = GLKVector3Normalize(GLKVector3Make(x, y, z));
float cos = cosf(radians);
float cosp = 1.0f - cos;
float sin = sinf(radians);
GLKMatrix3 m = { cos + cosp * v.v[0] * v.v[0],
cosp * v.v[0] * v.v[1] + v.v[2] * sin,
cosp * v.v[0] * v.v[2] - v.v[1] * sin,
cosp * v.v[0] * v.v[1] - v.v[2] * sin,
cos + cosp * v.v[1] * v.v[1],
cosp * v.v[1] * v.v[2] + v.v[0] * sin,
cosp * v.v[0] * v.v[2] + v.v[1] * sin,
cosp * v.v[1] * v.v[2] - v.v[0] * sin,
cos + cosp * v.v[2] * v.v[2] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeXRotation(float radians)
{
float cos = cosf(radians);
float sin = sinf(radians);
GLKMatrix3 m = { 1.0f, 0.0f, 0.0f,
0.0f, cos, sin,
0.0f, -sin, cos };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeYRotation(float radians)
{
float cos = cosf(radians);
float sin = sinf(radians);
GLKMatrix3 m = { cos, 0.0f, -sin,
0.0f, 1.0f, 0.0f,
sin, 0.0f, cos };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3MakeZRotation(float radians)
{
float cos = cosf(radians);
float sin = sinf(radians);
GLKMatrix3 m = { cos, sin, 0.0f,
-sin, cos, 0.0f,
0.0f, 0.0f, 1.0f };
return m;
}
GLK_INLINE GLKMatrix2 GLKMatrix3GetMatrix2(GLKMatrix3 matrix)
{
GLKMatrix2 m = { matrix.m[0], matrix.m[1],
matrix.m[3], matrix.m[4] };
return m;
}
GLK_INLINE GLKVector3 GLKMatrix3GetRow(GLKMatrix3 matrix, int row)
{
GLKVector3 v = { matrix.m[row], matrix.m[3 + row], matrix.m[6 + row] };
return v;
}
GLK_INLINE GLKVector3 GLKMatrix3GetColumn(GLKMatrix3 matrix, int column)
{
GLKVector3 v = { matrix.m[column * 3 + 0], matrix.m[column * 3 + 1], matrix.m[column * 3 + 2] };
return v;
}
GLK_INLINE GLKMatrix3 GLKMatrix3SetRow(GLKMatrix3 matrix, int row, GLKVector3 vector)
{
matrix.m[row] = vector.v[0];
matrix.m[row + 3] = vector.v[1];
matrix.m[row + 6] = vector.v[2];
return matrix;
}
GLK_INLINE GLKMatrix3 GLKMatrix3SetColumn(GLKMatrix3 matrix, int column, GLKVector3 vector)
{
matrix.m[column * 3 + 0] = vector.v[0];
matrix.m[column * 3 + 1] = vector.v[1];
matrix.m[column * 3 + 2] = vector.v[2];
return matrix;
}
GLK_INLINE GLKMatrix3 GLKMatrix3Transpose(GLKMatrix3 matrix)
{
GLKMatrix3 m = { matrix.m[0], matrix.m[3], matrix.m[6],
matrix.m[1], matrix.m[4], matrix.m[7],
matrix.m[2], matrix.m[5], matrix.m[8] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3Multiply(GLKMatrix3 matrixLeft, GLKMatrix3 matrixRight)
{
#if defined(__ARM_NEON__)
GLKMatrix3 m;
float32x4x3_t iMatrixLeft;
float32x4x3_t iMatrixRight;
float32x4x3_t mm;
iMatrixLeft.val[0] = vld1q_f32(&matrixLeft.m[0]); // 0 1 2 3
iMatrixLeft.val[1] = vld1q_f32(&matrixLeft.m[3]); // 3 4 5 6
iMatrixLeft.val[2] = vld1q_f32(&matrixLeft.m[5]); // 5 6 7 8
iMatrixRight.val[0] = vld1q_f32(&matrixRight.m[0]); // 0 1 2 3
iMatrixRight.val[1] = vld1q_f32(&matrixRight.m[3]); // 3 4 5 6
iMatrixRight.val[2] = vld1q_f32(&matrixRight.m[5]); // 5 6 7 8
iMatrixLeft.val[2] = vextq_f32(iMatrixLeft.val[2], iMatrixLeft.val[2], 1); // 6 7 8 x
mm.val[0] = vmulq_n_f32(iMatrixLeft.val[0], vgetq_lane_f32(iMatrixRight.val[0], 0));
mm.val[1] = vmulq_n_f32(iMatrixLeft.val[0], vgetq_lane_f32(iMatrixRight.val[0], 3));
mm.val[2] = vmulq_n_f32(iMatrixLeft.val[0], vgetq_lane_f32(iMatrixRight.val[1], 3));
mm.val[0] = vmlaq_n_f32(mm.val[0], iMatrixLeft.val[1], vgetq_lane_f32(iMatrixRight.val[0], 1));
mm.val[1] = vmlaq_n_f32(mm.val[1], iMatrixLeft.val[1], vgetq_lane_f32(iMatrixRight.val[1], 1));
mm.val[2] = vmlaq_n_f32(mm.val[2], iMatrixLeft.val[1], vgetq_lane_f32(iMatrixRight.val[2], 2));
mm.val[0] = vmlaq_n_f32(mm.val[0], iMatrixLeft.val[2], vgetq_lane_f32(iMatrixRight.val[0], 2));
mm.val[1] = vmlaq_n_f32(mm.val[1], iMatrixLeft.val[2], vgetq_lane_f32(iMatrixRight.val[1], 2));
mm.val[2] = vmlaq_n_f32(mm.val[2], iMatrixLeft.val[2], vgetq_lane_f32(iMatrixRight.val[2], 3));
memcpy(&m.m[0], (char *)&(mm.val[0]), 16);
memcpy(&m.m[3], (char *)&(mm.val[1]), 16);
float32x2_t vlow = vget_low_f32(mm.val[2]);
memcpy(&m.m[6], (char *)&vlow, 8);
m.m[8] = vgetq_lane_f32(mm.val[2], 2);
return m;
#elif defined(GLK_SSE3_INTRINSICS)
struct {
GLKMatrix3 m;
char pad[16*4 - sizeof(GLKMatrix3)];
} ret;
const __m128 iMatrixLeft0 = _mm_loadu_ps(&matrixLeft.m[0]); // 0 1 2 3 // unaligned load
const __m128 iMatrixLeft1 = _mm_loadu_ps(&matrixLeft.m[3]); // 3 4 5 6 // unaligned load
const __m128 iMatrixLeft2Tmp = _mm_loadu_ps(&matrixLeft.m[5]); // 5 6 7 8 // unaligned load
const __m128 iMatrixLeft2 = _mm_shuffle_ps(iMatrixLeft2Tmp, iMatrixLeft2Tmp, _MM_SHUFFLE(0, 3, 2, 1)); // 6 7 8 x
const __m128 iMatrixRight0 = _mm_loadu_ps(&matrixRight.m[0]);
const __m128 iMatrixRight1 = _mm_loadu_ps(&matrixRight.m[3]);
const __m128 iMatrixRight2 = _mm_loadu_ps(&matrixRight.m[5]);
const __m128 mm0 = iMatrixLeft0 * _mm_shuffle_ps(iMatrixRight0, iMatrixRight0, _MM_SHUFFLE(0, 0, 0, 0)) // mm0 = L0*R0 L1*R0 L2*R0 L3*R0
+ iMatrixLeft1 * _mm_shuffle_ps(iMatrixRight0, iMatrixRight0, _MM_SHUFFLE(1, 1, 1, 1)) // mm0 = L0*R0+L3*R1 L1*R0+L4*R1 L2*R0+L5*R1 L3*R0+L6*R1
+ iMatrixLeft2 * _mm_shuffle_ps(iMatrixRight0, iMatrixRight0, _MM_SHUFFLE(2, 2, 2, 2));
const __m128 mm1 = iMatrixLeft0 * _mm_shuffle_ps(iMatrixRight0, iMatrixRight0, _MM_SHUFFLE(3, 3, 3, 3)) // mm1 = L0*R3 L1*R3 L2*R3 L3*R3
+ iMatrixLeft1 * _mm_shuffle_ps(iMatrixRight1, iMatrixRight1, _MM_SHUFFLE(1, 1, 1, 1)) // mm1 = L0*R3+L3*R4 L1*R3+L4*R4 L2*R3+L5*R4 L3*R3+
+ iMatrixLeft2 * _mm_shuffle_ps(iMatrixRight1, iMatrixRight1, _MM_SHUFFLE(2, 2, 2, 2));
const __m128 mm2 = iMatrixLeft0 * _mm_shuffle_ps(iMatrixRight1, iMatrixRight1, _MM_SHUFFLE(3, 3, 3, 3)) // mm2 = L0*R6 L1*R6 L2*R6 L3*R6
+ iMatrixLeft1 * _mm_shuffle_ps(iMatrixRight2, iMatrixRight2, _MM_SHUFFLE(2, 2, 2, 2))
+ iMatrixLeft2 * _mm_shuffle_ps(iMatrixRight2, iMatrixRight2, _MM_SHUFFLE(3, 3, 3, 3));
_mm_storeu_ps(&ret.m.m[0], mm0); //unaligned store to indices: 0 1 2 3
_mm_storeu_ps(&ret.m.m[3], mm1); //unaligned store to indices: 3 4 5 6
_mm_storeu_ps(&ret.m.m[6], mm2); //unaligned store to indices: 6 7 8
return ret.m;
#else
GLKMatrix3 m;
m.m[0] = matrixLeft.m[0] * matrixRight.m[0] + matrixLeft.m[3] * matrixRight.m[1] + matrixLeft.m[6] * matrixRight.m[2];
m.m[3] = matrixLeft.m[0] * matrixRight.m[3] + matrixLeft.m[3] * matrixRight.m[4] + matrixLeft.m[6] * matrixRight.m[5];
m.m[6] = matrixLeft.m[0] * matrixRight.m[6] + matrixLeft.m[3] * matrixRight.m[7] + matrixLeft.m[6] * matrixRight.m[8];
m.m[1] = matrixLeft.m[1] * matrixRight.m[0] + matrixLeft.m[4] * matrixRight.m[1] + matrixLeft.m[7] * matrixRight.m[2];
m.m[4] = matrixLeft.m[1] * matrixRight.m[3] + matrixLeft.m[4] * matrixRight.m[4] + matrixLeft.m[7] * matrixRight.m[5];
m.m[7] = matrixLeft.m[1] * matrixRight.m[6] + matrixLeft.m[4] * matrixRight.m[7] + matrixLeft.m[7] * matrixRight.m[8];
m.m[2] = matrixLeft.m[2] * matrixRight.m[0] + matrixLeft.m[5] * matrixRight.m[1] + matrixLeft.m[8] * matrixRight.m[2];
m.m[5] = matrixLeft.m[2] * matrixRight.m[3] + matrixLeft.m[5] * matrixRight.m[4] + matrixLeft.m[8] * matrixRight.m[5];
m.m[8] = matrixLeft.m[2] * matrixRight.m[6] + matrixLeft.m[5] * matrixRight.m[7] + matrixLeft.m[8] * matrixRight.m[8];
return m;
#endif
}
GLK_INLINE GLKMatrix3 GLKMatrix3Add(GLKMatrix3 matrixLeft, GLKMatrix3 matrixRight)
{
#if defined(GLK_SSE3_INTRINSICS)
GLKMatrix3 m;
_mm_storeu_ps(&m.m[0], _mm_loadu_ps(&matrixLeft.m[0]) + _mm_loadu_ps(&matrixRight.m[0]));
_mm_storeu_ps(&m.m[4], _mm_loadu_ps(&matrixLeft.m[4]) + _mm_loadu_ps(&matrixRight.m[4]));
m.m[8] = matrixLeft.m[8] + matrixRight.m[8];
return m;
#else
GLKMatrix3 m;
m.m[0] = matrixLeft.m[0] + matrixRight.m[0];
m.m[1] = matrixLeft.m[1] + matrixRight.m[1];
m.m[2] = matrixLeft.m[2] + matrixRight.m[2];
m.m[3] = matrixLeft.m[3] + matrixRight.m[3];
m.m[4] = matrixLeft.m[4] + matrixRight.m[4];
m.m[5] = matrixLeft.m[5] + matrixRight.m[5];
m.m[6] = matrixLeft.m[6] + matrixRight.m[6];
m.m[7] = matrixLeft.m[7] + matrixRight.m[7];
m.m[8] = matrixLeft.m[8] + matrixRight.m[8];
return m;
#endif
}
GLK_INLINE GLKMatrix3 GLKMatrix3Subtract(GLKMatrix3 matrixLeft, GLKMatrix3 matrixRight)
{
#if defined(GLK_SSE3_INTRINSICS)
GLKMatrix3 m;
_mm_storeu_ps(&m.m[0], _mm_loadu_ps(&matrixLeft.m[0]) - _mm_loadu_ps(&matrixRight.m[0]));
_mm_storeu_ps(&m.m[4], _mm_loadu_ps(&matrixLeft.m[4]) - _mm_loadu_ps(&matrixRight.m[4]));
m.m[8] = matrixLeft.m[8] - matrixRight.m[8];
return m;
#else
GLKMatrix3 m;
m.m[0] = matrixLeft.m[0] - matrixRight.m[0];
m.m[1] = matrixLeft.m[1] - matrixRight.m[1];
m.m[2] = matrixLeft.m[2] - matrixRight.m[2];
m.m[3] = matrixLeft.m[3] - matrixRight.m[3];
m.m[4] = matrixLeft.m[4] - matrixRight.m[4];
m.m[5] = matrixLeft.m[5] - matrixRight.m[5];
m.m[6] = matrixLeft.m[6] - matrixRight.m[6];
m.m[7] = matrixLeft.m[7] - matrixRight.m[7];
m.m[8] = matrixLeft.m[8] - matrixRight.m[8];
return m;
#endif
}
GLK_INLINE GLKMatrix3 GLKMatrix3Scale(GLKMatrix3 matrix, float sx, float sy, float sz)
{
GLKMatrix3 m = { matrix.m[0] * sx, matrix.m[1] * sx, matrix.m[2] * sx,
matrix.m[3] * sy, matrix.m[4] * sy, matrix.m[5] * sy,
matrix.m[6] * sz, matrix.m[7] * sz, matrix.m[8] * sz };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3ScaleWithVector3(GLKMatrix3 matrix, GLKVector3 scaleVector)
{
GLKMatrix3 m = { matrix.m[0] * scaleVector.v[0], matrix.m[1] * scaleVector.v[0], matrix.m[2] * scaleVector.v[0],
matrix.m[3] * scaleVector.v[1], matrix.m[4] * scaleVector.v[1], matrix.m[5] * scaleVector.v[1],
matrix.m[6] * scaleVector.v[2], matrix.m[7] * scaleVector.v[2], matrix.m[8] * scaleVector.v[2] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3ScaleWithVector4(GLKMatrix3 matrix, GLKVector4 scaleVector)
{
GLKMatrix3 m = { matrix.m[0] * scaleVector.v[0], matrix.m[1] * scaleVector.v[0], matrix.m[2] * scaleVector.v[0],
matrix.m[3] * scaleVector.v[1], matrix.m[4] * scaleVector.v[1], matrix.m[5] * scaleVector.v[1],
matrix.m[6] * scaleVector.v[2], matrix.m[7] * scaleVector.v[2], matrix.m[8] * scaleVector.v[2] };
return m;
}
GLK_INLINE GLKMatrix3 GLKMatrix3Rotate(GLKMatrix3 matrix, float radians, float x, float y, float z)
{
GLKMatrix3 rm = GLKMatrix3MakeRotation(radians, x, y, z);
return GLKMatrix3Multiply(matrix, rm);
}
GLK_INLINE GLKMatrix3 GLKMatrix3RotateWithVector3(GLKMatrix3 matrix, float radians, GLKVector3 axisVector)
{
GLKMatrix3 rm = GLKMatrix3MakeRotation(radians, axisVector.v[0], axisVector.v[1], axisVector.v[2]);
return GLKMatrix3Multiply(matrix, rm);
}
GLK_INLINE GLKMatrix3 GLKMatrix3RotateWithVector4(GLKMatrix3 matrix, float radians, GLKVector4 axisVector)
{
GLKMatrix3 rm = GLKMatrix3MakeRotation(radians, axisVector.v[0], axisVector.v[1], axisVector.v[2]);
return GLKMatrix3Multiply(matrix, rm);
}
GLK_INLINE GLKMatrix3 GLKMatrix3RotateX(GLKMatrix3 matrix, float radians)
{
GLKMatrix3 rm = GLKMatrix3MakeXRotation(radians);
return GLKMatrix3Multiply(matrix, rm);
}
GLK_INLINE GLKMatrix3 GLKMatrix3RotateY(GLKMatrix3 matrix, float radians)
{
GLKMatrix3 rm = GLKMatrix3MakeYRotation(radians);
return GLKMatrix3Multiply(matrix, rm);
}
GLK_INLINE GLKMatrix3 GLKMatrix3RotateZ(GLKMatrix3 matrix, float radians)
{
GLKMatrix3 rm = GLKMatrix3MakeZRotation(radians);
return GLKMatrix3Multiply(matrix, rm);
}
GLK_INLINE GLKVector3 GLKMatrix3MultiplyVector3(GLKMatrix3 matrixLeft, GLKVector3 vectorRight)
{
GLKVector3 v = { matrixLeft.m[0] * vectorRight.v[0] + matrixLeft.m[3] * vectorRight.v[1] + matrixLeft.m[6] * vectorRight.v[2],
matrixLeft.m[1] * vectorRight.v[0] + matrixLeft.m[4] * vectorRight.v[1] + matrixLeft.m[7] * vectorRight.v[2],
matrixLeft.m[2] * vectorRight.v[0] + matrixLeft.m[5] * vectorRight.v[1] + matrixLeft.m[8] * vectorRight.v[2] };
return v;
}
GLK_INLINE void GLKMatrix3MultiplyVector3Array(GLKMatrix3 matrix, GLKVector3 *__nonnull vectors, size_t vectorCount)
{
int i;
for (i=0; i < vectorCount; i++)
vectors[i] = GLKMatrix3MultiplyVector3(matrix, vectors[i]);
}
#ifdef __cplusplus
}
#endif
#endif /* __GLK_MATRIX_3_H */
// ========== GLKit.framework/Headers/GLKEffectProperty.h
//
// GLKEffectProperty.h
// GLKEffects
//
// Copyright (c) 2011-2012 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GLKit/GLKitBase.h>
#import <GLKit/GLKMath.h>
/*
GLKEffectProperty
GLKEffectProperties are objects that allow piecewise characterization of NamedEffects.
Examples of GLKEffectProperty classes are GLKEffectPropertyTransform and GLKEffectPropertyTexture.
GLKBaseEffect, for instance, has obj-c properties "transform" and "texture2d0" of the aforementioned
types respectively. By specifying proper parameters on these two properties along with the
proper OpenGL vertex array object configuration, a, for instance, textured, rotated quad can
be drawn.
GLKEffectProperty is an abstract class. Instantiation of this class via its -init method will
result in an error. GLKEffectProperty maintains a few instance variables that are shared by
its descendants.
All descendants of GLKEffectProperty are concrete, mutable classes.
*/
NS_ASSUME_NONNULL_BEGIN
typedef struct GLKEffectPropertyPrv *GLKEffectPropertyPrvPtr;
OPENGL_DEPRECATED(10.8,10.14) OPENGLES_DEPRECATED(ios(5.0,12.0), tvos(9.0,12.0))
@interface GLKEffectProperty : NSObject
{
@protected
GLint _location; // Shader location
GLchar *_nameString; // Shader location name
GLKEffectPropertyPrvPtr _prv;
}
@end
NS_ASSUME_NONNULL_END
// ========== GLKit.framework/Headers/GLKVector3.h
//
// GLKVector3.h
// GLKit
//
// Copyright (c) 2011-2012, Apple Inc. All rights reserved.
//
#ifndef __GLK_VECTOR_3_H
#define __GLK_VECTOR_3_H
#include <stdbool.h>
#include <math.h>
#include <GLKit/GLKMathTypes.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma mark -
#pragma mark Prototypes
#pragma mark -
GLK_INLINE GLKVector3 GLKVector3Make(float x, float y, float z);
GLK_INLINE GLKVector3 GLKVector3MakeWithArray(float values[3]);
GLK_INLINE GLKVector3 GLKVector3Negate(GLKVector3 vector);
GLK_INLINE GLKVector3 GLKVector3Add(GLKVector3 vectorLeft, GLKVector3 vectorRight);
GLK_INLINE GLKVector3 GLKVector3Subtract(GLKVector3 vectorLeft, GLKVector3 vectorRight);
GLK_INLINE GLKVector3 GLKVector3Multiply(GLKVector3 vectorLeft, GLKVector3 vectorRight);
GLK_INLINE GLKVector3 GLKVector3Divide(GLKVector3 vectorLeft, GLKVector3 vectorRight);
GLK_INLINE GLKVector3 GLKVector3AddScalar(GLKVector3 vector, float value);
GLK_INLINE GLKVector3 GLKVector3SubtractScalar(GLKVector3 vector, float value);
GLK_INLINE GLKVector3 GLKVector3MultiplyScalar(GLKVector3 vector, float value);
GLK_INLINE GLKVector3 GLKVector3DivideScalar(GLKVector3 vector, float value);
/*
Returns a vector whose elements are the larger of the corresponding elements of the vector arguments.
*/
GLK_INLINE GLKVector3 GLKVector3Maximum(GLKVector3 vectorLeft, GLKVector3 vectorRight);
/*
Returns a vector whose elements are the smaller of the corresponding elements of the vector arguments.
*/
GLK_INLINE GLKVector3 GLKVector3Minimum(GLKVector3 vectorLeft, GLKVector3 vectorRight);
/*
Returns true if all of the first vector's elements are equal to all of the second vector's arguments.
*/
GLK_INLINE bool GLKVector3AllEqualToVector3(GLKVector3 vectorLeft, GLKVector3 vectorRight);
/*
Returns true if all of the vector's elements are equal to the provided value.
*/
GLK_INLINE bool GLKVector3AllEqualToScalar(GLKVector3 vector, float value);
/*
Returns true if all of the first vector's elements are greater than all of the second vector's arguments.
*/
GLK_INLINE bool GLKVector3AllGreaterThanVector3(GLKVector3 vectorLeft, GLKVector3 vectorRight);
/*
Returns true if all of the vector's elements are greater than the provided value.
*/
GLK_INLINE bool GLKVector3AllGreaterThanScalar(GLKVector3 vector, float value);
/*
Returns true if all of the first vector's elements are greater than or equal to all of the second vector's arguments.
*/
GLK_INLINE bool GLKVector3AllGreaterThanOrEqualToVector3(GLKVector3 vectorLeft, GLKVector3 vectorRight);
/*
Returns true if all of the vector's elements are greater than or equal to the provided value.
*/
GLK_INLINE bool GLKVector3AllGreaterThanOrEqualToScalar(GLKVector3 vector, float value);
GLK_INLINE GLKVector3 GLKVector3Normalize(GLKVector3 vector);
GLK_INLINE float GLKVector3DotProduct(GLKVector3 vectorLeft, GLKVector3 vectorRight);
GLK_INLINE float GLKVector3Length(GLKVector3 vector);
GLK_INLINE float GLKVector3Distance(GLKVector3 vectorStart, GLKVector3 vectorEnd);
GLK_INLINE GLKVector3 GLKVector3Lerp(GLKVector3 vectorStart, GLKVector3 vectorEnd, float t);
GLK_INLINE GLKVector3 GLKVector3CrossProduct(GLKVector3 vectorLeft, GLKVector3 vectorRight);
/*
Project the vector, vectorToProject, onto the vector, projectionVector.
*/
GLK_INLINE GLKVector3 GLKVector3Project(GLKVector3 vectorToProject, GLKVector3 projectionVector);
#pragma mark -
#pragma mark Implementations
#pragma mark -
GLK_INLINE GLKVector3 GLKVector3Make(float x, float y, float z)
{
GLKVector3 v = { x, y, z };
return v;
}
GLK_INLINE GLKVector3 GLKVector3MakeWithArray(float values[3])
{
GLKVector3 v = { values[0], values[1], values[2] };
return v;
}
GLK_INLINE GLKVector3 GLKVector3Negate(GLKVector3 vector)
{
GLKVector3 v = { -vector.v[0], -vector.v[1], -vector.v[2] };
return v;
}
GLK_INLINE GLKVector3 GLKVector3Add(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
GLKVector3 v = { vectorLeft.v[0] + vectorRight.v[0],
vectorLeft.v[1] + vectorRight.v[1],
vectorLeft.v[2] + vectorRight.v[2] };
return v;
}
GLK_INLINE GLKVector3 GLKVector3Subtract(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
GLKVector3 v = { vectorLeft.v[0] - vectorRight.v[0],
vectorLeft.v[1] - vectorRight.v[1],
vectorLeft.v[2] - vectorRight.v[2] };
return v;
}
GLK_INLINE GLKVector3 GLKVector3Multiply(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
GLKVector3 v = { vectorLeft.v[0] * vectorRight.v[0],
vectorLeft.v[1] * vectorRight.v[1],
vectorLeft.v[2] * vectorRight.v[2] };
return v;
}
GLK_INLINE GLKVector3 GLKVector3Divide(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
GLKVector3 v = { vectorLeft.v[0] / vectorRight.v[0],
vectorLeft.v[1] / vectorRight.v[1],
vectorLeft.v[2] / vectorRight.v[2] };
return v;
}
GLK_INLINE GLKVector3 GLKVector3AddScalar(GLKVector3 vector, float value)
{
GLKVector3 v = { vector.v[0] + value,
vector.v[1] + value,
vector.v[2] + value };
return v;
}
GLK_INLINE GLKVector3 GLKVector3SubtractScalar(GLKVector3 vector, float value)
{
GLKVector3 v = { vector.v[0] - value,
vector.v[1] - value,
vector.v[2] - value };
return v;
}
GLK_INLINE GLKVector3 GLKVector3MultiplyScalar(GLKVector3 vector, float value)
{
GLKVector3 v = { vector.v[0] * value,
vector.v[1] * value,
vector.v[2] * value };
return v;
}
GLK_INLINE GLKVector3 GLKVector3DivideScalar(GLKVector3 vector, float value)
{
GLKVector3 v = { vector.v[0] / value,
vector.v[1] / value,
vector.v[2] / value };
return v;
}
GLK_INLINE GLKVector3 GLKVector3Maximum(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
GLKVector3 max = vectorLeft;
if (vectorRight.v[0] > vectorLeft.v[0])
max.v[0] = vectorRight.v[0];
if (vectorRight.v[1] > vectorLeft.v[1])
max.v[1] = vectorRight.v[1];
if (vectorRight.v[2] > vectorLeft.v[2])
max.v[2] = vectorRight.v[2];
return max;
}
GLK_INLINE GLKVector3 GLKVector3Minimum(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
GLKVector3 min = vectorLeft;
if (vectorRight.v[0] < vectorLeft.v[0])
min.v[0] = vectorRight.v[0];
if (vectorRight.v[1] < vectorLeft.v[1])
min.v[1] = vectorRight.v[1];
if (vectorRight.v[2] < vectorLeft.v[2])
min.v[2] = vectorRight.v[2];
return min;
}
GLK_INLINE bool GLKVector3AllEqualToVector3(GLKVector3 vectorLeft, GLKVector3 vectorRight)
{
bool compare = false;
if (vectorLeft.v[0] == vectorRight.v[0] &&
vectorLeft.v[1] == vectorRight.v[1] &&