@name Entity Ranger Test
@inputs 
@outputs [Box]:vector Traces:table
@persist Names:array
@trigger 
interval(500)
Traces=table()
O=owner()
if(first()){
    for(C=1,7){
        holoCreate(C,entity():pos(),vec(1,1,1)/2)
    }
    Names=array()
    Names:pushString("X")
    Names:pushString("-X")
    Names:pushString("Y")
    Names:pushString("-Y")
    Names:pushString("Z")
    Names:pushString("-Z")
    
}
Aim=O:aimEntity()
if(Aim){
    rangerIgnoreWorld(1)
    rangerPersist(1)
    Loc=Aim:massCenter()
    Box=Aim:boxSize()
    Boxes=array()
    Boxes:pushNumber(Box:x()/2)
    Boxes:pushNumber(Box:y()/2)
    Boxes:pushNumber(Box:z()/2)
    Dirvec=array()
    Dirvec:pushVector(Aim:forward())
    Dirvec:pushVector(-Aim:forward())
    Dirvec:pushVector(Aim:right())
    Dirvec:pushVector(-Aim:right())
    Dirvec:pushVector(Aim:up())
    Dirvec:pushVector(-Aim:up())
    #Rad=0+Aim:radius()
    holoPos(7,Loc)
    holoAng(7,Aim:angles())
    for(C=1,6){
        B=round(C/2)
        Traces[Names[C,string],number]=!rangerOffset(Loc,Loc+Boxes[B,number]*Dirvec[C,vector]):hit()
        if(Traces[Names[C,string],number]){
            holoPos(C,Loc+Boxes[B,number]*Dirvec[C,vector])
        }
    }
}else{
    for(C=1,7){
        holoPos(C,entity():pos())
    }
}
