Ejemplo n.º 1
0
        public static Mat3 LookAt(Vec3 forward, Vec3 up)
        {
            var Z = forward.Normalize();
            var X = up.Cross(Z).Normalize();
            var Y = Z.Cross(X);

            return(new Mat3(X, Y, Z));
        }
Ejemplo n.º 2
0
        public float Angle(Vec3 vector)
        {
            var   vec = this.Normalize();
            float val = vec.Dot(vector.Normalize());

            val = (val > 1) ? 1 : val;
            val = (val < -1) ? -1 : val;
            return((float)Math.Acos(val));
        }