-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphene-1.0.d.ts
More file actions
3412 lines (3275 loc) · 134 KB
/
graphene-1.0.d.ts
File metadata and controls
3412 lines (3275 loc) · 134 KB
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
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Graphene?version=1.0' {
// Module dependencies
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
export namespace Graphene {
/**
* Graphene-1.0
*/
/**
* Specify the order of the rotations on each axis.
*
* The {@link Graphene.EulerOrder.DEFAULT} value is special, and is used
* as an alias for one of the other orders.
* @gir-type Enum
* @since 1.2
*/
enum EulerOrder {
/**
* Rotate in the default order; the
* default order is one of the following enumeration values
*/
DEFAULT,
/**
* Rotate in the X, Y, and Z order. Deprecated in
* Graphene 1.10, it's an alias for {@link Graphene.EulerOrder.SXYZ}
*/
XYZ,
/**
* Rotate in the Y, Z, and X order. Deprecated in
* Graphene 1.10, it's an alias for {@link Graphene.EulerOrder.SYZX}
*/
YZX,
/**
* Rotate in the Z, X, and Y order. Deprecated in
* Graphene 1.10, it's an alias for {@link Graphene.EulerOrder.SZXY}
*/
ZXY,
/**
* Rotate in the X, Z, and Y order. Deprecated in
* Graphene 1.10, it's an alias for {@link Graphene.EulerOrder.SXZY}
*/
XZY,
/**
* Rotate in the Y, X, and Z order. Deprecated in
* Graphene 1.10, it's an alias for {@link Graphene.EulerOrder.SYXZ}
*/
YXZ,
/**
* Rotate in the Z, Y, and X order. Deprecated in
* Graphene 1.10, it's an alias for {@link Graphene.EulerOrder.SZYX}
*/
ZYX,
/**
* Defines a static rotation along the X, Y, and Z axes (Since: 1.10)
*/
SXYZ,
/**
* Defines a static rotation along the X, Y, and X axes (Since: 1.10)
*/
SXYX,
/**
* Defines a static rotation along the X, Z, and Y axes (Since: 1.10)
*/
SXZY,
/**
* Defines a static rotation along the X, Z, and X axes (Since: 1.10)
*/
SXZX,
/**
* Defines a static rotation along the Y, Z, and X axes (Since: 1.10)
*/
SYZX,
/**
* Defines a static rotation along the Y, Z, and Y axes (Since: 1.10)
*/
SYZY,
/**
* Defines a static rotation along the Y, X, and Z axes (Since: 1.10)
*/
SYXZ,
/**
* Defines a static rotation along the Y, X, and Y axes (Since: 1.10)
*/
SYXY,
/**
* Defines a static rotation along the Z, X, and Y axes (Since: 1.10)
*/
SZXY,
/**
* Defines a static rotation along the Z, X, and Z axes (Since: 1.10)
*/
SZXZ,
/**
* Defines a static rotation along the Z, Y, and X axes (Since: 1.10)
*/
SZYX,
/**
* Defines a static rotation along the Z, Y, and Z axes (Since: 1.10)
*/
SZYZ,
/**
* Defines a relative rotation along the Z, Y, and X axes (Since: 1.10)
*/
RZYX,
/**
* Defines a relative rotation along the X, Y, and X axes (Since: 1.10)
*/
RXYX,
/**
* Defines a relative rotation along the Y, Z, and X axes (Since: 1.10)
*/
RYZX,
/**
* Defines a relative rotation along the X, Z, and X axes (Since: 1.10)
*/
RXZX,
/**
* Defines a relative rotation along the X, Z, and Y axes (Since: 1.10)
*/
RXZY,
/**
* Defines a relative rotation along the Y, Z, and Y axes (Since: 1.10)
*/
RYZY,
/**
* Defines a relative rotation along the Z, X, and Y axes (Since: 1.10)
*/
RZXY,
/**
* Defines a relative rotation along the Y, X, and Y axes (Since: 1.10)
*/
RYXY,
/**
* Defines a relative rotation along the Y, X, and Z axes (Since: 1.10)
*/
RYXZ,
/**
* Defines a relative rotation along the Z, X, and Z axes (Since: 1.10)
*/
RZXZ,
/**
* Defines a relative rotation along the X, Y, and Z axes (Since: 1.10)
*/
RXYZ,
/**
* Defines a relative rotation along the Z, Y, and Z axes (Since: 1.10)
*/
RZYZ,
}
/**
* The type of intersection.
* @gir-type Enum
* @since 1.10
*/
enum RayIntersectionKind {
/**
* No intersection
*/
NONE,
/**
* The ray is entering the intersected
* object
*/
ENTER,
/**
* The ray is leaving the intersected
* object
*/
LEAVE,
}
const PI: number;
const PI_2: number;
/**
* Evaluates to the number of components of a {@link Graphene.Vec2}.
*
* This symbol is useful when declaring a C array of floating
* point values to be used with `graphene_vec2_init_from_float()` and
* `graphene_vec2_to_float()`, e.g.
*
*
* ```
* float v[GRAPHENE_VEC2_LEN];
*
* // vec is defined elsewhere
* graphene_vec2_to_float (&vec, v);
*
* for (int i = 0; i < GRAPHENE_VEC2_LEN; i++)
* fprintf (stdout, "component %d: %g\n", i, v[i]);
* ```
*
* @since 1.0
*/
const VEC2_LEN: number;
/**
* Evaluates to the number of components of a {@link Graphene.Vec3}.
*
* This symbol is useful when declaring a C array of floating
* point values to be used with `graphene_vec3_init_from_float()` and
* `graphene_vec3_to_float()`, e.g.
*
*
* ```
* float v[GRAPHENE_VEC3_LEN];
*
* // vec is defined elsewhere
* graphene_vec3_to_float (&vec, v);
*
* for (int i = 0; i < GRAPHENE_VEC2_LEN; i++)
* fprintf (stdout, "component %d: %g\n", i, v[i]);
* ```
*
* @since 1.0
*/
const VEC3_LEN: number;
/**
* Evaluates to the number of components of a {@link Graphene.Vec4}.
*
* This symbol is useful when declaring a C array of floating
* point values to be used with `graphene_vec4_init_from_float()` and
* `graphene_vec4_to_float()`, e.g.
*
*
* ```
* float v[GRAPHENE_VEC4_LEN];
*
* // vec is defined elsewhere
* graphene_vec4_to_float (&vec, v);
*
* for (int i = 0; i < GRAPHENE_VEC4_LEN; i++)
* fprintf (stdout, "component %d: %g\n", i, v[i]);
* ```
*
* @since 1.0
*/
const VEC4_LEN: number;
/**
* A degenerate {@link Graphene.Box} that can only be expanded.
*
* The returned value is owned by Graphene and should not be modified or freed.
* @returns a {@link Graphene.Box}
* @since 1.2
*/
function box_empty(): Box;
/**
* A degenerate {@link Graphene.Box} that cannot be expanded.
*
* The returned value is owned by Graphene and should not be modified or freed.
* @returns a {@link Graphene.Box}
* @since 1.2
*/
function box_infinite(): Box;
/**
* A {@link Graphene.Box} with the minimum vertex set at (-1, -1, -1) and the
* maximum vertex set at (0, 0, 0).
*
* The returned value is owned by Graphene and should not be modified or freed.
* @returns a {@link Graphene.Box}
* @since 1.2
*/
function box_minus_one(): Box;
/**
* A {@link Graphene.Box} with the minimum vertex set at (0, 0, 0) and the
* maximum vertex set at (1, 1, 1).
*
* The returned value is owned by Graphene and should not be modified or freed.
* @returns a {@link Graphene.Box}
* @since 1.2
*/
function box_one(): Box;
/**
* A {@link Graphene.Box} with the minimum vertex set at (-1, -1, -1) and the
* maximum vertex set at (1, 1, 1).
*
* The returned value is owned by Graphene and should not be modified or freed.
* @returns a {@link Graphene.Box}
* @since 1.2
*/
function box_one_minus_one(): Box;
/**
* A {@link Graphene.Box} with both the minimum and maximum vertices set at (0, 0, 0).
*
* The returned value is owned by Graphene and should not be modified or freed.
* @returns a {@link Graphene.Box}
* @since 1.2
*/
function box_zero(): Box;
/**
* Retrieves a constant point with all three coordinates set to 0.
* @returns a zero point
* @since 1.0
*/
function point3d_zero(): Point3D;
/**
* Returns a point fixed at (0, 0).
* @returns a fixed point
* @since 1.0
*/
function point_zero(): Point;
/**
* Allocates a new {@link Graphene.Rect}.
*
* The contents of the returned rectangle are undefined.
* @returns the newly allocated rectangle
* @since 1.0
*/
function rect_alloc(): Rect;
/**
* Returns a degenerate rectangle with origin fixed at (0, 0) and
* a size of 0, 0.
* @returns a fixed rectangle
* @since 1.4
*/
function rect_zero(): Rect;
/**
* A constant pointer to a zero {@link Graphene.Size}, useful for
* equality checks and interpolations.
* @returns a constant size
* @since 1.0
*/
function size_zero(): Size;
/**
* Retrieves a constant vector with (1, 1) components.
* @returns the one vector
* @since 1.0
*/
function vec2_one(): Vec2;
/**
* Retrieves a constant vector with (1, 0) components.
* @returns the X axis vector
* @since 1.0
*/
function vec2_x_axis(): Vec2;
/**
* Retrieves a constant vector with (0, 1) components.
* @returns the Y axis vector
* @since 1.0
*/
function vec2_y_axis(): Vec2;
/**
* Retrieves a constant vector with (0, 0) components.
* @returns the zero vector
* @since 1.0
*/
function vec2_zero(): Vec2;
/**
* Provides a constant pointer to a vector with three components,
* all sets to 1.
* @returns a constant vector
* @since 1.0
*/
function vec3_one(): Vec3;
/**
* Provides a constant pointer to a vector with three components
* with values set to (1, 0, 0).
* @returns a constant vector
* @since 1.0
*/
function vec3_x_axis(): Vec3;
/**
* Provides a constant pointer to a vector with three components
* with values set to (0, 1, 0).
* @returns a constant vector
* @since 1.0
*/
function vec3_y_axis(): Vec3;
/**
* Provides a constant pointer to a vector with three components
* with values set to (0, 0, 1).
* @returns a constant vector
* @since 1.0
*/
function vec3_z_axis(): Vec3;
/**
* Provides a constant pointer to a vector with three components,
* all sets to 0.
* @returns a constant vector
* @since 1.0
*/
function vec3_zero(): Vec3;
/**
* Retrieves a pointer to a {@link Graphene.Vec4} with all its
* components set to 1.
* @returns a constant vector
* @since 1.0
*/
function vec4_one(): Vec4;
/**
* Retrieves a pointer to a {@link Graphene.Vec4} with its
* components set to (0, 0, 0, 1).
* @returns a constant vector
* @since 1.0
*/
function vec4_w_axis(): Vec4;
/**
* Retrieves a pointer to a {@link Graphene.Vec4} with its
* components set to (1, 0, 0, 0).
* @returns a constant vector
* @since 1.0
*/
function vec4_x_axis(): Vec4;
/**
* Retrieves a pointer to a {@link Graphene.Vec4} with its
* components set to (0, 1, 0, 0).
* @returns a constant vector
* @since 1.0
*/
function vec4_y_axis(): Vec4;
/**
* Retrieves a pointer to a {@link Graphene.Vec4} with its
* components set to (0, 0, 1, 0).
* @returns a constant vector
* @since 1.0
*/
function vec4_z_axis(): Vec4;
/**
* Retrieves a pointer to a {@link Graphene.Vec4} with all its
* components set to 0.
* @returns a constant vector
* @since 1.0
*/
function vec4_zero(): Vec4;
/**
* A 3D box, described as the volume between a minimum and
* a maximum vertices.
* @gir-type Struct
* @since 1.2
*/
class Box {
static $gtype: GObject.GType<Box>;
// Constructors
constructor(properties?: Partial<{}>);
static alloc(): Box;
// Static methods
/**
* A degenerate {@link Graphene.Box} that can only be expanded.
*
* The returned value is owned by Graphene and should not be modified or freed.
*/
static empty(): Box;
/**
* A degenerate {@link Graphene.Box} that cannot be expanded.
*
* The returned value is owned by Graphene and should not be modified or freed.
*/
static infinite(): Box;
/**
* A {@link Graphene.Box} with the minimum vertex set at (-1, -1, -1) and the
* maximum vertex set at (0, 0, 0).
*
* The returned value is owned by Graphene and should not be modified or freed.
*/
static minus_one(): Box;
/**
* A {@link Graphene.Box} with the minimum vertex set at (0, 0, 0) and the
* maximum vertex set at (1, 1, 1).
*
* The returned value is owned by Graphene and should not be modified or freed.
*/
static one(): Box;
/**
* A {@link Graphene.Box} with the minimum vertex set at (-1, -1, -1) and the
* maximum vertex set at (1, 1, 1).
*
* The returned value is owned by Graphene and should not be modified or freed.
*/
static one_minus_one(): Box;
/**
* A {@link Graphene.Box} with both the minimum and maximum vertices set at (0, 0, 0).
*
* The returned value is owned by Graphene and should not be modified or freed.
*/
static zero(): Box;
// Methods
/**
* Checks whether the {@link Graphene.Box} `a` contains the given
* {@link Graphene.Box} `b`.
* @param b a {@link Graphene.Box}
* @returns `true` if the box is contained in the given box
*/
contains_box(b: Box): boolean;
/**
* Checks whether `box` contains the given `point`.
* @param point the coordinates to check
* @returns `true` if the point is contained in the given box
*/
contains_point(point: Point3D): boolean;
/**
* Checks whether the two given boxes are equal.
* @param b a {@link Graphene.Box}
* @returns `true` if the boxes are equal
*/
equal(b: Box): boolean;
/**
* Expands the dimensions of `box` to include the coordinates at `point`.
* @param point the coordinates of the point to include
*/
expand(point: Point3D): Box;
/**
* Expands the dimensions of `box` by the given `scalar` value.
*
* If `scalar` is positive, the {@link Graphene.Box} will grow; if `scalar` is
* negative, the {@link Graphene.Box} will shrink.
* @param scalar a scalar value
*/
expand_scalar(scalar: number): Box;
/**
* Expands the dimensions of `box` to include the coordinates of the
* given vector.
* @param vec the coordinates of the point to include, as a {@link Graphene.Vec3}
*/
expand_vec3(vec: Vec3): Box;
/**
* Frees the resources allocated by `graphene_box_alloc()`.
*/
free(): void;
/**
* Computes the bounding {@link Graphene.Sphere} capable of containing the given
* {@link Graphene.Box}.
*/
get_bounding_sphere(): Sphere;
/**
* Retrieves the coordinates of the center of a {@link Graphene.Box}.
*/
get_center(): Point3D;
/**
* Retrieves the size of the `box` on the Z axis.
* @returns the depth of the box
*/
get_depth(): number;
/**
* Retrieves the size of the `box` on the Y axis.
* @returns the height of the box
*/
get_height(): number;
/**
* Retrieves the coordinates of the maximum point of the given
* {@link Graphene.Box}.
*/
get_max(): Point3D;
/**
* Retrieves the coordinates of the minimum point of the given
* {@link Graphene.Box}.
*/
get_min(): Point3D;
/**
* Retrieves the size of the box on all three axes, and stores
* it into the given `size` vector.
*/
get_size(): Vec3;
/**
* Computes the vertices of the given {@link Graphene.Box}.
*/
get_vertices(): Vec3[];
/**
* Retrieves the size of the `box` on the X axis.
* @returns the width of the box
*/
get_width(): number;
/**
* Initializes the given {@link Graphene.Box} with two vertices.
* @param min the coordinates of the minimum vertex
* @param max the coordinates of the maximum vertex
* @returns the initialized {@link Graphene.Box}
*/
init(min?: Point3D | null, max?: Point3D | null): Box;
/**
* Initializes the given {@link Graphene.Box} with the vertices of
* another {@link Graphene.Box}.
* @param src a {@link Graphene.Box}
* @returns the initialized {@link Graphene.Box}
*/
init_from_box(src: Box): Box;
/**
* Initializes the given {@link Graphene.Box} with the given array
* of vertices.
*
* If `n_points` is 0, the returned box is initialized with
* `graphene_box_empty()`.
* @param points an array of {@link Graphene.Point3D}
* @returns the initialized {@link Graphene.Box}
*/
init_from_points(points: Point3D[]): Box;
/**
* Initializes the given {@link Graphene.Box} with two vertices
* stored inside {@link Graphene.Vec3}.
* @param min the coordinates of the minimum vertex
* @param max the coordinates of the maximum vertex
* @returns the initialized {@link Graphene.Box}
*/
init_from_vec3(min?: Vec3 | null, max?: Vec3 | null): Box;
/**
* Initializes the given {@link Graphene.Box} with the given array
* of vertices.
*
* If `n_vectors` is 0, the returned box is initialized with
* `graphene_box_empty()`.
* @param vectors an array of {@link Graphene.Vec3}
* @returns the initialized {@link Graphene.Box}
*/
init_from_vectors(vectors: Vec3[]): Box;
/**
* Intersects the two given {@link Graphene.Box}.
*
* If the two boxes do not intersect, `res` will contain a degenerate box
* initialized with `graphene_box_empty()`.
* @param b a {@link Graphene.Box}
* @returns true if the two boxes intersect
*/
intersection(b: Box): [boolean, Box | null];
/**
* Unions the two given {@link Graphene.Box}.
* @param b the box to union to `a`
*/
union(b: Box): Box;
}
/**
* Describe a rotation using Euler angles.
*
* The contents of the {@link Graphene.Euler} structure are private
* and should never be accessed directly.
* @gir-type Struct
* @since 1.2
*/
class Euler {
static $gtype: GObject.GType<Euler>;
// Constructors
constructor(properties?: Partial<{}>);
static alloc(): Euler;
// Methods
/**
* Checks if two {@link Graphene.Euler} are equal.
* @param b a {@link Graphene.Euler}
* @returns `true` if the two {@link Graphene.Euler} are equal
*/
equal(b: Euler): boolean;
/**
* Frees the resources allocated by `graphene_euler_alloc()`.
*/
free(): void;
/**
* Retrieves the first component of the Euler angle vector,
* depending on the order of rotation.
*
* See also: `graphene_euler_get_x()`
* @returns the first component of the Euler angle vector, in radians
*/
get_alpha(): number;
/**
* Retrieves the second component of the Euler angle vector,
* depending on the order of rotation.
*
* See also: `graphene_euler_get_y()`
* @returns the second component of the Euler angle vector, in radians
*/
get_beta(): number;
/**
* Retrieves the third component of the Euler angle vector,
* depending on the order of rotation.
*
* See also: `graphene_euler_get_z()`
* @returns the third component of the Euler angle vector, in radians
*/
get_gamma(): number;
/**
* Retrieves the order used to apply the rotations described in the
* {@link Graphene.Euler} structure, when converting to and from other
* structures, like {@link Graphene.Quaternion} and {@link Graphene.Matrix}.
*
* This function does not return the {@link Graphene.EulerOrder.DEFAULT}
* enumeration value; it will return the effective order of rotation
* instead.
* @returns the order used to apply the rotations
*/
get_order(): EulerOrder;
/**
* Retrieves the rotation angle on the X axis, in degrees.
* @returns the rotation angle
*/
get_x(): number;
/**
* Retrieves the rotation angle on the Y axis, in degrees.
* @returns the rotation angle
*/
get_y(): number;
/**
* Retrieves the rotation angle on the Z axis, in degrees.
* @returns the rotation angle
*/
get_z(): number;
/**
* Initializes a {@link Graphene.Euler} using the given angles.
*
* The order of the rotations is {@link Graphene.EulerOrder.DEFAULT}.
* @param x rotation angle on the X axis, in degrees
* @param y rotation angle on the Y axis, in degrees
* @param z rotation angle on the Z axis, in degrees
* @returns the initialized {@link Graphene.Euler}
*/
init(x: number, y: number, z: number): Euler;
/**
* Initializes a {@link Graphene.Euler} using the angles and order of
* another {@link Graphene.Euler}.
*
* If the {@link Graphene.Euler} `src` is `null`, this function is equivalent
* to calling `graphene_euler_init()` with all angles set to 0.
* @param src a {@link Graphene.Euler}
* @returns the initialized {@link Graphene.Euler}
*/
init_from_euler(src?: Euler | null): Euler;
/**
* Initializes a {@link Graphene.Euler} using the given rotation matrix.
*
* If the {@link Graphene.Matrix} `m` is `null`, the {@link Graphene.Euler} will
* be initialized with all angles set to 0.
* @param m a rotation matrix
* @param order the order used to apply the rotations
* @returns the initialized {@link Graphene.Euler}
*/
init_from_matrix(m: Matrix | null, order: EulerOrder | null): Euler;
/**
* Initializes a {@link Graphene.Euler} using the given normalized quaternion.
*
* If the {@link Graphene.Quaternion} `q` is `null`, the {@link Graphene.Euler} will
* be initialized with all angles set to 0.
* @param q a normalized {@link Graphene.Quaternion}
* @param order the order used to apply the rotations
* @returns the initialized {@link Graphene.Euler}
*/
init_from_quaternion(q: Quaternion | null, order: EulerOrder | null): Euler;
/**
* Initializes a {@link Graphene.Euler} using the given angles
* and order of rotation.
* @param x rotation angle on the X axis, in radians
* @param y rotation angle on the Y axis, in radians
* @param z rotation angle on the Z axis, in radians
* @param order order of rotations
* @returns the initialized {@link Graphene.Euler}
*/
init_from_radians(x: number, y: number, z: number, order: EulerOrder | null): Euler;
/**
* Initializes a {@link Graphene.Euler} using the angles contained in a
* {@link Graphene.Vec3}.
*
* If the {@link Graphene.Vec3} `v` is `null`, the {@link Graphene.Euler} will be
* initialized with all angles set to 0.
* @param v a {@link Graphene.Vec3} containing the rotation angles in degrees
* @param order the order used to apply the rotations
* @returns the initialized {@link Graphene.Euler}
*/
init_from_vec3(v: Vec3 | null, order: EulerOrder | null): Euler;
/**
* Initializes a {@link Graphene.Euler} with the given angles and `order`.
* @param x rotation angle on the X axis, in degrees
* @param y rotation angle on the Y axis, in degrees
* @param z rotation angle on the Z axis, in degrees
* @param order the order used to apply the rotations
* @returns the initialized {@link Graphene.Euler}
*/
init_with_order(x: number, y: number, z: number, order: EulerOrder | null): Euler;
/**
* Reorders a {@link Graphene.Euler} using `order`.
*
* This function is equivalent to creating a {@link Graphene.Quaternion} from the
* given {@link Graphene.Euler}, and then converting the quaternion into another
* {@link Graphene.Euler}.
* @param order the new order
*/
reorder(order: EulerOrder | null): Euler;
/**
* Converts a {@link Graphene.Euler} into a transformation matrix expressing
* the extrinsic composition of rotations described by the Euler angles.
*
* The rotations are applied over the reference frame axes in the order
* associated with the {@link Graphene.Euler}; for instance, if the order
* used to initialize `e` is {@link Graphene.EulerOrder.XYZ}:
*
* * the first rotation moves the body around the X axis with
* an angle φ
* * the second rotation moves the body around the Y axis with
* an angle of ϑ
* * the third rotation moves the body around the Z axis with
* an angle of ψ
*
* The rotation sign convention is right-handed, to preserve compatibility
* between Euler-based, quaternion-based, and angle-axis-based rotations.
*/
to_matrix(): Matrix;
/**
* Converts a {@link Graphene.Euler} into a {@link Graphene.Quaternion}.
*/
to_quaternion(): Quaternion;
/**
* Retrieves the angles of a {@link Graphene.Euler} and initializes a
* {@link Graphene.Vec3} with them.
*/
to_vec3(): Vec3;
}
/**
* A 3D volume delimited by 2D clip planes.
*
* The contents of the `graphene_frustum_t` are private, and should not be
* modified directly.
* @gir-type Struct
* @since 1.2
*/
class Frustum {
static $gtype: GObject.GType<Frustum>;
// Constructors
constructor(properties?: Partial<{}>);
static alloc(): Frustum;
// Methods
/**
* Checks whether a point is inside the volume defined by the given
* {@link Graphene.Frustum}.
* @param point a {@link Graphene.Point3D}
* @returns `true` if the point is inside the frustum
*/
contains_point(point: Point3D): boolean;
/**
* Checks whether the two given {@link Graphene.Frustum} are equal.
* @param b a {@link Graphene.Frustum}
* @returns `true` if the given frustums are equal
*/
equal(b: Frustum): boolean;
/**
* Frees the resources allocated by `graphene_frustum_alloc()`.
*/
free(): void;
/**
* Retrieves the planes that define the given {@link Graphene.Frustum}.
*/
get_planes(): Plane[];
/**
* Initializes the given {@link Graphene.Frustum} using the provided
* clipping planes.
* @param p0 a clipping plane
* @param p1 a clipping plane
* @param p2 a clipping plane
* @param p3 a clipping plane
* @param p4 a clipping plane
* @param p5 a clipping plane
* @returns the initialized frustum
*/
init(p0: Plane, p1: Plane, p2: Plane, p3: Plane, p4: Plane, p5: Plane): Frustum;
/**
* Initializes the given {@link Graphene.Frustum} using the clipping
* planes of another {@link Graphene.Frustum}.
* @param src a {@link Graphene.Frustum}
* @returns the initialized frustum
*/
init_from_frustum(src: Frustum): Frustum;
/**
* Initializes a {@link Graphene.Frustum} using the given `matrix`.
* @param matrix a {@link Graphene.Matrix}
* @returns the initialized frustum
*/
init_from_matrix(matrix: Matrix): Frustum;
/**
* Checks whether the given `box` intersects a plane of
* a {@link Graphene.Frustum}.
* @param box a {@link Graphene.Box}
* @returns `true` if the box intersects the frustum
*/
intersects_box(box: Box): boolean;
/**
* Checks whether the given `sphere` intersects a plane of
* a {@link Graphene.Frustum}.
* @param sphere a {@link Graphene.Sphere}
* @returns `true` if the sphere intersects the frustum
*/
intersects_sphere(sphere: Sphere): boolean;
}
/**
* A structure capable of holding a 4x4 matrix.
*
* The contents of the {@link Graphene.Matrix} structure are private and
* should never be accessed directly.
* @gir-type Struct
*/
class Matrix {
static $gtype: GObject.GType<Matrix>;
// Constructors
constructor(properties?: Partial<{}>);
static alloc(): Matrix;
// Methods
/**
* Decomposes a transformation matrix into its component transformations.
*
* The algorithm for decomposing a matrix is taken from the
* [CSS3 Transforms specification](http://dev.w3.org/csswg/css-transforms/);
* specifically, the decomposition code is based on the equivalent code
* published in "Graphics Gems II", edited by Jim Arvo, and
* [available online](http://web.archive.org/web/20150512160205/http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c).
* @returns `true` if the matrix could be decomposed
*/
decompose(): [boolean, Vec3, Vec3, Quaternion, Vec3, Vec4];
/**
* Computes the determinant of the given matrix.
* @returns the value of the determinant
*/
determinant(): number;
/**
* Checks whether the two given {@link Graphene.Matrix} matrices are equal.
* @param b a {@link Graphene.Matrix}
* @returns `true` if the two matrices are equal, and `false` otherwise
*/
equal(b: Matrix): boolean;
/**
* Checks whether the two given {@link Graphene.Matrix} matrices are
* byte-by-byte equal.
*
* While this function is faster than `graphene_matrix_equal()`, it
* can also return false negatives, so it should be used in
* conjuction with either `graphene_matrix_equal()` or
* `graphene_matrix_near()`. For instance:
*
*
* ```c
* if (graphene_matrix_equal_fast (a, b))
* {
* // matrices are definitely the same
* }
* else
* {
* if (graphene_matrix_equal (a, b))
* // matrices contain the same values within an epsilon of FLT_EPSILON
* else if (graphene_matrix_near (a, b, 0.0001))
* // matrices contain the same values within an epsilon of 0.0001
* else
* // matrices are not equal
* }
* ```
*
* @param b a {@link Graphene.Matrix}
* @returns `true` if the matrices are equal. and `false` otherwise
*/
equal_fast(b: Matrix): boolean;
/**
* Frees the resources allocated by `graphene_matrix_alloc()`.
*/
free(): void;
/**
* Retrieves the given row vector at `index_` inside a matrix.
* @param index_ the index of the row vector, between 0 and 3
*/
get_row(index_: number): Vec4;
/**
* Retrieves the value at the given `row` and `col` index.
* @param row the row index
* @param col the column index
* @returns the value at the given indices
*/
get_value(row: number, col: number): number;
/**
* Retrieves the scaling factor on the X axis in `m`.
* @returns the value of the scaling factor
*/
get_x_scale(): number;
/**