Flip The View for CalcView

Hello,

I’m sorry to make such a short thread, but I’ll make this easy and quick. I set up a third person view with CalcView, but I was wondering if I can flip the view from a ‘back of the head’ to a ‘in front of the head’. To see the face basically. I have something set up like…



function sCalc( ply, origin, angles, fov )
	if not LocalPlayer().sDistz then
		LocalPlayer().sDistz=800
	end
	if LocalPlayer().sDistz<1 then LocalPlayer().sDistz=1 end
	if LocalPlayer().sDistz>1000 then LocalPlayer().sDistz=1000 end
	local shut=LocalPlayer():GetNetworkedEntity("Shuttle",LocalPlayer())
	if LocalPlayerIsDrivingShuttle and shut~=LocalPlayer() and shut:IsValid() then
		local view = {}
			view.origin = shut:GetPos()+ply:GetAimVector():GetNormal()*-LocalPlayer().sDistz
			view.angles = angles
			view.fov = fov

		return view
	end
end
hook.Add("CalcView", "MyCalcView", sCalc)


I’m not sure if it would be angles though, and how I would do it.



function MyCalcView(ply, pos, angles, fov)
    local view = {}
    view.origin = pos+(angles:Forward()*100)
    view.angles = -angles
    view.fov = fov
 
    return view
end

I tried that, it doesn’t change the angle.

yes it does

I mean I’m testing this right now, and it’s not.

[editline]5th February 2014[/editline]

Actually you know, I just realized I sent the example of CalcView than the one I’m using:



function sCalc( ply, origin, angles, fov )
	if not LocalPlayer().sDistz then
		LocalPlayer().sDistz=800
	end
	if LocalPlayer().sDistz<1 then LocalPlayer().sDistz=1 end
	if LocalPlayer().sDistz>1000 then LocalPlayer().sDistz=1000 end
	local shut=LocalPlayer():GetNetworkedEntity("Shuttle",LocalPlayer())
	if LocalPlayerIsDrivingShuttle and shut~=LocalPlayer() and shut:IsValid() then
		local view = {}
			view.origin = shut:GetPos()+ply:GetAimVector():GetNormal()*-LocalPlayer().sDistz
			view.angles = angles
			view.fov = fov

		return view
	end
end
hook.Add("CalcView", "MyCalcView", sCalc)


This comes straight from the Halo Vehicles back in garrysmod.org Although the problem I’m having is that the model is flipped backwards, so I’m trying to flip the view.