Пример #1
0
 public Camera3D(string id, ActorType actorType, StatusType statusType,
                 Transform3D transform3D,
                 ProjectionParameters projectionParameters)
     : base(id, actorType, statusType, transform3D)
 {
     this.projectionParameters = projectionParameters;
 }
 //forward compatibility (since v3.4) for existing code with no StatusType
 public Camera3D(string id, ActorType actorType,
                 Transform3D transform, ProjectionParameters projectionParameters,
                 Viewport viewPort, int drawDepth)
     : this(id, actorType, transform, projectionParameters,
            viewPort, drawDepth, StatusType.Updated)
 {
 }
Пример #3
0
 public TrackCamera3D(string id, ObjectType objectType,
                      Transform3D transform, ProjectionParameters projectionParameters,
                      Viewport viewPort, Camera3DTrack track)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
     this.track = track;
 }
Пример #4
0
 public Camera3D(string id, ObjectType objectType,
                 Transform3D transform, ProjectionParameters projectionParameters, Viewport viewPort)
     : base(id, objectType, transform)
 {
     this.projectionParameters = projectionParameters;
     this.viewPort             = viewPort;
 }
Пример #5
0
        public override bool Equals(object obj)
        {
            if (obj == null) //non-valid address
            {
                return(false);
            }

            if (this == obj) //memory addresses
            {
                return(true);
            }

            //results in null if fail to cast
            ProjectionParameters other = obj as ProjectionParameters; // =(Projection) obj;

            if (other == null)                                        //cast fail
            {
                return(false);
            }

            //TODO - comparison of floating-point values
            return(this.fieldOfView.Equals(other.FieldOfView) &&
                   this.aspectRatio.Equals(other.AspectRatio) &&
                   this.nearClipPlane.Equals(other.NearClipPlane) &&
                   this.farClipPlane.Equals(other.FarClipPlane));
        }
Пример #6
0
 public TrackCamera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters,
     Viewport viewPort, Camera3DTrack track)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
     this.track = track;
 }
Пример #7
0
 public Camera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters, Viewport viewPort)
     : base(id, objectType, transform)
 {
     this.projectionParameters = projectionParameters;
     this.viewPort = viewPort;
 }
Пример #8
0
 public ProjectionParameters(Rectangle rectangle,
                             float nearClipPlane, float farClipPlane)
 {
     this.Rectangle                    = rectangle;
     this.NearClipPlane                = nearClipPlane;
     this.FarClipPlane                 = farClipPlane;
     this.IsPerspectiveProjection      = false;
     this.originalProjectionParameters = (ProjectionParameters)this.Clone();
 }
Пример #9
0
 public Camera3D(string id, ActorType actorType,
                 Transform3D transform, ProjectionParameters projectionParameters,
                 Viewport viewport, float drawDepth)
     : base(id, actorType, transform)
 {
     this.projectionParameters = projectionParameters;
     this.viewport             = viewport;
     this.DrawDepth            = drawDepth; //used for stacking cameras when in PiP mode
 }
Пример #10
0
        public override bool Equals(object obj)
        {
            ProjectionParameters other = obj as ProjectionParameters;

            return(float.Equals(this.FOV, other.FOV) &&
                   float.Equals(this.AspectRatio, other.AspectRatio) &&
                   float.Equals(this.NearClipPlane, other.NearClipPlane) &&
                   float.Equals(this.FarClipPlane, other.FarClipPlane));
        }
 public Camera3D(string id, ActorType actorType,
                 Transform3D transform, ProjectionParameters projectionParameters,
                 Viewport viewPort, float drawDepth, StatusType statusType)
     : base(id, actorType, transform, statusType)
 {
     this.projectionParameters = projectionParameters;
     this.Viewport             = viewPort;
     this.DrawDepth            = drawDepth;
 }
Пример #12
0
 public ProjectionParameters(float fieldOfView, float aspectRatio,
                             float nearClipPlane, float farClipPlane)
 {
     this.FOV                          = fieldOfView;
     this.AspectRatio                  = aspectRatio;
     this.NearClipPlane                = nearClipPlane;
     this.FarClipPlane                 = farClipPlane;
     this.IsPerspectiveProjection      = true;
     this.originalProjectionParameters = (ProjectionParameters)this.Clone();
 }
        public RailCamera3D(string id, ObjectType objectType,
            Transform3D transform, ProjectionParameters projectionParameters, 
            Viewport viewPort, RailParameters railParameters, Actor targetActor)
            : base(id, objectType, transform, projectionParameters, viewPort)
        {
            this.railParameters = railParameters;
            this.targetActor = targetActor;

            //put the camera on the rail mid point
            this.Transform3D.Translation = railParameters.MidPoint;
        }
        public ThirdPersonCamera3D(string id, ObjectType objectType, Transform3D transform,
            ProjectionParameters projectionParameters,
            Viewport viewPort, Actor targetActor,
            int elevationAngle, int distance)
            : base(id, objectType, transform, projectionParameters, viewPort)
        {
            this.targetActor = targetActor;
            this.elevationAngle = elevationAngle;
            this.distance = distance;

            this.lerpSpeed = 0.05f;// med = 0.1f, fast = 0.2f
            this.oldTranslation = this.Transform3D.Translation;
            this.oldLook = this.Transform3D.Look;
            this.oldUp = this.Transform3D.Up;
        }
Пример #15
0
        public override bool Equals(object obj)
        {
            ProjectionParameters other = obj as ProjectionParameters;

            if (other == null)
            {
                return(false);
            }
            else if (this == other)
            {
                return(true);
            }

            return(float.Equals(this.FOV, other.FOV) &&
                   float.Equals(this.AspectRatio, other.AspectRatio) &&
                   float.Equals(this.NearClipPlane, other.NearClipPlane) &&
                   float.Equals(this.FarClipPlane, other.FarClipPlane) &&
                   this.Rectangle.Equals(other.Rectangle));
        }
Пример #16
0
 public FirstPersonCamera3D(string id, ObjectType objectType, Transform3D transform,
                            ProjectionParameters projectionParameters, Viewport viewPort, float speed)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
     this.speed = speed;
 }
 public FreeLookCamera3D(string id, ObjectType objectType, Transform3D transform, 
     ProjectionParameters projectionParameters, Viewport viewPort, float speed)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
     this.speed = speed;
 }
 public PawnCamera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters, Viewport viewPort)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
 }
 //constructor with default drawDepth set to 0
 public Camera3D(string id, ActorType actorType,
                 Transform3D transform, ProjectionParameters projectionParameters,
                 Viewport viewPort, StatusType statusType)
     : this(id, actorType, transform, projectionParameters, viewPort, 0, statusType)
 {
 }
Пример #20
0
 public Camera3D(string id, ActorType actorType,
                 Transform3D transform, ProjectionParameters projectionParameters,
                 Viewport viewport)
     : this(id, actorType, transform, projectionParameters, viewport, 1)
 {
 }