/* Target - DMS - May 98 - by Sylvain HUET */ /* Target - DMS2 - May 99 - by Patrice FAVRE */ typeof class=S;; fun targvobj2(x, v) = match x with (objAnchor [h _ _ _] -> let M3calcPosRef session h shell -> [src _] in let M3calcPosRef session cam shell -> [dst _] in let M3angularTarget src dst -> [an _ _] in let M3getObjAng session h -> [_ b c] in M3setObjAng session h [an b c]) |(_->nil) ;; fun targvobj(o) = apply_on_list ObAnchor o @targvobj2 nil; 0 ;; fun targobj2(x, v) = match x with (objAnchor [h _ _ _] -> let M3calcPosRef session h shell -> [src _] in let M3calcPosRef session cam shell -> [dst _] in let M3angularTarget src dst -> [an bn _] in let M3getObjAng session h -> [_ _ c] in M3setObjAng session h [an bn c]) |(_->nil) ;; fun targobj(o)= apply_on_list ObAnchor o @targobj2 nil; 0 ;; fun delete(o,paramU) = ObCbAnim o nil; let paramU -> [ax ay az] in match hd (ObAnchor o) with (objAnchor [h _ _ _] -> M3setObjAng session h [ax ay az]) |(_->nil) ;; fun newOb(o) = let hd UgetParam ObUi o "axis" -> a in if a!=nil && !strcmpi a "V" then ObCbAnim o @targvobj else ObCbAnim o @targobj; let match hd (ObAnchor o) with (objAnchor [h _ _ _] -> M3getObjAng session h ) |(_->nil) -> [ax ay az] in ObCbDestroy o mkfun2 @delete [ax ay az]; 0 ;; fun IniPlug(file) = set class=getInfo strextr _getpack _checkpack file "name"; PLUGsetinfo thisplug PLUGIN_ONLINE_EDITING|PLUGIN_OBJECT; PLUGdefineEditor thisplug @dynamicedit; PlugRegister class @newOb nil; 0 ;;