@name Orbit
@outputs Count Run Radius
@persist Props:array V:vector
@model models/props_junk/PopCan01a.mdl
        runOnTick(1)
        if (Run) {
            
        Chip=entity()
        Owner=owner()
        if (findCanQuery()) {
        findIncludePlayerProps(Owner)
        findByClass("prop_physics") 
        Props=findToArray() 
        Count=Props:count() 
        }
        if (tickClk()) {
      
        Cur=curtime()
        Radius=max(Count*50/pi()/2,200) 
      
        Pos=owner():pos()
        Orbit1=vec(Radius/3,5,100):rotate(0,Cur*100,0) #A planet orbitting the sun
        Index=0
        while (Index<Count) {
        Index++,TE=Props:entity(Index) 
        Orbit2=vec(Radius,0,10):rotate(0,-(360/Count*Index + Cur*10),0) 
        TE:applyForce(((Pos+Orbit1+Orbit2-TE:massCenter())*10-TE:vel())*TE:mass()) 
        TE:setColor(hsv2rgb((curtime()*10)%360,1,1))
        TE:setMaterial("debug/debugdrawflat")
      
        }
        if ($Count>0) {timer("trail",2000)} 
        if (clk("trail")) {
        Index=0
        while (Index<Count) {
        Index++
        Props:entity(Index):setTrails(10,0,10,"cable/physbeam",vec(1,1,1)*255,255)
        }
        }  }
        }
        Run=(minquota()>100) 
       


