Beispiel #1
0
func (r *Receiver) PanView(pos, delta glm.Vec2d) {
	theta := delta.Mul(r.Constants.PanSensitivity * r.Constants.Fov)

	turnV := glm.QuatRotated(theta[1], gtk.ToVec3D(r.UIState.TiltAxis))
	turnH := glm.QuatRotated(-theta[0], gtk.ToVec3D(r.UIState.PanAxis))

	r.UIState.Orientation = turnH.Mul(r.UIState.Orientation).Mul(turnV)
}
Beispiel #2
0
func (r *Receiver) PanView(pos, delta glm.Vec2d) {
	theta := delta.Mul(r.Constants.PlayerFOV * r.Constants.PlayerPanSensitivity)

	turnV := glm.QuatRotated(theta[1], gtk.ToVec3D(r.Player.TiltAxis))
	turnH := glm.QuatRotated(-theta[0], gtk.ToVec3D(r.Player.PanAxis))

	r.Player.OrientationH = turnH.Mul(r.Player.OrientationH)
	r.Player.Orientation = turnH.Mul(r.Player.Orientation).Mul(turnV)

	r.Invalid = true
}