MeshLib C Docs
Loading...
Searching...
No Matches
MRMeshCollide.h File Reference
#include <MRCMesh/MRId.h>
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stdbool.h>

Go to the source code of this file.

Typedefs

typedef struct MR_AffineXf3f MR_AffineXf3f
 
typedef struct MR_Face2RegionMap MR_Face2RegionMap
 
typedef struct MR_Mesh MR_Mesh
 
typedef struct MR_MeshPart MR_MeshPart
 
typedef struct MR_expected_MR_FaceBitSet_std_string MR_expected_MR_FaceBitSet_std_string
 
typedef struct MR_expected_bool_std_string MR_expected_bool_std_string
 
typedef struct MR_expected_std_vector_MR_FaceFace_std_string MR_expected_std_vector_MR_FaceFace_std_string
 
typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float
 
typedef struct MR_std_pair_MR_FaceBitSet_MR_FaceBitSet MR_std_pair_MR_FaceBitSet_MR_FaceBitSet
 
typedef struct MR_std_vector_MR_FaceFace MR_std_vector_MR_FaceFace
 

Functions

MRC_API MR_std_vector_MR_FaceFaceMR_findCollidingTriangles (const MR_MeshPart *a, const MR_MeshPart *b, const MR_AffineXf3f *rigidB2A, const bool *firstIntersectionOnly)
 finds all pairs of colliding triangles from two meshes or two mesh regions
 
MRC_API MR_std_pair_MR_FaceBitSet_MR_FaceBitSetMR_findCollidingTriangleBitsets (const MR_MeshPart *a, const MR_MeshPart *b, const MR_AffineXf3f *rigidB2A)
 
MRC_API MR_expected_bool_std_stringMR_findSelfCollidingTriangles_5 (const MR_MeshPart *mp, MR_std_vector_MR_FaceFace *outCollidingPairs, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb, const MR_Face2RegionMap *regionMap, const bool *touchIsIntersection)
 
MRC_API MR_expected_std_vector_MR_FaceFace_std_stringMR_findSelfCollidingTriangles_4 (const MR_MeshPart *mp, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb, const MR_Face2RegionMap *regionMap, const bool *touchIsIntersection)
 
MRC_API MR_expected_MR_FaceBitSet_std_stringMR_findSelfCollidingTrianglesBS (const MR_MeshPart *mp, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb, const MR_Face2RegionMap *regionMap, const bool *touchIsIntersection)
 
MRC_API bool MR_isInside_MR_MeshPart (const MR_MeshPart *a, const MR_MeshPart *b, const MR_AffineXf3f *rigidB2A)
 checks that arbitrary mesh part A is inside of closed mesh part B
 
MRC_API bool MR_isNonIntersectingInside_3 (const MR_MeshPart *a, const MR_MeshPart *b, const MR_AffineXf3f *rigidB2A)
 checks that arbitrary mesh part A is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide
 
MRC_API bool MR_isNonIntersectingInside_4 (const MR_Mesh *a, MR_FaceId partFace, const MR_MeshPart *b, const MR_AffineXf3f *rigidB2A)
 checks that arbitrary mesh A part (whole part is represented by one face partFace) is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide
 

Typedef Documentation

◆ MR_AffineXf3f

typedef struct MR_AffineXf3f MR_AffineXf3f

◆ MR_expected_bool_std_string

◆ MR_expected_MR_FaceBitSet_std_string

◆ MR_expected_std_vector_MR_FaceFace_std_string

◆ MR_Face2RegionMap

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

◆ MR_MeshPart

typedef struct MR_MeshPart MR_MeshPart

◆ MR_std_function_bool_from_float

◆ MR_std_pair_MR_FaceBitSet_MR_FaceBitSet

◆ MR_std_vector_MR_FaceFace

Function Documentation

◆ MR_findCollidingTriangleBitsets()

MRC_API MR_std_pair_MR_FaceBitSet_MR_FaceBitSet * MR_findCollidingTriangleBitsets ( const MR_MeshPart * a,
const MR_MeshPart * b,
const MR_AffineXf3f * rigidB2A )

the same as findCollidingTriangles, but returns one bite set per mesh with colliding triangles Generated from function MR::findCollidingTriangleBitsets. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter rigidB2A defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_std_pair_MR_FaceBitSet_MR_FaceBitSet_Destroy() to free it when you're done using it.

◆ MR_findCollidingTriangles()

MRC_API MR_std_vector_MR_FaceFace * MR_findCollidingTriangles ( const MR_MeshPart * a,
const MR_MeshPart * b,
const MR_AffineXf3f * rigidB2A,
const bool * firstIntersectionOnly )

finds all pairs of colliding triangles from two meshes or two mesh regions

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation
firstIntersectionOnlyif true then the function returns at most one pair of intersecting triangles and returns faster Generated from function MR::findCollidingTriangles. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter rigidB2A defaults to a null pointer in C++. Parameter firstIntersectionOnly has a default argument: false, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_std_vector_MR_FaceFace_Destroy() to free it when you're done using it.

◆ MR_findSelfCollidingTriangles_4()

MRC_API MR_expected_std_vector_MR_FaceFace_std_string * MR_findSelfCollidingTriangles_4 ( const MR_MeshPart * mp,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb,
const MR_Face2RegionMap * regionMap,
const bool * touchIsIntersection )

finds all pairs of colliding triangles from one mesh or a region Generated from function MR::findSelfCollidingTriangles. Parameter mp can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Parameter regionMap defaults to a null pointer in C++. Parameter touchIsIntersection has a default argument: false, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_std_vector_MR_FaceFace_std_string_Destroy() to free it when you're done using it.

◆ MR_findSelfCollidingTriangles_5()

MRC_API MR_expected_bool_std_string * MR_findSelfCollidingTriangles_5 ( const MR_MeshPart * mp,
MR_std_vector_MR_FaceFace * outCollidingPairs,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb,
const MR_Face2RegionMap * regionMap,
const bool * touchIsIntersection )

finds all pairs (or the fact of any self-collision) of colliding triangles from one mesh or a region Generated from function MR::findSelfCollidingTriangles. Parameter mp can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Parameter regionMap defaults to a null pointer in C++. Parameter touchIsIntersection has a default argument: false, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_bool_std_string_Destroy() to free it when you're done using it.

◆ MR_findSelfCollidingTrianglesBS()

MRC_API MR_expected_MR_FaceBitSet_std_string * MR_findSelfCollidingTrianglesBS ( const MR_MeshPart * mp,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb,
const MR_Face2RegionMap * regionMap,
const bool * touchIsIntersection )

the same findSelfCollidingTriangles but returns the union of all self-intersecting faces Generated from function MR::findSelfCollidingTrianglesBS. Parameter mp can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Parameter regionMap defaults to a null pointer in C++. Parameter touchIsIntersection has a default argument: false, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_expected_MR_FaceBitSet_std_string_Destroy() to free it when you're done using it.

◆ MR_isInside_MR_MeshPart()

MRC_API bool MR_isInside_MR_MeshPart ( const MR_MeshPart * a,
const MR_MeshPart * b,
const MR_AffineXf3f * rigidB2A )

checks that arbitrary mesh part A is inside of closed mesh part B

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation Generated from function MR::isInside. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter rigidB2A defaults to a null pointer in C++.

◆ MR_isNonIntersectingInside_3()

MRC_API bool MR_isNonIntersectingInside_3 ( const MR_MeshPart * a,
const MR_MeshPart * b,
const MR_AffineXf3f * rigidB2A )

checks that arbitrary mesh part A is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation Generated from function MR::isNonIntersectingInside. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter rigidB2A defaults to a null pointer in C++.

◆ MR_isNonIntersectingInside_4()

MRC_API bool MR_isNonIntersectingInside_4 ( const MR_Mesh * a,
MR_FaceId partFace,
const MR_MeshPart * b,
const MR_AffineXf3f * rigidB2A )

checks that arbitrary mesh A part (whole part is represented by one face partFace) is inside of closed mesh part B The version of isInside without collision check; it is user's responsibility to guarantee that the meshes don't collide

Parameters
rigidB2Arigid transformation from B-mesh space to A mesh space, nullptr considered as identity transformation Generated from function MR::isNonIntersectingInside. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Parameter rigidB2A defaults to a null pointer in C++.