v0.2.1 c0399be

graphene-matrix.go RawHistoryFolder

1// Package graphene was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package graphene
3
4import (
5	"structs"
6	"unsafe"
7
8	"github.com/ebitengine/purego"
9
10	"github.com/bnema/puregotk/pkg/core"
11	"github.com/bnema/puregotk/v4/gobject/types"
12)
13
14// A structure capable of holding a 4x4 matrix.
15//
16// The contents of the #graphene_matrix_t structure are private and
17// should never be accessed directly.
18type Matrix struct {
19	_ structs.HostLayout
20
21	Value uintptr
22}
23
24var xMatrixGLibType func() types.GType
25
26func MatrixGLibType() types.GType {
27	return xMatrixGLibType()
28}
29
30func (x *Matrix) GoPointer() uintptr {
31	return uintptr(unsafe.Pointer(x))
32}
33
34var xMatrixAlloc func() *Matrix
35
36// Allocates a new #graphene_matrix_t.
37func MatrixAlloc() *Matrix {
38
39	cret := xMatrixAlloc()
40	return cret
41}
42
43var xMatrixDecompose func(uintptr, *Vec3, *Vec3, *Quaternion, *Vec3, *Vec4) bool
44
45// Decomposes a transformation matrix into its component transformations.
46//
47// The algorithm for decomposing a matrix is taken from the
48// [CSS3 Transforms specification](http://dev.w3.org/csswg/css-transforms/);
49// specifically, the decomposition code is based on the equivalent code
50// published in "Graphics Gems II", edited by Jim Arvo, and
51// [available online](http://web.archive.org/web/20150512160205/http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c).
52func (x *Matrix) Decompose(TranslateVar *Vec3, ScaleVar *Vec3, RotateVar *Quaternion, ShearVar *Vec3, PerspectiveVar *Vec4) bool {
53
54	cret := xMatrixDecompose(x.GoPointer(), TranslateVar, ScaleVar, RotateVar, ShearVar, PerspectiveVar)
55	return cret
56}
57
58var xMatrixDeterminant func(uintptr) float32
59
60// Computes the determinant of the given matrix.
61func (x *Matrix) Determinant() float32 {
62
63	cret := xMatrixDeterminant(x.GoPointer())
64	return cret
65}
66
67var xMatrixEqual func(uintptr, *Matrix) bool
68
69// Checks whether the two given #graphene_matrix_t matrices are equal.
70func (x *Matrix) Equal(BVar *Matrix) bool {
71
72	cret := xMatrixEqual(x.GoPointer(), BVar)
73	return cret
74}
75
76var xMatrixEqualFast func(uintptr, *Matrix) bool
77
78// Checks whether the two given #graphene_matrix_t matrices are
79// byte-by-byte equal.
80//
81// While this function is faster than graphene_matrix_equal(), it
82// can also return false negatives, so it should be used in
83// conjuction with either graphene_matrix_equal() or
84// graphene_matrix_near(). For instance:
85//
86// |[<!-- language="C" -->
87//
88//	if (graphene_matrix_equal_fast (a, b))
89//	  {
90//	    // matrices are definitely the same
91//	  }
92//	else
93//	  {
94//	    if (graphene_matrix_equal (a, b))
95//	      // matrices contain the same values within an epsilon of FLT_EPSILON
96//	    else if (graphene_matrix_near (a, b, 0.0001))
97//	      // matrices contain the same values within an epsilon of 0.0001
98//	    else
99//	      // matrices are not equal
100//	  }
101//
102// ]|
103func (x *Matrix) EqualFast(BVar *Matrix) bool {
104
105	cret := xMatrixEqualFast(x.GoPointer(), BVar)
106	return cret
107}
108
109var xMatrixFree func(uintptr)
110
111// Frees the resources allocated by graphene_matrix_alloc().
112func (x *Matrix) Free() {
113
114	xMatrixFree(x.GoPointer())
115
116}
117
118var xMatrixGetRow func(uintptr, uint, *Vec4)
119
120// Retrieves the given row vector at @index_ inside a matrix.
121func (x *Matrix) GetRow(IndexVar uint, ResVar *Vec4) {
122
123	xMatrixGetRow(x.GoPointer(), IndexVar, ResVar)
124
125}
126
127var xMatrixGetValue func(uintptr, uint, uint) float32
128
129// Retrieves the value at the given @row and @col index.
130func (x *Matrix) GetValue(RowVar uint, ColVar uint) float32 {
131
132	cret := xMatrixGetValue(x.GoPointer(), RowVar, ColVar)
133	return cret
134}
135
136var xMatrixGetXScale func(uintptr) float32
137
138// Retrieves the scaling factor on the X axis in @m.
139func (x *Matrix) GetXScale() float32 {
140
141	cret := xMatrixGetXScale(x.GoPointer())
142	return cret
143}
144
145var xMatrixGetXTranslation func(uintptr) float32
146
147// Retrieves the translation component on the X axis from @m.
148func (x *Matrix) GetXTranslation() float32 {
149
150	cret := xMatrixGetXTranslation(x.GoPointer())
151	return cret
152}
153
154var xMatrixGetYScale func(uintptr) float32
155
156// Retrieves the scaling factor on the Y axis in @m.
157func (x *Matrix) GetYScale() float32 {
158
159	cret := xMatrixGetYScale(x.GoPointer())
160	return cret
161}
162
163var xMatrixGetYTranslation func(uintptr) float32
164
165// Retrieves the translation component on the Y axis from @m.
166func (x *Matrix) GetYTranslation() float32 {
167
168	cret := xMatrixGetYTranslation(x.GoPointer())
169	return cret
170}
171
172var xMatrixGetZScale func(uintptr) float32
173
174// Retrieves the scaling factor on the Z axis in @m.
175func (x *Matrix) GetZScale() float32 {
176
177	cret := xMatrixGetZScale(x.GoPointer())
178	return cret
179}
180
181var xMatrixGetZTranslation func(uintptr) float32
182
183// Retrieves the translation component on the Z axis from @m.
184func (x *Matrix) GetZTranslation() float32 {
185
186	cret := xMatrixGetZTranslation(x.GoPointer())
187	return cret
188}
189
190var xMatrixInitFrom2d func(uintptr, float64, float64, float64, float64, float64, float64) *Matrix
191
192// Initializes a #graphene_matrix_t from the values of an affine
193// transformation matrix.
194//
195// The arguments map to the following matrix layout:
196//
197// |[<!-- language="plain" -->
198//
199//	⎛ xx  yx ⎞   ⎛  a   b  0 ⎞
200//	⎜ xy  yy ⎟ = ⎜  c   d  0 ⎟
201//	⎝ x0  y0 ⎠   ⎝ tx  ty  1 ⎠
202//
203// ]|
204//
205// This function can be used to convert between an affine matrix type
206// from other libraries and a #graphene_matrix_t.
207func (x *Matrix) InitFrom2d(XxVar float64, YxVar float64, XyVar float64, YyVar float64, X0Var float64, Y0Var float64) *Matrix {
208
209	cret := xMatrixInitFrom2d(x.GoPointer(), XxVar, YxVar, XyVar, YyVar, X0Var, Y0Var)
210	return cret
211}
212
213var xMatrixInitFromFloat func(uintptr, *[16]float32) *Matrix
214
215// Initializes a #graphene_matrix_t with the given array of floating
216// point values.
217func (x *Matrix) InitFromFloat(VVar [16]float32) *Matrix {
218
219	cret := xMatrixInitFromFloat(x.GoPointer(), &VVar)
220	return cret
221}
222
223var xMatrixInitFromMatrix func(uintptr, *Matrix) *Matrix
224
225// Initializes a #graphene_matrix_t using the values of the
226// given matrix.
227func (x *Matrix) InitFromMatrix(SrcVar *Matrix) *Matrix {
228
229	cret := xMatrixInitFromMatrix(x.GoPointer(), SrcVar)
230	return cret
231}
232
233var xMatrixInitFromVec4 func(uintptr, *Vec4, *Vec4, *Vec4, *Vec4) *Matrix
234
235// Initializes a #graphene_matrix_t with the given four row
236// vectors.
237func (x *Matrix) InitFromVec4(V0Var *Vec4, V1Var *Vec4, V2Var *Vec4, V3Var *Vec4) *Matrix {
238
239	cret := xMatrixInitFromVec4(x.GoPointer(), V0Var, V1Var, V2Var, V3Var)
240	return cret
241}
242
243var xMatrixInitFrustum func(uintptr, float32, float32, float32, float32, float32, float32) *Matrix
244
245// Initializes a #graphene_matrix_t compatible with #graphene_frustum_t.
246//
247// See also: graphene_frustum_init_from_matrix()
248func (x *Matrix) InitFrustum(LeftVar float32, RightVar float32, BottomVar float32, TopVar float32, ZNearVar float32, ZFarVar float32) *Matrix {
249
250	cret := xMatrixInitFrustum(x.GoPointer(), LeftVar, RightVar, BottomVar, TopVar, ZNearVar, ZFarVar)
251	return cret
252}
253
254var xMatrixInitIdentity func(uintptr) *Matrix
255
256// Initializes a #graphene_matrix_t with the identity matrix.
257func (x *Matrix) InitIdentity() *Matrix {
258
259	cret := xMatrixInitIdentity(x.GoPointer())
260	return cret
261}
262
263var xMatrixInitLookAt func(uintptr, *Vec3, *Vec3, *Vec3) *Matrix
264
265// Initializes a #graphene_matrix_t so that it positions the "camera"
266// at the given @eye coordinates towards an object at the @center
267// coordinates. The top of the camera is aligned to the direction
268// of the @up vector.
269//
270// Before the transform, the camera is assumed to be placed at the
271// origin, looking towards the negative Z axis, with the top side of
272// the camera facing in the direction of the Y axis and the right
273// side in the direction of the X axis.
274//
275// In theory, one could use @m to transform a model of such a camera
276// into world-space. However, it is more common to use the inverse of
277// @m to transform another object from world coordinates to the view
278// coordinates of the camera. Typically you would then apply the
279// camera projection transform to get from view to screen
280// coordinates.
281func (x *Matrix) InitLookAt(EyeVar *Vec3, CenterVar *Vec3, UpVar *Vec3) *Matrix {
282
283	cret := xMatrixInitLookAt(x.GoPointer(), EyeVar, CenterVar, UpVar)
284	return cret
285}
286
287var xMatrixInitOrtho func(uintptr, float32, float32, float32, float32, float32, float32) *Matrix
288
289// Initializes a #graphene_matrix_t with an orthographic projection.
290func (x *Matrix) InitOrtho(LeftVar float32, RightVar float32, TopVar float32, BottomVar float32, ZNearVar float32, ZFarVar float32) *Matrix {
291
292	cret := xMatrixInitOrtho(x.GoPointer(), LeftVar, RightVar, TopVar, BottomVar, ZNearVar, ZFarVar)
293	return cret
294}
295
296var xMatrixInitPerspective func(uintptr, float32, float32, float32, float32) *Matrix
297
298// Initializes a #graphene_matrix_t with a perspective projection.
299func (x *Matrix) InitPerspective(FovyVar float32, AspectVar float32, ZNearVar float32, ZFarVar float32) *Matrix {
300
301	cret := xMatrixInitPerspective(x.GoPointer(), FovyVar, AspectVar, ZNearVar, ZFarVar)
302	return cret
303}
304
305var xMatrixInitRotate func(uintptr, float32, *Vec3) *Matrix
306
307// Initializes @m to represent a rotation of @angle degrees on
308// the axis represented by the @axis vector.
309func (x *Matrix) InitRotate(AngleVar float32, AxisVar *Vec3) *Matrix {
310
311	cret := xMatrixInitRotate(x.GoPointer(), AngleVar, AxisVar)
312	return cret
313}
314
315var xMatrixInitScale func(uintptr, float32, float32, float32) *Matrix
316
317// Initializes a #graphene_matrix_t with the given scaling factors.
318func (x *Matrix) InitScale(XVar float32, YVar float32, ZVar float32) *Matrix {
319
320	cret := xMatrixInitScale(x.GoPointer(), XVar, YVar, ZVar)
321	return cret
322}
323
324var xMatrixInitSkew func(uintptr, float32, float32) *Matrix
325
326// Initializes a #graphene_matrix_t with a skew transformation
327// with the given factors.
328func (x *Matrix) InitSkew(XSkewVar float32, YSkewVar float32) *Matrix {
329
330	cret := xMatrixInitSkew(x.GoPointer(), XSkewVar, YSkewVar)
331	return cret
332}
333
334var xMatrixInitTranslate func(uintptr, *Point3D) *Matrix
335
336// Initializes a #graphene_matrix_t with a translation to the
337// given coordinates.
338func (x *Matrix) InitTranslate(PVar *Point3D) *Matrix {
339
340	cret := xMatrixInitTranslate(x.GoPointer(), PVar)
341	return cret
342}
343
344var xMatrixInterpolate func(uintptr, *Matrix, float64, *Matrix)
345
346// Linearly interpolates the two given #graphene_matrix_t by
347// interpolating the decomposed transformations separately.
348//
349// If either matrix cannot be reduced to their transformations
350// then the interpolation cannot be performed, and this function
351// will return an identity matrix.
352func (x *Matrix) Interpolate(BVar *Matrix, FactorVar float64, ResVar *Matrix) {
353
354	xMatrixInterpolate(x.GoPointer(), BVar, FactorVar, ResVar)
355
356}
357
358var xMatrixInverse func(uintptr, *Matrix) bool
359
360// Inverts the given matrix.
361func (x *Matrix) Inverse(ResVar *Matrix) bool {
362
363	cret := xMatrixInverse(x.GoPointer(), ResVar)
364	return cret
365}
366
367var xMatrixIs2d func(uintptr) bool
368
369// Checks whether the given #graphene_matrix_t is compatible with an
370// a 2D affine transformation matrix.
371func (x *Matrix) Is2d() bool {
372
373	cret := xMatrixIs2d(x.GoPointer())
374	return cret
375}
376
377var xMatrixIsBackfaceVisible func(uintptr) bool
378
379// Checks whether a #graphene_matrix_t has a visible back face.
380func (x *Matrix) IsBackfaceVisible() bool {
381
382	cret := xMatrixIsBackfaceVisible(x.GoPointer())
383	return cret
384}
385
386var xMatrixIsIdentity func(uintptr) bool
387
388// Checks whether the given #graphene_matrix_t is the identity matrix.
389func (x *Matrix) IsIdentity() bool {
390
391	cret := xMatrixIsIdentity(x.GoPointer())
392	return cret
393}
394
395var xMatrixIsSingular func(uintptr) bool
396
397// Checks whether a matrix is singular.
398func (x *Matrix) IsSingular() bool {
399
400	cret := xMatrixIsSingular(x.GoPointer())
401	return cret
402}
403
404var xMatrixMultiply func(uintptr, *Matrix, *Matrix)
405
406// Multiplies two #graphene_matrix_t.
407//
408// Matrix multiplication is not commutative in general; the order of the factors matters.
409// The product of this multiplication is (@a × @b)
410func (x *Matrix) Multiply(BVar *Matrix, ResVar *Matrix) {
411
412	xMatrixMultiply(x.GoPointer(), BVar, ResVar)
413
414}
415
416var xMatrixNear func(uintptr, *Matrix, float32) bool
417
418// Compares the two given #graphene_matrix_t matrices and checks
419// whether their values are within the given @epsilon of each
420// other.
421func (x *Matrix) Near(BVar *Matrix, EpsilonVar float32) bool {
422
423	cret := xMatrixNear(x.GoPointer(), BVar, EpsilonVar)
424	return cret
425}
426
427var xMatrixNormalize func(uintptr, *Matrix)
428
429// Normalizes the given #graphene_matrix_t.
430func (x *Matrix) Normalize(ResVar *Matrix) {
431
432	xMatrixNormalize(x.GoPointer(), ResVar)
433
434}
435
436var xMatrixPerspective func(uintptr, float32, *Matrix)
437
438// Applies a perspective of @depth to the matrix.
439func (x *Matrix) Perspective(DepthVar float32, ResVar *Matrix) {
440
441	xMatrixPerspective(x.GoPointer(), DepthVar, ResVar)
442
443}
444
445var xMatrixPrint func(uintptr)
446
447// Prints the contents of a matrix to the standard error stream.
448//
449// This function is only useful for debugging; there are no guarantees
450// made on the format of the output.
451func (x *Matrix) Print() {
452
453	xMatrixPrint(x.GoPointer())
454
455}
456
457var xMatrixProjectPoint func(uintptr, *Point, *Point)
458
459// Projects a #graphene_point_t using the matrix @m.
460func (x *Matrix) ProjectPoint(PVar *Point, ResVar *Point) {
461
462	xMatrixProjectPoint(x.GoPointer(), PVar, ResVar)
463
464}
465
466var xMatrixProjectRect func(uintptr, *Rect, *Quad)
467
468// Projects all corners of a #graphene_rect_t using the given matrix.
469//
470// See also: graphene_matrix_project_point()
471func (x *Matrix) ProjectRect(RVar *Rect, ResVar *Quad) {
472
473	xMatrixProjectRect(x.GoPointer(), RVar, ResVar)
474
475}
476
477var xMatrixProjectRectBounds func(uintptr, *Rect, *Rect)
478
479// Projects a #graphene_rect_t using the given matrix.
480//
481// The resulting rectangle is the axis aligned bounding rectangle capable
482// of fully containing the projected rectangle.
483func (x *Matrix) ProjectRectBounds(RVar *Rect, ResVar *Rect) {
484
485	xMatrixProjectRectBounds(x.GoPointer(), RVar, ResVar)
486
487}
488
489var xMatrixRotate func(uintptr, float32, *Vec3)
490
491// Adds a rotation transformation to @m, using the given @angle
492// and @axis vector.
493//
494// This is the equivalent of calling graphene_matrix_init_rotate() and
495// then multiplying the matrix @m with the rotation matrix.
496func (x *Matrix) Rotate(AngleVar float32, AxisVar *Vec3) {
497
498	xMatrixRotate(x.GoPointer(), AngleVar, AxisVar)
499
500}
501
502var xMatrixRotateEuler func(uintptr, *Euler)
503
504// Adds a rotation transformation to @m, using the given
505// #graphene_euler_t.
506func (x *Matrix) RotateEuler(EVar *Euler) {
507
508	xMatrixRotateEuler(x.GoPointer(), EVar)
509
510}
511
512var xMatrixRotateQuaternion func(uintptr, *Quaternion)
513
514// Adds a rotation transformation to @m, using the given
515// #graphene_quaternion_t.
516//
517// This is the equivalent of calling graphene_quaternion_to_matrix() and
518// then multiplying @m with the rotation matrix.
519func (x *Matrix) RotateQuaternion(QVar *Quaternion) {
520
521	xMatrixRotateQuaternion(x.GoPointer(), QVar)
522
523}
524
525var xMatrixRotateX func(uintptr, float32)
526
527// Adds a rotation transformation around the X axis to @m, using
528// the given @angle.
529//
530// See also: graphene_matrix_rotate()
531func (x *Matrix) RotateX(AngleVar float32) {
532
533	xMatrixRotateX(x.GoPointer(), AngleVar)
534
535}
536
537var xMatrixRotateY func(uintptr, float32)
538
539// Adds a rotation transformation around the Y axis to @m, using
540// the given @angle.
541//
542// See also: graphene_matrix_rotate()
543func (x *Matrix) RotateY(AngleVar float32) {
544
545	xMatrixRotateY(x.GoPointer(), AngleVar)
546
547}
548
549var xMatrixRotateZ func(uintptr, float32)
550
551// Adds a rotation transformation around the Z axis to @m, using
552// the given @angle.
553//
554// See also: graphene_matrix_rotate()
555func (x *Matrix) RotateZ(AngleVar float32) {
556
557	xMatrixRotateZ(x.GoPointer(), AngleVar)
558
559}
560
561var xMatrixScale func(uintptr, float32, float32, float32)
562
563// Adds a scaling transformation to @m, using the three
564// given factors.
565//
566// This is the equivalent of calling graphene_matrix_init_scale() and then
567// multiplying the matrix @m with the scale matrix.
568func (x *Matrix) Scale(FactorXVar float32, FactorYVar float32, FactorZVar float32) {
569
570	xMatrixScale(x.GoPointer(), FactorXVar, FactorYVar, FactorZVar)
571
572}
573
574var xMatrixSkewXy func(uintptr, float32)
575
576// Adds a skew of @factor on the X and Y axis to the given matrix.
577func (x *Matrix) SkewXy(FactorVar float32) {
578
579	xMatrixSkewXy(x.GoPointer(), FactorVar)
580
581}
582
583var xMatrixSkewXz func(uintptr, float32)
584
585// Adds a skew of @factor on the X and Z axis to the given matrix.
586func (x *Matrix) SkewXz(FactorVar float32) {
587
588	xMatrixSkewXz(x.GoPointer(), FactorVar)
589
590}
591
592var xMatrixSkewYz func(uintptr, float32)
593
594// Adds a skew of @factor on the Y and Z axis to the given matrix.
595func (x *Matrix) SkewYz(FactorVar float32) {
596
597	xMatrixSkewYz(x.GoPointer(), FactorVar)
598
599}
600
601var xMatrixTo2d func(uintptr, *float64, *float64, *float64, *float64, *float64, *float64) bool
602
603// Converts a #graphene_matrix_t to an affine transformation
604// matrix, if the given matrix is compatible.
605//
606// The returned values have the following layout:
607//
608// |[<!-- language="plain" -->
609//
610//	⎛ xx  yx ⎞   ⎛  a   b  0 ⎞
611//	⎜ xy  yy ⎟ = ⎜  c   d  0 ⎟
612//	⎝ x0  y0 ⎠   ⎝ tx  ty  1 ⎠
613//
614// ]|
615//
616// This function can be used to convert between a #graphene_matrix_t
617// and an affine matrix type from other libraries.
618func (x *Matrix) To2d(XxVar *float64, YxVar *float64, XyVar *float64, YyVar *float64, X0Var *float64, Y0Var *float64) bool {
619
620	cret := xMatrixTo2d(x.GoPointer(), XxVar, YxVar, XyVar, YyVar, X0Var, Y0Var)
621	return cret
622}
623
624var xMatrixToFloat func(uintptr, *[16]float32)
625
626// Converts a #graphene_matrix_t to an array of floating point
627// values.
628func (x *Matrix) ToFloat(VVar *[16]float32) {
629
630	xMatrixToFloat(x.GoPointer(), VVar)
631
632}
633
634var xMatrixTransformBounds func(uintptr, *Rect, *Rect)
635
636// Transforms each corner of a #graphene_rect_t using the given matrix @m.
637//
638// The result is the axis aligned bounding rectangle containing the coplanar
639// quadrilateral.
640//
641// See also: graphene_matrix_transform_point()
642func (x *Matrix) TransformBounds(RVar *Rect, ResVar *Rect) {
643
644	xMatrixTransformBounds(x.GoPointer(), RVar, ResVar)
645
646}
647
648var xMatrixTransformBox func(uintptr, *Box, *Box)
649
650// Transforms the vertices of a #graphene_box_t using the given matrix @m.
651//
652// The result is the axis aligned bounding box containing the transformed
653// vertices.
654func (x *Matrix) TransformBox(BVar *Box, ResVar *Box) {
655
656	xMatrixTransformBox(x.GoPointer(), BVar, ResVar)
657
658}
659
660var xMatrixTransformPoint func(uintptr, *Point, *Point)
661
662// Transforms the given #graphene_point_t using the matrix @m.
663//
664// Unlike graphene_matrix_transform_vec3(), this function will take into
665// account the fourth row vector of the #graphene_matrix_t when computing
666// the dot product of each row vector of the matrix.
667//
668// See also: graphene_simd4x4f_point3_mul()
669func (x *Matrix) TransformPoint(PVar *Point, ResVar *Point) {
670
671	xMatrixTransformPoint(x.GoPointer(), PVar, ResVar)
672
673}
674
675var xMatrixTransformPoint3d func(uintptr, *Point3D, *Point3D)
676
677// Transforms the given #graphene_point3d_t using the matrix @m.
678//
679// Unlike graphene_matrix_transform_vec3(), this function will take into
680// account the fourth row vector of the #graphene_matrix_t when computing
681// the dot product of each row vector of the matrix.
682//
683// See also: graphene_simd4x4f_point3_mul()
684func (x *Matrix) TransformPoint3d(PVar *Point3D, ResVar *Point3D) {
685
686	xMatrixTransformPoint3d(x.GoPointer(), PVar, ResVar)
687
688}
689
690var xMatrixTransformRay func(uintptr, *Ray, *Ray)
691
692// Transform a #graphene_ray_t using the given matrix @m.
693func (x *Matrix) TransformRay(RVar *Ray, ResVar *Ray) {
694
695	xMatrixTransformRay(x.GoPointer(), RVar, ResVar)
696
697}
698
699var xMatrixTransformRect func(uintptr, *Rect, *Quad)
700
701// Transforms each corner of a #graphene_rect_t using the given matrix @m.
702//
703// The result is a coplanar quadrilateral.
704//
705// See also: graphene_matrix_transform_point()
706func (x *Matrix) TransformRect(RVar *Rect, ResVar *Quad) {
707
708	xMatrixTransformRect(x.GoPointer(), RVar, ResVar)
709
710}
711
712var xMatrixTransformSphere func(uintptr, *Sphere, *Sphere)
713
714// Transforms a #graphene_sphere_t using the given matrix @m. The
715// result is the bounding sphere containing the transformed sphere.
716func (x *Matrix) TransformSphere(SVar *Sphere, ResVar *Sphere) {
717
718	xMatrixTransformSphere(x.GoPointer(), SVar, ResVar)
719
720}
721
722var xMatrixTransformVec3 func(uintptr, *Vec3, *Vec3)
723
724// Transforms the given #graphene_vec3_t using the matrix @m.
725//
726// This function will multiply the X, Y, and Z row vectors of the matrix @m
727// with the corresponding components of the vector @v. The W row vector will
728// be ignored.
729//
730// See also: graphene_simd4x4f_vec3_mul()
731func (x *Matrix) TransformVec3(VVar *Vec3, ResVar *Vec3) {
732
733	xMatrixTransformVec3(x.GoPointer(), VVar, ResVar)
734
735}
736
737var xMatrixTransformVec4 func(uintptr, *Vec4, *Vec4)
738
739// Transforms the given #graphene_vec4_t using the matrix @m.
740//
741// See also: graphene_simd4x4f_vec4_mul()
742func (x *Matrix) TransformVec4(VVar *Vec4, ResVar *Vec4) {
743
744	xMatrixTransformVec4(x.GoPointer(), VVar, ResVar)
745
746}
747
748var xMatrixTranslate func(uintptr, *Point3D)
749
750// Adds a translation transformation to @m using the coordinates
751// of the given #graphene_point3d_t.
752//
753// This is the equivalent of calling graphene_matrix_init_translate() and
754// then multiplying @m with the translation matrix.
755func (x *Matrix) Translate(PosVar *Point3D) {
756
757	xMatrixTranslate(x.GoPointer(), PosVar)
758
759}
760
761var xMatrixTranspose func(uintptr, *Matrix)
762
763// Transposes the given matrix.
764func (x *Matrix) Transpose(ResVar *Matrix) {
765
766	xMatrixTranspose(x.GoPointer(), ResVar)
767
768}
769
770var xMatrixUnprojectPoint3d func(uintptr, *Matrix, *Point3D, *Point3D)
771
772// Unprojects the given @point using the @projection matrix and
773// a @modelview matrix.
774func (x *Matrix) UnprojectPoint3d(ModelviewVar *Matrix, PointVar *Point3D, ResVar *Point3D) {
775
776	xMatrixUnprojectPoint3d(x.GoPointer(), ModelviewVar, PointVar, ResVar)
777
778}
779
780var xMatrixUntransformBounds func(uintptr, *Rect, *Rect, *Rect)
781
782// Undoes the transformation on the corners of a #graphene_rect_t using the
783// given matrix, within the given axis aligned rectangular @bounds.
784func (x *Matrix) UntransformBounds(RVar *Rect, BoundsVar *Rect, ResVar *Rect) {
785
786	xMatrixUntransformBounds(x.GoPointer(), RVar, BoundsVar, ResVar)
787
788}
789
790var xMatrixUntransformPoint func(uintptr, *Point, *Rect, *Point) bool
791
792// Undoes the transformation of a #graphene_point_t using the
793// given matrix, within the given axis aligned rectangular @bounds.
794func (x *Matrix) UntransformPoint(PVar *Point, BoundsVar *Rect, ResVar *Point) bool {
795
796	cret := xMatrixUntransformPoint(x.GoPointer(), PVar, BoundsVar, ResVar)
797	return cret
798}
799
800func init() {
801	core.SetPackageName("GRAPHENE", "graphene-gobject-1.0")
802	core.SetSharedLibraries("GRAPHENE", []string{"libgraphene-1.0.so.0"})
803	var libs []uintptr
804	for _, libPath := range core.GetPaths("GRAPHENE") {
805		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
806		if err != nil {
807			panic(err)
808		}
809		libs = append(libs, lib)
810	}
811
812	core.PuregoSafeRegister(&xMatrixGLibType, libs, "graphene_matrix_get_type")
813
814	core.PuregoSafeRegister(&xMatrixAlloc, libs, "graphene_matrix_alloc")
815
816	core.PuregoSafeRegister(&xMatrixDecompose, libs, "graphene_matrix_decompose")
817	core.PuregoSafeRegister(&xMatrixDeterminant, libs, "graphene_matrix_determinant")
818	core.PuregoSafeRegister(&xMatrixEqual, libs, "graphene_matrix_equal")
819	core.PuregoSafeRegister(&xMatrixEqualFast, libs, "graphene_matrix_equal_fast")
820	core.PuregoSafeRegister(&xMatrixFree, libs, "graphene_matrix_free")
821	core.PuregoSafeRegister(&xMatrixGetRow, libs, "graphene_matrix_get_row")
822	core.PuregoSafeRegister(&xMatrixGetValue, libs, "graphene_matrix_get_value")
823	core.PuregoSafeRegister(&xMatrixGetXScale, libs, "graphene_matrix_get_x_scale")
824	core.PuregoSafeRegister(&xMatrixGetXTranslation, libs, "graphene_matrix_get_x_translation")
825	core.PuregoSafeRegister(&xMatrixGetYScale, libs, "graphene_matrix_get_y_scale")
826	core.PuregoSafeRegister(&xMatrixGetYTranslation, libs, "graphene_matrix_get_y_translation")
827	core.PuregoSafeRegister(&xMatrixGetZScale, libs, "graphene_matrix_get_z_scale")
828	core.PuregoSafeRegister(&xMatrixGetZTranslation, libs, "graphene_matrix_get_z_translation")
829	core.PuregoSafeRegister(&xMatrixInitFrom2d, libs, "graphene_matrix_init_from_2d")
830	core.PuregoSafeRegister(&xMatrixInitFromFloat, libs, "graphene_matrix_init_from_float")
831	core.PuregoSafeRegister(&xMatrixInitFromMatrix, libs, "graphene_matrix_init_from_matrix")
832	core.PuregoSafeRegister(&xMatrixInitFromVec4, libs, "graphene_matrix_init_from_vec4")
833	core.PuregoSafeRegister(&xMatrixInitFrustum, libs, "graphene_matrix_init_frustum")
834	core.PuregoSafeRegister(&xMatrixInitIdentity, libs, "graphene_matrix_init_identity")
835	core.PuregoSafeRegister(&xMatrixInitLookAt, libs, "graphene_matrix_init_look_at")
836	core.PuregoSafeRegister(&xMatrixInitOrtho, libs, "graphene_matrix_init_ortho")
837	core.PuregoSafeRegister(&xMatrixInitPerspective, libs, "graphene_matrix_init_perspective")
838	core.PuregoSafeRegister(&xMatrixInitRotate, libs, "graphene_matrix_init_rotate")
839	core.PuregoSafeRegister(&xMatrixInitScale, libs, "graphene_matrix_init_scale")
840	core.PuregoSafeRegister(&xMatrixInitSkew, libs, "graphene_matrix_init_skew")
841	core.PuregoSafeRegister(&xMatrixInitTranslate, libs, "graphene_matrix_init_translate")
842	core.PuregoSafeRegister(&xMatrixInterpolate, libs, "graphene_matrix_interpolate")
843	core.PuregoSafeRegister(&xMatrixInverse, libs, "graphene_matrix_inverse")
844	core.PuregoSafeRegister(&xMatrixIs2d, libs, "graphene_matrix_is_2d")
845	core.PuregoSafeRegister(&xMatrixIsBackfaceVisible, libs, "graphene_matrix_is_backface_visible")
846	core.PuregoSafeRegister(&xMatrixIsIdentity, libs, "graphene_matrix_is_identity")
847	core.PuregoSafeRegister(&xMatrixIsSingular, libs, "graphene_matrix_is_singular")
848	core.PuregoSafeRegister(&xMatrixMultiply, libs, "graphene_matrix_multiply")
849	core.PuregoSafeRegister(&xMatrixNear, libs, "graphene_matrix_near")
850	core.PuregoSafeRegister(&xMatrixNormalize, libs, "graphene_matrix_normalize")
851	core.PuregoSafeRegister(&xMatrixPerspective, libs, "graphene_matrix_perspective")
852	core.PuregoSafeRegister(&xMatrixPrint, libs, "graphene_matrix_print")
853	core.PuregoSafeRegister(&xMatrixProjectPoint, libs, "graphene_matrix_project_point")
854	core.PuregoSafeRegister(&xMatrixProjectRect, libs, "graphene_matrix_project_rect")
855	core.PuregoSafeRegister(&xMatrixProjectRectBounds, libs, "graphene_matrix_project_rect_bounds")
856	core.PuregoSafeRegister(&xMatrixRotate, libs, "graphene_matrix_rotate")
857	core.PuregoSafeRegister(&xMatrixRotateEuler, libs, "graphene_matrix_rotate_euler")
858	core.PuregoSafeRegister(&xMatrixRotateQuaternion, libs, "graphene_matrix_rotate_quaternion")
859	core.PuregoSafeRegister(&xMatrixRotateX, libs, "graphene_matrix_rotate_x")
860	core.PuregoSafeRegister(&xMatrixRotateY, libs, "graphene_matrix_rotate_y")
861	core.PuregoSafeRegister(&xMatrixRotateZ, libs, "graphene_matrix_rotate_z")
862	core.PuregoSafeRegister(&xMatrixScale, libs, "graphene_matrix_scale")
863	core.PuregoSafeRegister(&xMatrixSkewXy, libs, "graphene_matrix_skew_xy")
864	core.PuregoSafeRegister(&xMatrixSkewXz, libs, "graphene_matrix_skew_xz")
865	core.PuregoSafeRegister(&xMatrixSkewYz, libs, "graphene_matrix_skew_yz")
866	core.PuregoSafeRegister(&xMatrixTo2d, libs, "graphene_matrix_to_2d")
867	core.PuregoSafeRegister(&xMatrixToFloat, libs, "graphene_matrix_to_float")
868	core.PuregoSafeRegister(&xMatrixTransformBounds, libs, "graphene_matrix_transform_bounds")
869	core.PuregoSafeRegister(&xMatrixTransformBox, libs, "graphene_matrix_transform_box")
870	core.PuregoSafeRegister(&xMatrixTransformPoint, libs, "graphene_matrix_transform_point")
871	core.PuregoSafeRegister(&xMatrixTransformPoint3d, libs, "graphene_matrix_transform_point3d")
872	core.PuregoSafeRegister(&xMatrixTransformRay, libs, "graphene_matrix_transform_ray")
873	core.PuregoSafeRegister(&xMatrixTransformRect, libs, "graphene_matrix_transform_rect")
874	core.PuregoSafeRegister(&xMatrixTransformSphere, libs, "graphene_matrix_transform_sphere")
875	core.PuregoSafeRegister(&xMatrixTransformVec3, libs, "graphene_matrix_transform_vec3")
876	core.PuregoSafeRegister(&xMatrixTransformVec4, libs, "graphene_matrix_transform_vec4")
877	core.PuregoSafeRegister(&xMatrixTranslate, libs, "graphene_matrix_translate")
878	core.PuregoSafeRegister(&xMatrixTranspose, libs, "graphene_matrix_transpose")
879	core.PuregoSafeRegister(&xMatrixUnprojectPoint3d, libs, "graphene_matrix_unproject_point3d")
880	core.PuregoSafeRegister(&xMatrixUntransformBounds, libs, "graphene_matrix_untransform_bounds")
881	core.PuregoSafeRegister(&xMatrixUntransformPoint, libs, "graphene_matrix_untransform_point")
882
883}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close