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>`.
14
15
18typedef struct MR_Vector2b
19{
20 bool x;
21 bool y;
23
26typedef struct MR_Vector2i
27{
28 int x;
29 int y;
31
39
42typedef struct MR_Vector2f
43{
44 float x;
45 float y;
47
50typedef struct MR_Vector2d
51{
52 double x;
53 double y;
55
59
62
67
71
74
77
80
83
87MRC_API const bool *MR_Vector2b_index_const(const MR_Vector2b *_this, int e);
88
93
97
101
106
111
112// 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.
117
121
126
131
135
139
142
148
154
159
164
168
171
176
180
183
186
189
192
195
198
202MRC_API const int *MR_Vector2i_index_const(const MR_Vector2i *_this, int e);
203
208
212
216
221
226
231
236
237// 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.
242
246
251
256
260
264
267
273
279
284
289
293
296
301
305
308
311
314
317
320
323
328
333
337
341
346
351
356
361
362// 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.
367
371
376
381
385
389
392
398
404
409
414
418
421
426
430
433
436
439
442
445
448
452MRC_API const float *MR_Vector2f_index_const(const MR_Vector2f *_this, int e);
453
458
462
466
470
475
480
484
489
494
495// 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.
500
504
509
514
518
522
525
531
537
542
547
551
554
559
563
566
569
572
575
578
581
585MRC_API const double *MR_Vector2d_index_const(const MR_Vector2d *_this, int e);
586
590MRC_API double *MR_Vector2d_index(MR_Vector2d *_this, int e);
591
595
599
603
608
613
617
622
627
628// 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.
633
637
642
647
651
655
658
664
670
675
680
685MRC_API float MR_cross(const MR_Vector2f *a, const MR_Vector2f *b);
686
692
698
704
710
716
717#ifdef __cplusplus
718} // extern "C"
719#endif
struct MR_NoInit MR_NoInit
Definition MRBox.h:15
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 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 a constructor of class MR::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 a method of class MR::Vector2f named 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 a constructor of class MR::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 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 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_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 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 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 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 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 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_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 a method of class MR::Vector2f named 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 a method of class MR::Vector2i64 named 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 a method of class MR::Vector2b named plusY.
MRC_API MR_Vector2i MR_mul_int_MR_Vector2i(int a, const MR_Vector2i *b)
MRC_API MR_Vector2f MR_Vector2f_Construct_2(float x, float y)
Generated from a constructor of class MR::Vector2f.
MRC_API MR_Vector2i64 MR_Vector2i64_Construct_1(const MR_NoInit *_1)
struct MR_Vector2d MR_Vector2d
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 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_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 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 a method of class MR::Vector2i named diagonal.
MRC_API MR_Vector2i64 MR_Vector2i64_diagonal(MR_int64_t a)
Generated from a method of class MR::Vector2i64 named 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/.
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 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 a method of class MR::Vector2i64 named 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 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 int * MR_Vector2d_Get_elements(void)
int64_t MR_int64_t
Definition common.h:13
#define MRC_API
Definition exports.h:11
Definition MRVector2.h:19
bool y
Definition MRVector2.h:21
bool x
Definition MRVector2.h:20
Definition MRVector2.h:51
double y
Definition MRVector2.h:53
double x
Definition MRVector2.h:52
Definition MRVector2.h:43
float x
Definition MRVector2.h:44
float y
Definition MRVector2.h:45
Definition MRVector2.h:35
MR_int64_t x
Definition MRVector2.h:36
MR_int64_t y
Definition MRVector2.h:37
Definition MRVector2.h:27
int y
Definition MRVector2.h:29
int x
Definition MRVector2.h:28