Exemple #1
0
        // palce and object relative to another object
        // i.e. place and object to the left of the camera (left from the view of the camera)
        public void PlaceRelativeTo(Axis3D pReferenceAxis, double x, double y, double z)
        {
            Vector3 pos = new Vector3(x, y, z);

            pos = Vector3.Transform(pos, pReferenceAxis.AxisToWorld);
            Vector3 RefPos = pReferenceAxis.Origin;

            pos += RefPos;

            MoveToAbsolute(pos.x, pos.y, pos.z);
        }
Exemple #2
0
        public void RotateAbsolute(Axis3D pSourceAxis)
        {
            Vector3 save1;

            // save the old position
            save1.x = AxisToWorld[3, 0];
            save1.y = AxisToWorld[3, 1];
            save1.z = AxisToWorld[3, 2];

            AxisToWorld = pSourceAxis.AxisToWorld;

            // stuff the old position back in
            AxisToWorld[3, 0] = save1.x;
            AxisToWorld[3, 1] = save1.y;
            AxisToWorld[3, 2] = save1.z;

            AxisToWorld = Matrix4X4.Invert(WorldToAxis);
        }
Exemple #3
0
        // move an object relative to it's current position relative to the rotation of another axis
        // i.e. move an object left relative to the camera (left from the view of the camera)
        public void MoveToRelativeTo(Axis3D pReferenceAxis, double x, double y, double z)
        {
            Vector3 add;

            add.x = x;
            add.y = y;
            add.z = z;

            add = Vector3.Transform(add, pReferenceAxis.AxisToWorld);

            AxisToWorld[3, 0] += add.x;
            AxisToWorld[3, 1] += add.y;
            AxisToWorld[3, 2] += add.z;

            // and do it for the inverse
            add = Vector3.Transform(add, WorldToAxis);

            WorldToAxis[3, 0] -= add.x;
            WorldToAxis[3, 1] -= add.y;
            WorldToAxis[3, 2] -= add.z;
        }
Exemple #4
0
        // move an object relative to it's current position relative to the rotation of another axis
        // i.e. move an object left relative to the camera (left from the view of the camera)
        public void MoveToRelativeTo(Axis3D pReferenceAxis, double x, double y, double z)
        {
            Vector3 add;

            add.X = x;
            add.Y = y;
            add.Z = z;

            add = Vector3Ex.Transform(add, pReferenceAxis.AxisToWorld);

            AxisToWorld[3, 0] += add.X;
            AxisToWorld[3, 1] += add.Y;
            AxisToWorld[3, 2] += add.Z;

            // and do it for the inverse
            add = Vector3Ex.Transform(add, WorldToAxis);

            WorldToAxis[3, 0] -= add.X;
            WorldToAxis[3, 1] -= add.Y;
            WorldToAxis[3, 2] -= add.Z;
        }
Exemple #5
0
		public void PointAtOrigin(Axis3D pTarget, bool YandX = true)
		{
			PointAt(pTarget.Origin, YandX);
		}
Exemple #6
0
		public void SetPosAndRotation(Axis3D pSourceAxis)
		{
			AxisToWorld = pSourceAxis.AxisToWorld;
			WorldToAxis = pSourceAxis.WorldToAxis;
		}
Exemple #7
0
		public void RotateAbsolute(Axis3D pSourceAxis)
		{
			Vector3 save1;

			// save the old position
			save1.x = AxisToWorld[3, 0];
			save1.y = AxisToWorld[3, 1];
			save1.z = AxisToWorld[3, 2];

			AxisToWorld = pSourceAxis.AxisToWorld;

			// stuff the old position back in
			AxisToWorld[3, 0] = save1.x;
			AxisToWorld[3, 1] = save1.y;
			AxisToWorld[3, 2] = save1.z;

			AxisToWorld = Matrix4X4.Invert(WorldToAxis);
		}
Exemple #8
0
		// palce and object relative to another object
		// i.e. place and object to the left of the camera (left from the view of the camera)
		public void PlaceRelativeTo(Axis3D pReferenceAxis, double x, double y, double z)
		{
			Vector3 pos = new Vector3(x, y, z);

			pos = Vector3.Transform(pos, pReferenceAxis.AxisToWorld);
			Vector3 RefPos = pReferenceAxis.Origin;

			pos += RefPos;

			MoveToAbsolute(pos.x, pos.y, pos.z);
		}
Exemple #9
0
		// move an object relative to it's current position relative to the rotation of another axis
		// i.e. move an object left relative to the camera (left from the view of the camera)
		public void MoveToRelativeTo(Axis3D pReferenceAxis, double x, double y, double z)
		{
			Vector3 add;

			add.x = x;
			add.y = y;
			add.z = z;

			add = Vector3.Transform(add, pReferenceAxis.AxisToWorld);

			AxisToWorld[3, 0] += add.x;
			AxisToWorld[3, 1] += add.y;
			AxisToWorld[3, 2] += add.z;

			// and do it for the inverse
			add = Vector3.Transform(add, WorldToAxis);

			WorldToAxis[3, 0] -= add.x;
			WorldToAxis[3, 1] -= add.y;
			WorldToAxis[3, 2] -= add.z;
		}
Exemple #10
0
 public void PointAtOrigin(Axis3D pTarget, bool YandX = true)
 {
     PointAt(pTarget.Origin, YandX);
 }
Exemple #11
0
 public void SetPosAndRotation(Axis3D pSourceAxis)
 {
     AxisToWorld = pSourceAxis.AxisToWorld;
     WorldToAxis = pSourceAxis.WorldToAxis;
 }