MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / EMSCRIPTEN_BINDINGS

Function EMSCRIPTEN_BINDINGS

source/MRWasmModule/MRWasmMeshMeshDistance.cpp:15–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using namespace MR;
14
15EMSCRIPTEN_BINDINGS( meshlib_mesh_mesh_distance )
16{
17 emscripten::function( "findDistance", +[]( std::shared_ptr<Mesh> a, std::shared_ptr<Mesh> b )
18 {
19 const MeshMeshDistanceResult r = findDistance( *a, *b );
20
21 emscripten::val va = emscripten::val::object();
22 va.set( "face", (int)r.a.face );
23 va.set( "point", r.a.point );
24 emscripten::val vb = emscripten::val::object();
25 vb.set( "face", (int)r.b.face );
26 vb.set( "point", r.b.point );
27
28 emscripten::val out = emscripten::val::object();
29 out.set( "a", va );
30 out.set( "b", vb );
31 out.set( "distSq", r.distSq );
32 return out;
33 } );
34}

Callers

nothing calls this directly

Calls 2

findDistanceFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected