From 0a60bc14d63c898eef534fb5cdb7dc834fc74d90 Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Sat, 9 Apr 2011 23:19:11 +0000 Subject: =cloth collisions= Plugged the eltopo library into the cloth solver. I was playing with it earlier, and it's so easy to use I decided to quickly put it in (trunk's) cloth. See http://www.cs.ubc.ca/labs/imager/tr/2009/eltopo/eltopo.html . The authors are on the bleeding edge of continuous collision detection (one of them did ILM's cloth sim). I don't really have to time to plug it into softbody, particles, bullet, fluid, etc, but doing so would be pretty straightforward. I'll leave that up to someone else. To use, turn on USE_ELTOPO (in cmake) or WITH_BF_ELTOPO in scons. --- source/blender/blenkernel/BKE_collision.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_collision.h') diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h index b54d4275719..7018a638831 100644 --- a/source/blender/blenkernel/BKE_collision.h +++ b/source/blender/blenkernel/BKE_collision.h @@ -63,7 +63,11 @@ struct LinkNode; /* COLLISION FLAGS */ typedef enum { - COLLISION_IN_FUTURE = ( 1 << 1 ), + COLLISION_IN_FUTURE = (1 << 1), +#ifdef USE_ELTOPO + COLLISION_USE_COLLFACE = (1 << 2), + COLLISION_IS_EDGES = (1 << 3), +#endif } COLLISION_FLAGS; @@ -81,7 +85,13 @@ typedef struct CollPair float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 int flag; float time; // collision time, from 0 up to 1 +#ifdef USE_ELTOPO /*either ap* or bp* can be set, but not both*/ + float bary[3]; + int ap1, ap2, ap3, collp, bp1, bp2, bp3; + int collface; +#else int ap1, ap2, ap3, bp1, bp2, bp3; +#endif int pointsb[4]; } CollPair; @@ -109,6 +119,7 @@ typedef struct FaceCollPair float pa[3], pb[3]; // collision point p1 on face1, p2 on face2 } FaceCollPair; + //////////////////////////////////////// -- cgit v1.2.3