コード例 #1
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 public Vector3D(Vector3D rhs)
 {
     x = rhs.x;
     y = rhs.y;
     z = rhs.z;
     w = 0;
 }
コード例 #2
0
ファイル: Camera.cs プロジェクト: Wiladams/NewTOAPIA
        public Camera(GraphicsInterface gi, Point3D location, Point3D lookAt, Vector3D up)
        {
            GI = gi;

            fPosition = location;
            fLookAt = lookAt;
            fUp = up;
        }
コード例 #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;
        }
コード例 #4
0
ファイル: Graphic.cs プロジェクト: Wiladams/NewTOAPIA
		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;
        }
コード例 #5
0
ファイル: Camera.cs プロジェクト: Wiladams/NewTOAPIA
 public virtual void SetUp(Vector3D vec)
 {
     fUp = vec;
     OnUpChanged();
 }
コード例 #6
0
 public void Translate(Vector3D vec)
 {
     Translate(vec.x, vec.y, vec.z);
 }
コード例 #7
0
ファイル: GraphicGroup.cs プロジェクト: Wiladams/NewTOAPIA
        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;
            }
        }
コード例 #8
0
ファイル: Light.cs プロジェクト: Wiladams/NewTOAPIA
 // 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);
 }
コード例 #9
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 public double Dot(Vector3D rhs)
 {
     return x * rhs.x + y * rhs.y + z * rhs.z;
 }
コード例 #10
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 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);
 }
コード例 #11
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 public static Vector3D operator /(Vector3D vec, double c)
 {
     Vector3D newVector = new Vector3D(vec.x / c, vec.y / c, vec.z / c);
     return newVector;
 }
コード例 #12
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 public static Vector3D operator *(double c, Vector3D vec)
 {
     Vector3D newVector = new Vector3D(vec.x * c, vec.y * c, vec.z * c);
     return newVector;
 }
コード例 #13
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 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;
 }
コード例 #14
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 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;
 }
コード例 #15
0
ファイル: Vector3D.cs プロジェクト: Wiladams/NewTOAPIA
 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;
 }