/* librairie de gestion de boite inbox - sept.97 - par Sylvain Huet */ /* inboxes collisions */ struct InBox= [nameIB:S,sIB:SBox,curboxIB:Box,rayonIB:I,gravityIB:I] mkInBox;; /* inbox system loading */ fun inboxLoading(c)= let _getpack _checkpack c.nameIB -> file in if file==nil then nil else (set c.sIB=MBOXcreate _channel 200 600; set c.curboxIB=nil; if MBOXload c.sIB file then (MBOXdestroy c.sIB; nil) else c);; /* inbox system closing */ fun inboxClosing(c)= MBOXdestroy c.sIB;; /* inbox system placing */ fun inboxPlacing(ib,s,h)= set ib.curboxIB= let MBOXprojection ib.sIB (M3getObjVec s h) ib.rayonIB -> [b x] in (M3setObjVec s h x; b);; /* inbox system replacing */ fun inboxReplacing(ib,s,h)= M3movObjExt s h [0 (-ib.gravityIB) 0]; let MBOXmove ib.sIB ib.curboxIB (M3getObjVec s h) ib.rayonIB -> [b v] in (set ib.curboxIB=b; M3setObjVec s h v);; /* inbox system testing */ fun inboxTesting(ib,s,h,v)= let M3getObjVec s h ->oldv in (M3movObj s h v; let MBOXmove ib.sIB ib.curboxIB (M3getObjVec s h) ib.rayonIB -> [b w] in (M3setObjVec s h oldv; [b w]));;