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
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct MR_NoInit MR_NoInit; // Defined in `#include <MRCMesh/MRMeshFwd.h>`.
14typedef struct MR_std_istream MR_std_istream; // Defined in `#include <MRCMisc/iostream.h>`.
15typedef struct MR_std_ostream MR_std_ostream; // Defined in `#include <MRCMisc/iostream.h>`.
16
17
20typedef struct MR_Vector2b
21{
22 bool x;
23 bool y;
25
28typedef struct MR_Vector2i
29{
30 int x;
31 int y;
33
41
44typedef struct MR_Vector2f
45{
46 float x;
47 float y;
49
52typedef struct MR_Vector2d
53{
54 double x;
55 double y;
57
61
64
69
74
77
80
83
86
90MRC_API const bool *MR_Vector2b_index_const(const MR_Vector2b *_this, int e);
91
96
100
104
109
114
115// 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.
120
124
129
134
138
142
145
151
157
162
167
173
179
183
186
191
196
199
202
205
208
211
214
218MRC_API const int *MR_Vector2i_index_const(const MR_Vector2i *_this, int e);
219
224
228
232
237
242
247
252
253// 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.
258
262
267
272
276
280
283
289
295
300
305
311
317
321
324
329
334
339
342
345
348
351
354
359
364
368
372
377
382
387
392
393// 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.
398
402
407
412
416
420
423
429
435
440
445
451
457
461
464
469
474
477
480
483
486
489
492
496MRC_API const float *MR_Vector2f_index_const(const MR_Vector2f *_this, int e);
497
502
506
510
514
519
524
528
533
538
539// 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.
544
548
553
558
562
566
569
575
581
586
591
597
603
607
610
615
620
623
626
629
632
635
638
642MRC_API const double *MR_Vector2d_index_const(const MR_Vector2d *_this, int e);
643
647MRC_API double *MR_Vector2d_index(MR_Vector2d *_this, int e);
648
652
656
660
665
670
674
679
684
685// 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.
690
694
699
704
708
712
715
721
727
732
737
743
749
754MRC_API float MR_cross(const MR_Vector2f *a, const MR_Vector2f *b);
755
761
767
773
779
785
786#ifdef __cplusplus
787} // extern "C"
788#endif
struct MR_NoInit MR_NoInit
Definition MRBox.h:15
struct MR_std_ostream MR_std_ostream
Definition MRCtm.h:31
struct MR_std_istream MR_std_istream
Definition MRCtm.h:28
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 method MR::Vector2f::plusX.
MRC_API MR_Vector2i MR_Vector2i_plusX(void)
Generated from method MR::Vector2i::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 MR_std_istream * MR_input_MR_Vector2f(MR_std_istream *s, MR_Vector2f *vec)
MRC_API MR_Vector2i * MR_div_assign_MR_Vector2i_int(MR_Vector2i *a, int b)
MRC_API double * MR_Vector2d_index(MR_Vector2d *_this, int e)
MRC_API MR_Vector2i * MR_mul_assign_MR_Vector2i_int(MR_Vector2i *a, int b)
MRC_API MR_Vector2i MR_Vector2i_Construct_2(int x, int y)
Generated from constructor MR::Vector2i::Vector2i.
MRC_API const MR_Vector2d * MR_pos_MR_Vector2d(const MR_Vector2d *a)
MRC_API MR_Vector2f MR_Vector2f_diagonal(float a)
Generated from method MR::Vector2f::diagonal.
MRC_API MR_Vector2i MR_Vector2i_furthestBasisVector(const MR_Vector2i *_this)
MRC_API const float * MR_Vector2f_index_const(const MR_Vector2f *_this, int e)
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 constructor MR::Vector2b::Vector2b.
MRC_API MR_int64_t * MR_Vector2i64_index(MR_Vector2i64 *_this, int e)
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 method MR::Vector2d::plusY.
MRC_API MR_Vector2d MR_mul_MR_Vector2d_double(const MR_Vector2d *b, double a)
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 method MR::Vector2i64::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_std_istream * MR_input_MR_Vector2i(MR_std_istream *s, MR_Vector2i *vec)
MRC_API MR_Vector2f MR_Vector2f_minusY(void)
Generated from method MR::Vector2f::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 constructor MR::Vector2d::Vector2d.
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_2(MR_int64_t x, MR_int64_t y)
MRC_API MR_Vector2i MR_Vector2i_plusY(void)
Generated from method MR::Vector2i::plusY.
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 method MR::Vector2d::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 method MR::Vector2d::minusX.
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 bool * MR_Vector2b_index(MR_Vector2b *_this, int e)
MRC_API MR_Vector2d * MR_div_assign_MR_Vector2d_double(MR_Vector2d *a, double b)
MRC_API MR_Vector2f MR_Vector2f_normalized(const MR_Vector2f *_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 const MR_int64_t * MR_Vector2i64_index_const(const MR_Vector2i64 *_this, int e)
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 int MR_dot_int_MR_Vector2i(const MR_Vector2i *a, const MR_Vector2i *b)
MRC_API const int * MR_Vector2i_Get_elements(void)
MRC_API const MR_Vector2i64 * MR_pos_MR_Vector2i64(const MR_Vector2i64 *a)
MRC_API MR_Vector2b MR_Vector2b_diagonal(bool a)
Generated from method MR::Vector2b::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 const bool * MR_Vector2b_index_const(const MR_Vector2b *_this, int e)
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 method MR::Vector2d::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_std_ostream * MR_print_MR_Vector2i64(MR_std_ostream *s, const MR_Vector2i64 *vec)
MRC_API MR_Vector2i MR_div_MR_Vector2i_int(MR_Vector2i b, int a)
Generated from function MR::operator/.
MRC_API int * MR_Vector2i_index(MR_Vector2i *_this, int e)
MRC_API MR_Vector2i64 MR_sub_MR_Vector2i64(const MR_Vector2i64 *a, const MR_Vector2i64 *b)
MRC_API const int * MR_Vector2f_Get_elements(void)
struct MR_Vector2f MR_Vector2f
MRC_API MR_Vector2i MR_mul_MR_Vector2b_bool(const MR_Vector2b *b, bool a)
MRC_API int MR_Vector2i_lengthSq(const MR_Vector2i *_this)
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 method MR::Vector2f::plusY.
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 MR_Vector2i64 MR_Vector2i64_plusY(void)
Generated from method MR::Vector2i64::plusY.
MRC_API MR_Vector2d MR_Vector2d_Construct_1(const MR_NoInit *_1)
MRC_API const int * MR_Vector2i64_Get_elements(void)
MRC_API MR_Vector2b MR_Vector2b_plusY(void)
Generated from method MR::Vector2b::plusY.
MRC_API MR_std_ostream * MR_print_MR_Vector2b(MR_std_ostream *s, const MR_Vector2b *vec)
MRC_API MR_Vector2i MR_mul_int_MR_Vector2i(int a, const MR_Vector2i *b)
MRC_API MR_std_istream * MR_input_MR_Vector2d(MR_std_istream *s, MR_Vector2d *vec)
MRC_API MR_Vector2f MR_Vector2f_Construct_2(float x, float y)
Generated from constructor MR::Vector2f::Vector2f.
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_1(const MR_NoInit *_1)
struct MR_Vector2d MR_Vector2d
MRC_API MR_std_ostream * MR_print_MR_Vector2i(MR_std_ostream *s, const MR_Vector2i *vec)
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 int * MR_Vector2i_index_const(const MR_Vector2i *_this, int e)
MRC_API const double * MR_Vector2d_index_const(const MR_Vector2d *_this, int e)
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 method MR::Vector2d::plusX.
MRC_API double MR_dot_double_MR_Vector2d(const MR_Vector2d *a, const MR_Vector2d *b)
MRC_API MR_std_istream * MR_input_MR_Vector2i64(MR_std_istream *s, MR_Vector2i64 *vec)
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 method MR::Vector2i64::plusX.
MRC_API MR_std_ostream * MR_print_MR_Vector2f(MR_std_ostream *s, const MR_Vector2f *vec)
MRC_API MR_std_istream * MR_input_MR_Vector2b(MR_std_istream *s, MR_Vector2b *vec)
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_int(const MR_Vector2i *b, int 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 float * MR_Vector2f_index(MR_Vector2f *_this, int e)
MRC_API MR_Vector2i64 MR_neg_MR_Vector2i64(const MR_Vector2i64 *a)
MRC_API MR_Vector2i MR_Vector2i_diagonal(int a)
Generated from method MR::Vector2i::diagonal.
MRC_API MR_Vector2i64 MR_Vector2i64_diagonal(MR_int64_t a)
Generated from method MR::Vector2i64::diagonal.
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/.
MRC_API MR_std_ostream * MR_print_MR_Vector2d(MR_std_ostream *s, const MR_Vector2d *vec)
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 method MR::Vector2b::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 method MR::Vector2i::minusX.
MRC_API MR_Vector2i MR_Vector2i_minusY(void)
Generated from method MR::Vector2i::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 const int * MR_Vector2b_Get_elements(void)
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 method MR::Vector2i64::minusY.
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 int MR_dot_bool_MR_Vector2b(const MR_Vector2b *a, const MR_Vector2b *b)
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)
struct MR_Vector2b MR_Vector2b
MRC_API MR_Vector2f MR_Vector2f_minusX(void)
Generated from method MR::Vector2f::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 int * MR_Vector2d_Get_elements(void)
int64_t MR_int64_t
Definition common.h:17
#define MRC_API
Definition exports.h:11
Definition MRVector2.h:21
bool y
Definition MRVector2.h:23
bool x
Definition MRVector2.h:22
Definition MRVector2.h:53
double y
Definition MRVector2.h:55
double x
Definition MRVector2.h:54
Definition MRVector2.h:45
float x
Definition MRVector2.h:46
float y
Definition MRVector2.h:47
Definition MRVector2.h:37
MR_int64_t x
Definition MRVector2.h:38
MR_int64_t y
Definition MRVector2.h:39
Definition MRVector2.h:29
int y
Definition MRVector2.h:31
int x
Definition MRVector2.h:30