Esempio n. 1
0
func NewTransform() Transform {
	return Transform{
		Position:      math3d.Vector{0, 0, 0},
		Scale:         math3d.Vector{1, 1, 1},
		Speed:         math3d.Vector{1, 1, 1},
		Rotation:      math3d.NewQuaternion(),
		RotationSpeed: math3d.Vector{45, 45, 45},

		// Default to +Y as the Up dir
		FixedUp:          true,
		FixedUpDirection: math3d.Vector{0, 1, 0},
	}
}
func Test_LookAt_DoesNothingIfLookAtIsPosition(t *testing.T) {
	transform := NewTransform()
	transform.LookAt(math3d.Vector{0, 0, 0})

	assert.Equal(t, math3d.NewQuaternion(), transform.Rotation)
}