Example #1
0
 public CameraParameters(CameraComponent component, float defaultAspect)
     : this()
 {
     AspectRatio      = component.UseCustomAspectRatio ? component.AspectRatio : defaultAspect;
     VerticalFov      = component.VerticalFieldOfView;
     NearPlane        = component.NearClipPlane;
     FarPlane         = component.FarClipPlane;
     OrthographicSize = component.OrthographicSize;
     ProjectionMode   = component.Projection;
 }
Example #2
0
 public Camera(int windowWidth, int windowHeight)
 {
     _viewport = new Viewport(0, 0, windowWidth, windowHeight);
     _direction = -Vector3.UnitZ;
     _nearPlane = 0.1f;
     _farPlane = 16384f;
     _scale = 1.0f;
     _projectionMode = CameraProjectionMode.Perspective;
     _fieldOfView = MathHelper.PiOver4;
     UpdateViewMatrix();
     UpdateProjectionMatrix();
 }
Example #3
0
        public FbxCameraAttribute(IntPtr ptr) : base(ptr)
        {
            var native = FbxNodeGetCameraAttribute(ptr);

            if (native == IntPtr.Zero)
            {
                throw new FbxAtributeImportException(Type);
            }
            var cam = native.ToStruct <Camera>();

            Name           = cam.name;
            FieldOfView    = cam.FieldOfView;
            AspectRatio    = cam.AspectRatio;
            NearClipPlane  = cam.ClipPlaneNear;
            FarClipPlane   = cam.ClipPlaneFar;
            OrthoZoom      = cam.OrthoZoom;
            ProjectionMode = cam.ProjectionMode;
        }