MeshLib C Docs
Loading...
Searching...
No Matches
MRBall.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMesh/MRVector2.h>
4#include <MRCMesh/MRVector3.h>
5#include <MRCMisc/exports.h>
6
7#include <stdbool.h>
8#include <stddef.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14
17typedef struct MR_Ball1f MR_Ball1f;
18
21typedef struct MR_Ball1d MR_Ball1d;
22
25typedef struct MR_Ball2f MR_Ball2f;
26
29typedef struct MR_Ball2d MR_Ball2d;
30
33typedef struct MR_Ball3f MR_Ball3f;
34
37typedef struct MR_Ball3d MR_Ball3d;
38
42
47MRC_API const float *MR_Ball1f_Get_center(const MR_Ball1f *_this);
48
52MRC_API void MR_Ball1f_Set_center(MR_Ball1f *_this, float value);
53
59
64MRC_API const float *MR_Ball1f_Get_radiusSq(const MR_Ball1f *_this);
65
69MRC_API void MR_Ball1f_Set_radiusSq(MR_Ball1f *_this, float value);
70
76
80
85
88MRC_API MR_Ball1f *MR_Ball1f_ConstructFrom(float center, float radiusSq);
89
91MRC_API const MR_Ball1f *MR_Ball1f_OffsetPtr(const MR_Ball1f *ptr, ptrdiff_t i);
92
95
100
103
106
112
117MRC_API bool MR_Ball1f_inside(const MR_Ball1f *_this, const float *pt);
118
123MRC_API bool MR_Ball1f_outside(const MR_Ball1f *_this, const float *pt);
124
128
133MRC_API const double *MR_Ball1d_Get_center(const MR_Ball1d *_this);
134
138MRC_API void MR_Ball1d_Set_center(MR_Ball1d *_this, double value);
139
145
150MRC_API const double *MR_Ball1d_Get_radiusSq(const MR_Ball1d *_this);
151
155MRC_API void MR_Ball1d_Set_radiusSq(MR_Ball1d *_this, double value);
156
162
166
171
174MRC_API MR_Ball1d *MR_Ball1d_ConstructFrom(double center, double radiusSq);
175
177MRC_API const MR_Ball1d *MR_Ball1d_OffsetPtr(const MR_Ball1d *ptr, ptrdiff_t i);
178
181
186
189
192
198
203MRC_API bool MR_Ball1d_inside(const MR_Ball1d *_this, const double *pt);
204
209MRC_API bool MR_Ball1d_outside(const MR_Ball1d *_this, const double *pt);
210
214
220
225
231
236MRC_API const float *MR_Ball2f_Get_radiusSq(const MR_Ball2f *_this);
237
241MRC_API void MR_Ball2f_Set_radiusSq(MR_Ball2f *_this, float value);
242
248
252
257
261
263MRC_API const MR_Ball2f *MR_Ball2f_OffsetPtr(const MR_Ball2f *ptr, ptrdiff_t i);
264
267
272
275
278
284
289MRC_API bool MR_Ball2f_inside(const MR_Ball2f *_this, const MR_Vector2f *pt);
290
295MRC_API bool MR_Ball2f_outside(const MR_Ball2f *_this, const MR_Vector2f *pt);
296
300
306
311
317
322MRC_API const double *MR_Ball2d_Get_radiusSq(const MR_Ball2d *_this);
323
327MRC_API void MR_Ball2d_Set_radiusSq(MR_Ball2d *_this, double value);
328
334
338
343
347
349MRC_API const MR_Ball2d *MR_Ball2d_OffsetPtr(const MR_Ball2d *ptr, ptrdiff_t i);
350
353
358
361
364
370
375MRC_API bool MR_Ball2d_inside(const MR_Ball2d *_this, const MR_Vector2d *pt);
376
381MRC_API bool MR_Ball2d_outside(const MR_Ball2d *_this, const MR_Vector2d *pt);
382
386
392
397
403
408MRC_API const float *MR_Ball3f_Get_radiusSq(const MR_Ball3f *_this);
409
413MRC_API void MR_Ball3f_Set_radiusSq(MR_Ball3f *_this, float value);
414
420
424
429
433
435MRC_API const MR_Ball3f *MR_Ball3f_OffsetPtr(const MR_Ball3f *ptr, ptrdiff_t i);
436
439
444
447
450
456
461MRC_API bool MR_Ball3f_inside(const MR_Ball3f *_this, const MR_Vector3f *pt);
462
467MRC_API bool MR_Ball3f_outside(const MR_Ball3f *_this, const MR_Vector3f *pt);
468
472
478
483
489
494MRC_API const double *MR_Ball3d_Get_radiusSq(const MR_Ball3d *_this);
495
499MRC_API void MR_Ball3d_Set_radiusSq(MR_Ball3d *_this, double value);
500
506
510
515
519
521MRC_API const MR_Ball3d *MR_Ball3d_OffsetPtr(const MR_Ball3d *ptr, ptrdiff_t i);
522
525
530
533
536
542
547MRC_API bool MR_Ball3d_inside(const MR_Ball3d *_this, const MR_Vector3d *pt);
548
553MRC_API bool MR_Ball3d_outside(const MR_Ball3d *_this, const MR_Vector3d *pt);
554
555#ifdef __cplusplus
556} // extern "C"
557#endif
MRC_API const MR_Ball1d * MR_Ball1d_OffsetPtr(const MR_Ball1d *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API const int * MR_Ball3d_Get_elements(void)
MRC_API const MR_Ball3f * MR_Ball3f_OffsetPtr(const MR_Ball3f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Ball3f * MR_Ball3f_ConstructFromAnother(const MR_Ball3f *_other)
MRC_API MR_Ball2f * MR_Ball2f_ConstructFromAnother(const MR_Ball2f *_other)
MRC_API const int * MR_Ball2d_Get_elements(void)
MRC_API void MR_Ball2f_Set_center(MR_Ball2f *_this, MR_Vector2f value)
MRC_API MR_Ball2d * MR_Ball2d_DefaultConstructArray(size_t num_elems)
MRC_API void MR_Ball3f_Set_center(MR_Ball3f *_this, MR_Vector3f value)
MRC_API const MR_Ball2d * MR_Ball2d_OffsetPtr(const MR_Ball2d *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Ball1d * MR_Ball1d_DefaultConstruct(void)
MRC_API MR_Ball1f * MR_Ball1f_OffsetMutablePtr(MR_Ball1f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Ball2d * MR_Ball2d_AssignFromAnother(MR_Ball2d *_this, const MR_Ball2d *_other)
MRC_API bool MR_Ball1d_outside(const MR_Ball1d *_this, const double *pt)
MRC_API void MR_Ball2d_Destroy(const MR_Ball2d *_this)
Destroys a heap-allocated instance of MR_Ball2d. Does nothing if the pointer is null.
MRC_API bool MR_Ball3f_outside(const MR_Ball3f *_this, const MR_Vector3f *pt)
MRC_API MR_Ball3d * MR_Ball3d_AssignFromAnother(MR_Ball3d *_this, const MR_Ball3d *_other)
MRC_API const int * MR_Ball1f_Get_elements(void)
MRC_API MR_Ball1f * MR_Ball1f_DefaultConstruct(void)
MRC_API double * MR_Ball2d_GetMutable_radiusSq(MR_Ball2d *_this)
struct MR_Ball2d MR_Ball2d
Definition MRBall.h:29
MRC_API MR_Ball3f * MR_Ball3f_DefaultConstruct(void)
MRC_API const int * MR_Ball3f_Get_elements(void)
MRC_API void MR_Ball1f_Set_radiusSq(MR_Ball1f *_this, float value)
MRC_API MR_Ball2d * MR_Ball2d_ConstructFrom(MR_Vector2d center, double radiusSq)
MRC_API const int * MR_Ball2f_Get_elements(void)
MRC_API const int * MR_Ball1d_Get_elements(void)
MRC_API void MR_Ball1d_DestroyArray(const MR_Ball1d *_this)
Destroys a heap-allocated array of MR_Ball1d. Does nothing if the pointer is null.
MRC_API const float * MR_Ball2f_Get_radiusSq(const MR_Ball2f *_this)
MRC_API float * MR_Ball1f_GetMutable_radiusSq(MR_Ball1f *_this)
MRC_API const MR_Vector3f * MR_Ball3f_Get_center(const MR_Ball3f *_this)
MRC_API MR_Ball1d * MR_Ball1d_OffsetMutablePtr(MR_Ball1d *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
struct MR_Ball3d MR_Ball3d
Definition MRBall.h:37
MRC_API MR_Ball3f * MR_Ball3f_DefaultConstructArray(size_t num_elems)
MRC_API void MR_Ball2f_Set_radiusSq(MR_Ball2f *_this, float value)
MRC_API void MR_Ball1f_DestroyArray(const MR_Ball1f *_this)
Destroys a heap-allocated array of MR_Ball1f. Does nothing if the pointer is null.
MRC_API MR_Ball3f * MR_Ball3f_ConstructFrom(MR_Vector3f center, float radiusSq)
MRC_API void MR_Ball2d_DestroyArray(const MR_Ball2d *_this)
Destroys a heap-allocated array of MR_Ball2d. Does nothing if the pointer is null.
MRC_API MR_Ball3d * MR_Ball3d_ConstructFrom(MR_Vector3d center, double radiusSq)
MRC_API void MR_Ball1f_Destroy(const MR_Ball1f *_this)
Destroys a heap-allocated instance of MR_Ball1f. Does nothing if the pointer is null.
MRC_API MR_Ball1f * MR_Ball1f_DefaultConstructArray(size_t num_elems)
MRC_API bool MR_Ball1f_inside(const MR_Ball1f *_this, const float *pt)
MRC_API MR_Ball2f * MR_Ball2f_DefaultConstructArray(size_t num_elems)
MRC_API MR_Ball2d * MR_Ball2d_DefaultConstruct(void)
MRC_API MR_Ball2f * MR_Ball2f_OffsetMutablePtr(MR_Ball2f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
struct MR_Ball1d MR_Ball1d
Definition MRBall.h:21
MRC_API float * MR_Ball2f_GetMutable_radiusSq(MR_Ball2f *_this)
MRC_API bool MR_Ball2d_inside(const MR_Ball2d *_this, const MR_Vector2d *pt)
MRC_API double * MR_Ball1d_GetMutable_radiusSq(MR_Ball1d *_this)
MRC_API MR_Ball3d * MR_Ball3d_DefaultConstructArray(size_t num_elems)
MRC_API MR_Ball1d * MR_Ball1d_AssignFromAnother(MR_Ball1d *_this, const MR_Ball1d *_other)
MRC_API MR_Ball1d * MR_Ball1d_ConstructFrom(double center, double radiusSq)
struct MR_Ball3f MR_Ball3f
Definition MRBall.h:33
MRC_API MR_Vector2d * MR_Ball2d_GetMutable_center(MR_Ball2d *_this)
MRC_API MR_Ball2d * MR_Ball2d_ConstructFromAnother(const MR_Ball2d *_other)
MRC_API void MR_Ball1d_Set_radiusSq(MR_Ball1d *_this, double value)
MRC_API void MR_Ball2f_Destroy(const MR_Ball2f *_this)
Destroys a heap-allocated instance of MR_Ball2f. Does nothing if the pointer is null.
MRC_API const float * MR_Ball3f_Get_radiusSq(const MR_Ball3f *_this)
MRC_API const float * MR_Ball1f_Get_radiusSq(const MR_Ball1f *_this)
MRC_API bool MR_Ball1d_inside(const MR_Ball1d *_this, const double *pt)
MRC_API void MR_Ball2d_Set_radiusSq(MR_Ball2d *_this, double value)
MRC_API float * MR_Ball3f_GetMutable_radiusSq(MR_Ball3f *_this)
MRC_API void MR_Ball1f_Set_center(MR_Ball1f *_this, float value)
MRC_API void MR_Ball3f_DestroyArray(const MR_Ball3f *_this)
Destroys a heap-allocated array of MR_Ball3f. Does nothing if the pointer is null.
MRC_API MR_Ball1f * MR_Ball1f_ConstructFromAnother(const MR_Ball1f *_other)
MRC_API MR_Vector3d * MR_Ball3d_GetMutable_center(MR_Ball3d *_this)
MRC_API void MR_Ball3f_Destroy(const MR_Ball3f *_this)
Destroys a heap-allocated instance of MR_Ball3f. Does nothing if the pointer is null.
MRC_API void MR_Ball3d_Destroy(const MR_Ball3d *_this)
Destroys a heap-allocated instance of MR_Ball3d. Does nothing if the pointer is null.
MRC_API MR_Ball2d * MR_Ball2d_OffsetMutablePtr(MR_Ball2d *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_Ball3d_Set_center(MR_Ball3d *_this, MR_Vector3d value)
MRC_API float * MR_Ball1f_GetMutable_center(MR_Ball1f *_this)
MRC_API void MR_Ball2f_DestroyArray(const MR_Ball2f *_this)
Destroys a heap-allocated array of MR_Ball2f. Does nothing if the pointer is null.
MRC_API void MR_Ball3f_Set_radiusSq(MR_Ball3f *_this, float value)
MRC_API const double * MR_Ball3d_Get_radiusSq(const MR_Ball3d *_this)
MRC_API bool MR_Ball3d_inside(const MR_Ball3d *_this, const MR_Vector3d *pt)
MRC_API MR_Ball3f * MR_Ball3f_AssignFromAnother(MR_Ball3f *_this, const MR_Ball3f *_other)
MRC_API MR_Ball2f * MR_Ball2f_AssignFromAnother(MR_Ball2f *_this, const MR_Ball2f *_other)
MRC_API MR_Ball3d * MR_Ball3d_DefaultConstruct(void)
MRC_API MR_Ball2f * MR_Ball2f_ConstructFrom(MR_Vector2f center, float radiusSq)
MRC_API const MR_Ball2f * MR_Ball2f_OffsetPtr(const MR_Ball2f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API MR_Ball2f * MR_Ball2f_DefaultConstruct(void)
MRC_API MR_Ball1d * MR_Ball1d_ConstructFromAnother(const MR_Ball1d *_other)
MRC_API const double * MR_Ball1d_Get_center(const MR_Ball1d *_this)
MRC_API MR_Ball1f * MR_Ball1f_AssignFromAnother(MR_Ball1f *_this, const MR_Ball1f *_other)
MRC_API double * MR_Ball1d_GetMutable_center(MR_Ball1d *_this)
MRC_API const MR_Ball3d * MR_Ball3d_OffsetPtr(const MR_Ball3d *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
struct MR_Ball2f MR_Ball2f
Definition MRBall.h:25
MRC_API bool MR_Ball2d_outside(const MR_Ball2d *_this, const MR_Vector2d *pt)
MRC_API MR_Ball1f * MR_Ball1f_ConstructFrom(float center, float radiusSq)
MRC_API MR_Vector3f * MR_Ball3f_GetMutable_center(MR_Ball3f *_this)
MRC_API const MR_Vector2d * MR_Ball2d_Get_center(const MR_Ball2d *_this)
MRC_API MR_Ball1d * MR_Ball1d_DefaultConstructArray(size_t num_elems)
MRC_API const float * MR_Ball1f_Get_center(const MR_Ball1f *_this)
MRC_API const MR_Vector3d * MR_Ball3d_Get_center(const MR_Ball3d *_this)
MRC_API bool MR_Ball3d_outside(const MR_Ball3d *_this, const MR_Vector3d *pt)
MRC_API MR_Ball3d * MR_Ball3d_ConstructFromAnother(const MR_Ball3d *_other)
MRC_API void MR_Ball1d_Destroy(const MR_Ball1d *_this)
Destroys a heap-allocated instance of MR_Ball1d. Does nothing if the pointer is null.
MRC_API MR_Ball3f * MR_Ball3f_OffsetMutablePtr(MR_Ball3f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API bool MR_Ball2f_outside(const MR_Ball2f *_this, const MR_Vector2f *pt)
MRC_API const MR_Vector2f * MR_Ball2f_Get_center(const MR_Ball2f *_this)
MRC_API bool MR_Ball2f_inside(const MR_Ball2f *_this, const MR_Vector2f *pt)
MRC_API const double * MR_Ball1d_Get_radiusSq(const MR_Ball1d *_this)
MRC_API void MR_Ball2d_Set_center(MR_Ball2d *_this, MR_Vector2d value)
struct MR_Ball1f MR_Ball1f
Definition MRBall.h:17
MRC_API MR_Ball3d * MR_Ball3d_OffsetMutablePtr(MR_Ball3d *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API void MR_Ball3d_Set_radiusSq(MR_Ball3d *_this, double value)
MRC_API const double * MR_Ball2d_Get_radiusSq(const MR_Ball2d *_this)
MRC_API void MR_Ball3d_DestroyArray(const MR_Ball3d *_this)
Destroys a heap-allocated array of MR_Ball3d. Does nothing if the pointer is null.
MRC_API bool MR_Ball3f_inside(const MR_Ball3f *_this, const MR_Vector3f *pt)
MRC_API double * MR_Ball3d_GetMutable_radiusSq(MR_Ball3d *_this)
MRC_API void MR_Ball1d_Set_center(MR_Ball1d *_this, double value)
MRC_API MR_Vector2f * MR_Ball2f_GetMutable_center(MR_Ball2f *_this)
MRC_API const MR_Ball1f * MR_Ball1f_OffsetPtr(const MR_Ball1f *ptr, ptrdiff_t i)
Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the...
MRC_API bool MR_Ball1f_outside(const MR_Ball1f *_this, const float *pt)
#define MRC_API
Definition exports.h:11
Definition MRVector2.h:51
Definition MRVector2.h:43
Definition MRVector3.h:59
Definition MRVector3.h:50