|
![](/i/fill.gif) |
For those who have written particle systems: I'm using trace() and a large
number of collisions are missed. How can I ensure that collisions are
detected?
Here's my collision handling macro:
#macro detect(X,Xold,V,T,elast,r)
#local N=<0,0,0>;
#local dir=X-Xold;
#local contact=trace(blockobj,X,dir+vnormalize(dir)*r,N);
#if(vlength(N)>0 & vlength(contact-X)<vlength(dir))
#declare
V=((V-vnormalize(N)*vdot(V,N))-vnormalize(N)*vdot(V,N))*elast;
#declare X=Xold;
#end
#end
Post a reply to this message
|
![](/i/fill.gif) |