C# Class FlatRedBall.Content.Scene.CameraSave

An XML serializable "Save" class which can be included in other Save classes to store Camera information.
ファイルを表示 Open project: vchelaru/FlatRedBall Class Usage Examples

Public Properties

Property Type Description
AspectRatio float
FarClipPlane float
NearClipPlane float
Orthogonal bool
OrthogonalHeight float
OrthogonalWidth float
X float
Y float
Z float

Public Methods

Method Description
CameraSave ( ) : System

Creates a new CameraSave. This is used by the XmlSerializer when deserializing an XML. Usually CameraSaves are created using the FromCamera static method.

FromCamera ( Camera camera ) : CameraSave

Creates a new CameraSave instance using members from the passed Camera argument.

FromCamera ( Camera camera, bool setWidth ) : CameraSave
SetCamera ( Camera camera ) : void

Sets the argument Camera's properties to the properties stored in this CameraSave.

Usually "Save" classes include a To[RuntimeType] method. The CameraSave does not follow this pattern because it's most common that a CameraSave is loaded when a Camera is already created by the engine. In this case, it's not very convenient to have to destroy the existing Camera and replace it by a new instance. Instead, the SetCamera method will simply set the properties on an existing Camera

Method Details

CameraSave() public method

Creates a new CameraSave. This is used by the XmlSerializer when deserializing an XML. Usually CameraSaves are created using the FromCamera static method.
public CameraSave ( ) : System
return System

FromCamera() public static method

Creates a new CameraSave instance using members from the passed Camera argument.
public static FromCamera ( Camera camera ) : CameraSave
camera Camera The Camera to copy properties from.
return CameraSave

FromCamera() public static method

public static FromCamera ( Camera camera, bool setWidth ) : CameraSave
camera Camera
setWidth bool
return CameraSave

SetCamera() public method

Sets the argument Camera's properties to the properties stored in this CameraSave.
Usually "Save" classes include a To[RuntimeType] method. The CameraSave does not follow this pattern because it's most common that a CameraSave is loaded when a Camera is already created by the engine. In this case, it's not very convenient to have to destroy the existing Camera and replace it by a new instance. Instead, the SetCamera method will simply set the properties on an existing Camera
public SetCamera ( Camera camera ) : void
camera Camera The Camera to set the properties on.
return void

Property Details

AspectRatio public_oe property

public float AspectRatio
return float

FarClipPlane public_oe property

public float FarClipPlane
return float

NearClipPlane public_oe property

public float NearClipPlane
return float

Orthogonal public_oe property

Whether the Camera is using an orthogonal projection matrix. If this is false, the Camera is using a perspective projection matrix.
public bool Orthogonal
return bool

OrthogonalHeight public_oe property

The orthogonal height of the camera's view.
public float OrthogonalHeight
return float

OrthogonalWidth public_oe property

public float OrthogonalWidth
return float

X public_oe property

The absolute X position.
public float X
return float

Y public_oe property

The absolute Y position.
public float Y
return float

Z public_oe property

The absolute Z position.
public float Z
return float