From 70bdc77833ff8c16eca255822118811095221e18 Mon Sep 17 00:00:00 2001 From: yomboprime Date: Fri, 25 Dec 2015 12:44:38 +0100 Subject: [PATCH] Soft volumes with CreateFromTriMesh and demo --- ammo.idl | 4 +- .../webgl_demo_softbody_volume/index.html | 513 ++++++++++++++++++ 2 files changed, 516 insertions(+), 1 deletion(-) create mode 100644 examples/webgl_demo_softbody_volume/index.html diff --git a/ammo.idl b/ammo.idl index 0a555942e..be1e1859d 100644 --- a/ammo.idl +++ b/ammo.idl @@ -812,6 +812,8 @@ interface btSoftBodyHelpers { btSoftBody CreateRope([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 from, [Const, Ref] btVector3 to, long res, long fixeds); btSoftBody CreatePatch([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 corner00, [Const, Ref] btVector3 corner10, [Const, Ref] btVector3 corner01, [Const, Ref] btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags); - //btSoftBody CreatePatchUV([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 corner00, [Const, Ref] btVector3 corner10, [Const, Ref] btVector3 corner01, [Const, Ref] btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags, float* tex_coords); + btSoftBody CreatePatchUV([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 corner00, [Const, Ref] btVector3 corner10, [Const, Ref] btVector3 corner01, [Const, Ref] btVector3 corner11, long resx, long resy, long fixeds, boolean gendiags, float[] tex_coords); btSoftBody CreateEllipsoid([Ref] btSoftBodyWorldInfo worldInfo, [Const, Ref] btVector3 center, [Const, Ref] btVector3 radius, long res); + btSoftBody CreateFromTriMesh([Ref] btSoftBodyWorldInfo worldInfo, float[] vertices, long[] triangles, long ntriangles, boolean randomizeConstraints); + btSoftBody CreateFromConvexHull([Ref] btSoftBodyWorldInfo worldInfo, [Const] btVector3 vertices, long nvertices, boolean randomizeConstraints); }; diff --git a/examples/webgl_demo_softbody_volume/index.html b/examples/webgl_demo_softbody_volume/index.html new file mode 100644 index 000000000..5ed86975b --- /dev/null +++ b/examples/webgl_demo_softbody_volume/index.html @@ -0,0 +1,513 @@ + + + Ammo.js softbody volume demo + + + + + +
Ammo.js soft body volume demo
Click to throw a ball
+





Loading...
+ + + + + + + + + + +