MeshLib C Docs
Loading...
Searching...
No Matches
MRVector2.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMisc/common.h>
4#include <MRCMisc/exports.h>
5
6#include <stdbool.h>
7#include <stddef.h>
8#include <stdint.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef struct MR_NoInit MR_NoInit; // Defined in `#include <MRCMesh/MRMeshFwd.h>`.
15
16
19typedef struct MR_Vector2b
20{
21 bool x;
22 bool y;
24
27typedef struct MR_Vector2i
28{
29 int32_t x;
30 int32_t y;
32
40
43typedef struct MR_Vector2f
44{
45 float x;
46 float y;
48
51typedef struct MR_Vector2d
52{
53 double x;
54 double y;
56
59MRC_API const int32_t *MR_Vector2b_Get_elements(void);
60
63
68
72
75
78
81
84
87
90
94MRC_API const bool *MR_Vector2b_index_const(const MR_Vector2b *_this, int32_t e);
95
99MRC_API bool *MR_Vector2b_index(MR_Vector2b *_this, int32_t e);
100
104
108
113
118
119// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
124
128
133
138
142
146
149
155
161
166
171
175
178
183
187
190
193
196
199
202
205
209MRC_API const int32_t *MR_Vector2i_index_const(const MR_Vector2i *_this, int32_t e);
210
214MRC_API int32_t *MR_Vector2i_index(MR_Vector2i *_this, int32_t e);
215
219
223
228
233
238
243
244// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
249
253
258
263
267
271
274
280
286
291
296
300
303
308
312
315
318
321
324
327
330
335
340
344
348
353
358
363
368
369// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
374
378
383
388
392
396
399
405
411
416
421
425
428
433
437
440
443
446
449
452
455
459MRC_API const float *MR_Vector2f_index_const(const MR_Vector2f *_this, int32_t e);
460
464MRC_API float *MR_Vector2f_index(MR_Vector2f *_this, int32_t e);
465
469
473
477
482
487
491
496
501
502// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
507
511
516
521
525
529
532
538
544
549
554
558
561
566
570
573
576
579
582
585
588
592MRC_API const double *MR_Vector2d_index_const(const MR_Vector2d *_this, int32_t e);
593
597MRC_API double *MR_Vector2d_index(MR_Vector2d *_this, int32_t e);
598
602
606
610
615
620
624
629
634
635// NOTE: We use `std::declval()` in the operators below because libclang 18 in our binding generator is bugged and chokes on decltyping `a.x` and such. TODO fix this when we update libclang.
640
644
649
654
658
662
665
671
677
682
687
692MRC_API float MR_cross(const MR_Vector2f *a, const MR_Vector2f *b);
693
699
705
711
717
723
724#ifdef __cplusplus
725} // extern "C"
726#endif
struct MR_NoInit MR_NoInit
Definition MRBox.h:16
MRC_API bool MR_not_equal_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i MR_Vector2i_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2d * MR_mul_assign_MR_Vector2d_double(MR_Vector2d *a, double b)
MRC_API MR_Vector2f MR_Vector2f_plusX(void)
Generated from a method of class MR::Vector2f named plusX.
MRC_API MR_Vector2i MR_Vector2i_plusX(void)
Generated from a method of class MR::Vector2i named plusX.
MRC_API float MR_Vector2f_lengthSq(const MR_Vector2f *_this)
MRC_API bool MR_Vector2f_isFinite(const MR_Vector2f *_this)
MRC_API MR_Vector2f MR_neg_MR_Vector2f(const MR_Vector2f *a)
MRC_API const MR_Vector2d * MR_pos_MR_Vector2d(const MR_Vector2d *a)
MRC_API MR_Vector2f MR_Vector2f_diagonal(float a)
Generated from a method of class MR::Vector2f named diagonal.
MRC_API MR_Vector2i MR_Vector2i_furthestBasisVector(const MR_Vector2i *_this)
MRC_API MR_Vector2b MR_Vector2b_minusY(void)
Generated from a method of class MR::Vector2b named minusY.
MRC_API MR_Vector2f MR_Vector2f_furthestBasisVector(const MR_Vector2f *_this)
MRC_API MR_Vector2i64 * MR_sub_assign_MR_Vector2i64(MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2i64 MR_Vector2i64_perpendicular(const MR_Vector2i64 *_this)
MRC_API MR_Vector2b MR_Vector2b_Construct_2(bool x, bool y)
Generated from a constructor of class MR::Vector2b.
MRC_API MR_Vector2i MR_add_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_Vector2d_plusY(void)
Generated from a method of class MR::Vector2d named plusY.
MRC_API MR_Vector2d MR_mul_MR_Vector2d_double(const MR_Vector2d *b, double a)
MRC_API const int32_t * MR_Vector2f_Get_elements(void)
MRC_API const int32_t * MR_Vector2i_index_const(const MR_Vector2i *_this, int32_t e)
MRC_API MR_Vector2f MR_mul_float_MR_Vector2f(float a, const MR_Vector2f *b)
MRC_API MR_Vector2d MR_Vector2d_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API MR_Vector2i * MR_Vector2i_DefaultConstructArray(size_t num_elems)
MRC_API MR_Vector2f * MR_mul_assign_MR_Vector2f_float(MR_Vector2f *a, float b)
MRC_API bool MR_equal_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2i64 * MR_mul_assign_MR_Vector2i64_int64_t(MR_Vector2i64 *a, MR_int64_t b)
MRC_API MR_Vector2b * MR_add_assign_MR_Vector2b(MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d * MR_sub_assign_MR_Vector2d(MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_Vector2i64 MR_Vector2i64_minusX(void)
Generated from a method of class MR::Vector2i64 named minusX.
MRC_API MR_Vector2i MR_sub_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_mul_double_MR_Vector2d(double a, const MR_Vector2d *b)
MRC_API bool MR_not_equal_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2f MR_Vector2f_minusY(void)
Generated from a method of class MR::Vector2f named minusY.
MRC_API bool MR_not_equal_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_div_MR_Vector2d_double(MR_Vector2d b, double a)
Generated from function MR::operator/.
MRC_API MR_Vector2f MR_mul_MR_Vector2f_float(const MR_Vector2f *b, float a)
MRC_API MR_Vector2d MR_Vector2d_Construct_2(double x, double y)
Generated from a constructor of class MR::Vector2d.
MRC_API MR_Vector2i * MR_mul_assign_MR_Vector2i_int32_t(MR_Vector2i *a, int32_t b)
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_2(MR_int64_t x, MR_int64_t y)
Generated from a constructor of class MR::Vector2i64.
MRC_API MR_Vector2i MR_Vector2i_plusY(void)
Generated from a method of class MR::Vector2i named plusY.
MRC_API int32_t MR_dot_bool_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API bool MR_equal_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API const MR_Vector2f * MR_pos_MR_Vector2f(const MR_Vector2f *a)
struct MR_Vector2i64 MR_Vector2i64
MRC_API MR_Vector2d MR_Vector2d_diagonal(double a)
Generated from a method of class MR::Vector2d named diagonal.
MRC_API MR_Vector2i MR_mul_bool_MR_Vector2b(bool a, const MR_Vector2b *b)
MRC_API MR_Vector2d MR_Vector2d_minusX(void)
Generated from a method of class MR::Vector2d named minusX.
MRC_API MR_int64_t * MR_Vector2i64_index(MR_Vector2i64 *_this, int32_t e)
MRC_API const float * MR_Vector2f_index_const(const MR_Vector2f *_this, int32_t e)
MRC_API float MR_Vector2f_length(const MR_Vector2f *_this)
MRC_API MR_int64_t MR_dot_int64_t_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API float * MR_Vector2f_index(MR_Vector2f *_this, int32_t e)
MRC_API MR_Vector2d * MR_div_assign_MR_Vector2d_double(MR_Vector2d *a, double b)
MRC_API const int32_t * MR_Vector2d_Get_elements(void)
MRC_API MR_Vector2f MR_Vector2f_normalized(const MR_Vector2f *_this)
MRC_API int32_t MR_Vector2i_lengthSq(const MR_Vector2i *_this)
MRC_API bool MR_equal_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2i64 * MR_div_assign_MR_Vector2i64_int64_t(MR_Vector2i64 *a, MR_int64_t b)
MRC_API MR_int64_t MR_Vector2i64_lengthSq(const MR_Vector2i64 *_this)
MRC_API MR_Vector2b * MR_Vector2b_DefaultConstructArray(size_t num_elems)
MRC_API double MR_Vector2d_lengthSq(const MR_Vector2d *_this)
MRC_API MR_Vector2f MR_sub_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i64 MR_mul_int64_t_MR_Vector2i64(MR_int64_t a, const MR_Vector2i64 *b)
MRC_API MR_Vector2f * MR_sub_assign_MR_Vector2f(MR_Vector2f *a, const MR_Vector2f *b)
MRC_API bool MR_not_equal_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API bool * MR_Vector2b_index(MR_Vector2b *_this, int32_t e)
MRC_API const MR_Vector2i64 * MR_pos_MR_Vector2i64(const MR_Vector2i64 *a)
MRC_API MR_Vector2b MR_Vector2b_diagonal(bool a)
Generated from a method of class MR::Vector2b named diagonal.
MRC_API MR_Vector2f * MR_div_assign_MR_Vector2f_float(MR_Vector2f *a, float b)
MRC_API MR_Vector2i64 MR_mul_MR_Vector2i64_int64_t(const MR_Vector2i64 *b, MR_int64_t a)
MRC_API MR_Vector2i * MR_add_assign_MR_Vector2i(MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2f MR_Vector2f_perpendicular(const MR_Vector2f *_this)
MRC_API bool MR_not_equal_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2d MR_Vector2d_minusY(void)
Generated from a method of class MR::Vector2d named minusY.
MRC_API MR_Vector2i MR_Vector2i_perpendicular(const MR_Vector2i *_this)
MRC_API MR_Vector2d MR_sub_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API float MR_dot_float_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i64 MR_sub_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
struct MR_Vector2f MR_Vector2f
MRC_API MR_Vector2i MR_mul_MR_Vector2b_bool(const MR_Vector2b *b, bool a)
MRC_API MR_Vector2f MR_div_MR_Vector2f_float(MR_Vector2f b, float a)
Generated from function MR::operator/.
MRC_API MR_Vector2f MR_Vector2f_plusY(void)
Generated from a method of class MR::Vector2f named plusY.
MRC_API MR_Vector2b MR_Vector2b_minusX(void)
Generated from a method of class MR::Vector2b named minusX.
MRC_API MR_Vector2f * MR_Vector2f_DefaultConstructArray(size_t num_elems)
MRC_API MR_Vector2f MR_Vector2f_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2i64 MR_div_MR_Vector2i64_int64_t(MR_Vector2i64 b, MR_int64_t a)
Generated from function MR::operator/.
MRC_API MR_Vector2i MR_Vector2i_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API int32_t MR_dot_int32_t_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2i64 MR_Vector2i64_plusY(void)
Generated from a method of class MR::Vector2i64 named plusY.
MRC_API MR_Vector2d MR_Vector2d_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2b MR_Vector2b_plusY(void)
Generated from a method of class MR::Vector2b named plusY.
MRC_API const int32_t * MR_Vector2i64_Get_elements(void)
MRC_API MR_Vector2f MR_Vector2f_Construct_2(float x, float y)
Generated from a constructor of class MR::Vector2f.
MRC_API MR_Vector2i MR_Vector2i_diagonal(int32_t a)
Generated from a method of class MR::Vector2i named diagonal.
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_1(const MR_NoInit *_1)
struct MR_Vector2d MR_Vector2d
MRC_API const MR_int64_t * MR_Vector2i64_index_const(const MR_Vector2i64 *_this, int32_t e)
MRC_API bool MR_Vector2b_lengthSq(const MR_Vector2b *_this)
MRC_API MR_Vector2d MR_neg_MR_Vector2d(const MR_Vector2d *a)
MRC_API MR_Vector2f MR_Vector2f_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API const int32_t * MR_Vector2b_Get_elements(void)
MRC_API MR_Vector2i64 MR_Vector2i64_furthestBasisVector(const MR_Vector2i64 *_this)
MRC_API MR_Vector2b * MR_sub_assign_MR_Vector2b(MR_Vector2b *a, const MR_Vector2b *b)
MRC_API MR_Vector2b MR_Vector2b_Construct_1(const MR_NoInit *_1)
MRC_API MR_Vector2d MR_Vector2d_plusX(void)
Generated from a method of class MR::Vector2d named plusX.
MRC_API double MR_dot_double_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_Vector2i MR_Vector2i_Construct_2(int32_t x, int32_t y)
Generated from a constructor of class MR::Vector2i.
MRC_API MR_Vector2i64 * MR_add_assign_MR_Vector2i64(MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2f * MR_add_assign_MR_Vector2f(MR_Vector2f *a, const MR_Vector2f *b)
MRC_API const MR_Vector2b * MR_pos_MR_Vector2b(const MR_Vector2b *a)
MRC_API bool MR_equal_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i MR_add_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2b * MR_div_assign_MR_Vector2b_bool(MR_Vector2b *a, bool b)
MRC_API MR_Vector2i64 MR_Vector2i64_plusX(void)
Generated from a method of class MR::Vector2i64 named plusX.
MRC_API int32_t * MR_Vector2i_index(MR_Vector2i *_this, int32_t e)
MRC_API const double * MR_Vector2d_index_const(const MR_Vector2d *_this, int32_t e)
MRC_API MR_Vector2i64 MR_Vector2i64_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API MR_Vector2f MR_add_MR_Vector2f(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2i MR_mul_MR_Vector2i_int32_t(const MR_Vector2i *b, int32_t a)
MRC_API MR_Vector2d MR_add_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API float MR_cross(const MR_Vector2f *a, const MR_Vector2f *b)
MRC_API MR_Vector2d MR_Vector2d_normalized(const MR_Vector2d *_this)
MRC_API MR_Vector2i64 MR_neg_MR_Vector2i64(const MR_Vector2i64 *a)
MRC_API MR_Vector2i64 MR_Vector2i64_diagonal(MR_int64_t a)
Generated from a method of class MR::Vector2i64 named diagonal.
MRC_API MR_Vector2i * MR_div_assign_MR_Vector2i_int32_t(MR_Vector2i *a, int32_t b)
MRC_API MR_Vector2d * MR_Vector2d_DefaultConstructArray(size_t num_elems)
MRC_API MR_Vector2i MR_sub_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2i MR_div_MR_Vector2b_bool(MR_Vector2b b, bool a)
Generated from function MR::operator/.
struct MR_Vector2i MR_Vector2i
MRC_API MR_Vector2d MR_Vector2d_furthestBasisVector(const MR_Vector2d *_this)
MRC_API MR_Vector2i * MR_sub_assign_MR_Vector2i(MR_Vector2i *a, const MR_Vector2i *b)
MRC_API MR_Vector2b MR_Vector2b_plusX(void)
Generated from a method of class MR::Vector2b named plusX.
MRC_API MR_Vector2d * MR_add_assign_MR_Vector2d(MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_Vector2i MR_Vector2i_minusX(void)
Generated from a method of class MR::Vector2i named minusX.
MRC_API MR_Vector2i MR_Vector2i_minusY(void)
Generated from a method of class MR::Vector2i named minusY.
MRC_API MR_Vector2i MR_neg_MR_Vector2b(const MR_Vector2b *a)
MRC_API MR_Vector2b * MR_mul_assign_MR_Vector2b_bool(MR_Vector2b *a, bool b)
MRC_API MR_Vector2i MR_mul_int32_t_MR_Vector2i(int32_t a, const MR_Vector2i *b)
MRC_API bool MR_equal_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API bool MR_Vector2d_isFinite(const MR_Vector2d *_this)
MRC_API MR_Vector2i MR_neg_MR_Vector2i(const MR_Vector2i *a)
MRC_API double MR_Vector2d_length(const MR_Vector2d *_this)
MRC_API MR_Vector2i64 * MR_Vector2i64_DefaultConstructArray(size_t num_elems)
MRC_API double MR_Vector2i_length(const MR_Vector2i *_this)
MRC_API MR_Vector2i64 MR_Vector2i64_minusY(void)
Generated from a method of class MR::Vector2i64 named minusY.
MRC_API const bool * MR_Vector2b_index_const(const MR_Vector2b *_this, int32_t e)
MRC_API MR_Vector2b MR_Vector2b_DefaultConstruct(void)
Constructs an empty (default-constructed) instance.
MRC_API const MR_Vector2i * MR_pos_MR_Vector2i(const MR_Vector2i *a)
MRC_API double * MR_Vector2d_index(MR_Vector2d *_this, int32_t e)
MRC_API double MR_Vector2i64_length(const MR_Vector2i64 *_this)
MRC_API MR_Vector2i64 MR_add_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API MR_Vector2i MR_div_MR_Vector2i_int32_t(MR_Vector2i b, int32_t a)
Generated from function MR::operator/.
struct MR_Vector2b MR_Vector2b
MRC_API MR_Vector2f MR_Vector2f_minusX(void)
Generated from a method of class MR::Vector2f named minusX.
MRC_API MR_Vector2d MR_Vector2d_perpendicular(const MR_Vector2d *_this)
MRC_API double MR_Vector2b_length(const MR_Vector2b *_this)
MRC_API const int32_t * MR_Vector2i_Get_elements(void)
int64_t MR_int64_t
Definition common.h:13
#define MRC_API
Definition exports.h:11
Definition MRVector2.h:20
bool y
Definition MRVector2.h:22
bool x
Definition MRVector2.h:21
Definition MRVector2.h:52
double y
Definition MRVector2.h:54
double x
Definition MRVector2.h:53
Definition MRVector2.h:44
float x
Definition MRVector2.h:45
float y
Definition MRVector2.h:46
Definition MRVector2.h:36
MR_int64_t x
Definition MRVector2.h:37
MR_int64_t y
Definition MRVector2.h:38
Definition MRVector2.h:28
int32_t y
Definition MRVector2.h:30
int32_t x
Definition MRVector2.h:29