Inside a mesh

Blitz3D Forums/Blitz3D Programming/Inside a mesh

Neochrome(Posted 2004) [#1]
is there anyway way to tell if a smaller mesh is inside a bigger mesh? as if a box is inside water?


jfk EO-11110(Posted 2004) [#2]
Maybe there is an easier way, but i would do this:

if meshesintersect(innermesh,outtermesh)=0 ; could be inside
 EntityFX outtermesh,16
 p1=linepick(entityx(innermesh),entityy(innermesh), entityz(innermesh),meshwidth(outtermesh),0,0,0)
 p2=linepick(entityx(innermesh),entityy(innermesh),entityz(innermesh),-meshwidth(outtermesh),0,0,0)
 if (p1=p2) and (p1=outtermesh)
 print "innermesh is inside"
endif


But to check, if a box in inside an other box yo should probably use something faster. You can store the min and max xyz world coordinates (using VertexX and Tformpoint etc.) of both boxes and then compare them this way, that's much faster.