public Vector3D(Vector3D rhs) { x = rhs.x; y = rhs.y; z = rhs.z; w = 0; }
public Camera(GraphicsInterface gi, Point3D location, Point3D lookAt, Vector3D up) { GI = gi; fPosition = location; fLookAt = lookAt; fUp = up; }
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; }
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; }
public virtual void SetUp(Vector3D vec) { fUp = vec; OnUpChanged(); }
public void Translate(Vector3D vec) { Translate(vec.x, vec.y, vec.z); }
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; } }
// 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); }
public double Dot(Vector3D rhs) { return x * rhs.x + y * rhs.y + z * rhs.z; }
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); }
public static Vector3D operator /(Vector3D vec, double c) { Vector3D newVector = new Vector3D(vec.x / c, vec.y / c, vec.z / c); return newVector; }
public static Vector3D operator *(double c, Vector3D vec) { Vector3D newVector = new Vector3D(vec.x * c, vec.y * c, vec.z * c); return newVector; }
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; }
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; }
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; }