Inside a mesh

Blitz3D Forums/Blitz3D Programming/Inside a mesh

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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.