Example #1
0
 public Vector3D(Vector3D rhs)
 {
     x = rhs.x;
     y = rhs.y;
     z = rhs.z;
     w = 0;
 }
Example #2
0
        public Camera(GraphicsInterface gi, Point3D location, Point3D lookAt, Vector3D up)
        {
            GI = gi;

            fPosition = location;
            fLookAt = lookAt;
            fUp = up;
        }
Example #3
0
        public GLProjectionCamera(GraphicsInterface gi, Point3D location, Point3D lookAt, Vector3D up, float nearPlane, float farPlane)
        :base(gi, location, lookAt, up)
        {
            fFrustum = new GLFrustum(-1, 1, 1, -1, -1, 1);

            fNearPlaneDistance = nearPlane;
            fFarPlaneDistance = farPlane;
        }
Example #4
0
		public Graphic(String name, int x, int y, int width, int height)
		{
            fName = name;

            fOrigin = new Point3D(0, 0);
            fDimension = new Vector3D(width, height);

            fFrame = new RectangleI(x, y, width, height);

            //fGraphicsUnit = GraphicsUnit.Display;
			fVisible = true;
            fActive = true;
            fEnabled = false;
        }
Example #5
0
 public virtual void SetUp(Vector3D vec)
 {
     fUp = vec;
     OnUpChanged();
 }
Example #6
0
 public void Translate(Vector3D vec)
 {
     Translate(vec.x, vec.y, vec.z);
 }
Example #7
0
        public virtual void OnGraphicAdded(IGraphic aGraphic)
        {
            // Layout the graphic again
            LayoutHandler.AddToLayout(aGraphic);

            if (AutoGrow)
            {
                // Make sure our frame expands appropriately
                RectangleI frame = Frame;

                Point2I gOrigin = new Point2I(frame.Left + aGraphic.Frame.Left, frame.Top + aGraphic.Frame.Top);
                //float3 iPoint = WorldTransform.ApplyInverse(new float3(gOrigin.X, gOrigin.Y, 0));
                //Point tOrigin = new Point((int)iPoint.x, (int)iPoint.y);
                RectangleI tRect = new RectangleI((int)gOrigin.x, (int)gOrigin.y, (int)aGraphic.Dimension.x, (int)aGraphic.Dimension.y);

                // WAA - need to do this
                frame = RectangleI.Union(frame, tRect);

                Dimension = new Vector3D(frame.Width, frame.Height);
                fFrame = frame;
            }
        }
Example #8
0
 // A helper function that lets you set the direction vector and computes
 // the up and right vectors automatically.
 public void SetDirection (Vector3D direction, bool isUnitLength)
 {
     DVector = direction;
     //Vector3f.GenerateOrthonormalBasis(UVector,RVector,DVector,bUnitLength);
 }
Example #9
0
 public double Dot(Vector3D rhs)
 {
     return x * rhs.x + y * rhs.y + z * rhs.z;
 }
Example #10
0
 public Vector3D Cross(Vector3D v)
 {
     return new Vector3D(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
 }
Example #11
0
 public static Vector3D operator /(Vector3D vec, double c)
 {
     Vector3D newVector = new Vector3D(vec.x / c, vec.y / c, vec.z / c);
     return newVector;
 }
Example #12
0
 public static Vector3D operator *(double c, Vector3D vec)
 {
     Vector3D newVector = new Vector3D(vec.x * c, vec.y * c, vec.z * c);
     return newVector;
 }
Example #13
0
 public static Vector3D operator -(Vector3D U, Vector3D V)
 {
     Vector3D newVector = new Vector3D(U.x - V.x, U.y - V.y, U.z - V.z);
     return newVector;
 }
Example #14
0
 public static Vector3D operator +(Normal3D n, Vector3D U)
 {
     Vector3D newVector = new Vector3D(U.x + n.x, U.y + n.y, U.z + n.z);
     return newVector;
 }
Example #15
0
 public static Vector3D operator +(Vector3D U, Vector3D V)
 {
     Vector3D newVector = new Vector3D(U.x + V.x, U.y + V.y, U.z + V.z);
     return newVector;
 }