Exemple #1
0
        public void UpdateGizmoTransform()
        {
            OpenTK.Vector3     position      = OpenTK.Vector3.Zero;
            OpenTK.Quaterniond localRotation = OpenTK.Quaterniond.Identity;

            foreach (var entity in EditorSelection.SelectedObjects)
            {
                position += entity.BackingVector;
            }

            if (EditorSelection.SelectedObjects.Count > 0)
            {
                position /= EditorSelection.SelectedObjects.Count;
                //localRotation = EditorSelection.SelectedObjects[0].Transform.LocalRotation;
            }

            TransformGizmo.SetPosition(position);
            TransformGizmo.SetLocalRotation(localRotation);
        }
Exemple #2
0
        public static void RotMatrix33(OpenTK.Quaterniond quat, double[] m)
        {
            double real = quat.W;
            double x    = quat.X;
            double y    = quat.Y;
            double z    = quat.Z;

            m[0] = 1.0 - 2.0 * (y * y + z * z);
            m[1] = 2.0 * (x * y - z * real);
            m[2] = 2.0 * (z * x + y * real);

            m[3] = 2.0 * (x * y + z * real);
            m[4] = 1.0 - 2.0 * (z * z + x * x);
            m[5] = 2.0 * (y * z - x * real);

            m[6] = 2.0 * (z * x - y * real);
            m[7] = 2.0 * (y * z + x * real);
            m[8] = 1.0 - 2.0 * (y * y + x * x);
        }
Exemple #3
0
 public Coord(Vec3d pos, Quatd rot)
 {
     Position = pos;
     Rotation = rot;
 }
Exemple #4
0
 public static LDDModder.Simple3D.Quaterniond ToLDD(this OpenTK.Quaterniond quaternion)
 {
     return(new Simple3D.Quaterniond(quaternion.X, quaternion.Y, quaternion.Z, quaternion.W));
 }
Exemple #5
0
 public Coord(Vec3d pos, Quatd rot)
 {
     Position = pos;
     Rotation = rot;
 }