Rotate prop

How to rotate props like physgun do so it doesn’t go through walls?
[lua]
phys:AddAngleVelocity(ent:GetForward() - self.Owner:GetAimVector())
[/lua]
Don’t work very well.

I’ve tried
[lua]
local phys = ent:GetPhysicsObject()
local Ang = Angle(0,90,0)

local AngleVector = ent:GetAngles():Forward() + ent:GetAngles():Right() + ent:GetAngles():Up()
local AngleTo = Ang:Forward() + Ang:Right() + Ang:Up()
local Dir = AngleVector-AngleTo

phys:AddAngleVelocity(Dir)
[/lua]
But it rotates prop somewhere random.