@name Angular Interp Test
@inputs [Prop Seat]:entity CamController:wirelink
@persist Pos:vector Ang:angle
@persist LastAng:angle
@outputs CamEnt:entity CamPos:vector
interval(100)

if(first()) {
    #include "mantle/main"
    #include "mantle/angle"
    #include "mantle/force"
}

if(changed(Prop)) {
    #Prop=propSpawn("models/hunter/plates/plate1x1.mdl",0)
    Prop:propGravity(0)
    Pos=entity():toWorld(vec(0,0,30))
    Ang=ang()
}
if(changed(CamController)) {
    CamController["Activated",number]=1
    CamController["Position",vector]=Seat:toWorld(vec(0,-30,50))
    CamController["Parent",entity]=Seat
}

if(Prop) {
    local Heading=CamController["CamAng",angle]:yaw()+90+curtime()*15
    local Ang=swivel(Prop:angles(),Ang*ang(1,0,1)+ang(0,Heading,0))
    Prop:rotate(Ang,3)
    Prop:move(Pos)
    LastAng=Ang
    Prop:propGravity(0)
}
