C# Class FlatRedBall.Camera

Inheritance: FlatRedBall.PositionedObject
显示文件 Open project: vchelaru/FlatRedBall Class Usage Examples

Public Properties

Property Type Description
BackgroundColor Color
DrawToScreen bool
RenderOrder List
UpVector Vector3

Public Methods

Method Description
AbsoluteBottomYEdgeAt ( float absoluteZ ) : float
AbsoluteLeftXEdgeAt ( float absoluteZ ) : float
AbsoluteRightXEdgeAt ( float absoluteZ ) : float
AbsoluteTopYEdgeAt ( float absoluteZ ) : float
FixAspectRatioXConstant ( ) : void
FixAspectRatioYConstant ( ) : void

Sets the aspectRatio to match the width/height of the area that the camera is drawing to.

This is usually used in applications with split screen or when on a widescreen display.

GetZDistanceForPixelPerfect ( ) : float
IsPointInView ( double x, double y, double absoluteZ ) : bool
IsSpriteInView ( Sprite sprite ) : bool
IsSpriteInView ( Sprite sprite, bool relativeToCamera ) : bool
IsTextInView ( Text text ) : bool
IsXInView ( double x, double absoluteZ ) : bool

Determines if the X value is in view, assuming the camera is viewing down the Z axis.

Currently, this method assumes viewing down the Z axis.

IsYInView ( double y, double absoluteZ ) : bool

Determines if the Y value is in view, assuming the camera is viewing down the Z axis.

Currently, this method assumes viewing down the Z axis.

PixelsPerUnitAt ( Vector3 &absolutePosition ) : float
PixelsPerUnitAt ( Vector3 &absolutePosition, float fieldOfView, bool orthogonal, float orthogonalHeight ) : float
PixelsPerUnitAt ( float absoluteZ ) : float

Returns the number of pixels per unit at the given absolute Z value. Assumes that the Camera is unrotated.

If using the PixelsPerUnitAt for a rotated camera, use the overload which takes a Vector3 argument.

RelativeXEdgeAt ( float absoluteZ ) : float
RelativeXEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalWidth ) : float
RelativeYEdgeAt ( float absoluteZ ) : float
RelativeYEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalHeight ) : float
UsePixelCoordinates ( bool moveCornerToOrigin, int desiredWidth, int desiredHeight ) : void

Sets the camera to Orthogonal, sets the OrthogonalWidth and OrthogonalHeight to match the argument values, and can move the so the bottom-left corner of the screen is at the origin.

UsePixelCoordinates3D ( float zToMakePixelPerfect ) : void
WorldXAt ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float screenX ) : float
WorldXAt ( float screenX, float zPosition ) : float
WorldXAt ( float screenX, float zPosition, Layer layer ) : float
WorldXAt ( float screenX, float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth ) : float
WorldYAt ( float zPosition, bool orthogonal, float orthogonalHeight, float screenY ) : float
WorldYAt ( float screenY, float zPosition ) : float
WorldYAt ( float screenY, float zPosition, Layer layer ) : float
WorldYAt ( float screenY, float zPosition, bool overridingOrthogonal, float overridingOrthogonalHeight ) : float

Private Methods

Method Description
Color ( ) : System
GetWorldXGivenHorizontalPercentage ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float horizontalPercentage ) : float

Method Details

AbsoluteBottomYEdgeAt() public method

public AbsoluteBottomYEdgeAt ( float absoluteZ ) : float
absoluteZ float
return float

AbsoluteLeftXEdgeAt() public method

public AbsoluteLeftXEdgeAt ( float absoluteZ ) : float
absoluteZ float
return float

AbsoluteRightXEdgeAt() public method

public AbsoluteRightXEdgeAt ( float absoluteZ ) : float
absoluteZ float
return float

AbsoluteTopYEdgeAt() public method

public AbsoluteTopYEdgeAt ( float absoluteZ ) : float
absoluteZ float
return float

FixAspectRatioXConstant() public method

public FixAspectRatioXConstant ( ) : void
return void

FixAspectRatioYConstant() public method

Sets the aspectRatio to match the width/height of the area that the camera is drawing to.
This is usually used in applications with split screen or when on a widescreen display.
public FixAspectRatioYConstant ( ) : void
return void

GetZDistanceForPixelPerfect() public method

public GetZDistanceForPixelPerfect ( ) : float
return float

IsPointInView() public method

public IsPointInView ( double x, double y, double absoluteZ ) : bool
x double
y double
absoluteZ double
return bool

IsSpriteInView() public method

public IsSpriteInView ( Sprite sprite ) : bool
sprite Sprite
return bool

IsSpriteInView() public method

public IsSpriteInView ( Sprite sprite, bool relativeToCamera ) : bool
sprite Sprite
relativeToCamera bool
return bool

IsTextInView() public method

public IsTextInView ( Text text ) : bool
text Text
return bool

IsXInView() public method

Determines if the X value is in view, assuming the camera is viewing down the Z axis.
Currently, this method assumes viewing down the Z axis.
public IsXInView ( double x, double absoluteZ ) : bool
x double The absolute X position of the point.
absoluteZ double The absolute Z position of the point.
return bool

IsYInView() public method

Determines if the Y value is in view, assuming the camera is viewing down the Z axis.
Currently, this method assumes viewing down the Z axis.
public IsYInView ( double y, double absoluteZ ) : bool
y double The absolute Y position of the point.
absoluteZ double The absolute Z position of the point.
return bool

PixelsPerUnitAt() public method

public PixelsPerUnitAt ( Vector3 &absolutePosition ) : float
absolutePosition Vector3
return float

PixelsPerUnitAt() public method

public PixelsPerUnitAt ( Vector3 &absolutePosition, float fieldOfView, bool orthogonal, float orthogonalHeight ) : float
absolutePosition Vector3
fieldOfView float
orthogonal bool
orthogonalHeight float
return float

PixelsPerUnitAt() public method

Returns the number of pixels per unit at the given absolute Z value. Assumes that the Camera is unrotated.
If using the PixelsPerUnitAt for a rotated camera, use the overload which takes a Vector3 argument.
public PixelsPerUnitAt ( float absoluteZ ) : float
absoluteZ float The absolute Z position.
return float

RelativeXEdgeAt() public method

public RelativeXEdgeAt ( float absoluteZ ) : float
absoluteZ float
return float

RelativeXEdgeAt() public method

public RelativeXEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalWidth ) : float
absoluteZ float
fieldOfView float
aspectRatio float
orthogonal bool
orthogonalWidth float
return float

RelativeYEdgeAt() public method

public RelativeYEdgeAt ( float absoluteZ ) : float
absoluteZ float
return float

RelativeYEdgeAt() public method

public RelativeYEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalHeight ) : float
absoluteZ float
fieldOfView float
aspectRatio float
orthogonal bool
orthogonalHeight float
return float

UsePixelCoordinates() public method

Sets the camera to Orthogonal, sets the OrthogonalWidth and OrthogonalHeight to match the argument values, and can move the so the bottom-left corner of the screen is at the origin.
public UsePixelCoordinates ( bool moveCornerToOrigin, int desiredWidth, int desiredHeight ) : void
moveCornerToOrigin bool Whether the camera should be repositioned /// so the bottom left is at the origin.
desiredWidth int The desired unit width of the view.
desiredHeight int The desired unit height of the view.
return void

UsePixelCoordinates3D() public method

public UsePixelCoordinates3D ( float zToMakePixelPerfect ) : void
zToMakePixelPerfect float
return void

WorldXAt() public method

public WorldXAt ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float screenX ) : float
zPosition float
overridingOrthogonal bool
overridingOrthogonalWidth float
screenX float
return float

WorldXAt() public method

public WorldXAt ( float screenX, float zPosition ) : float
screenX float
zPosition float
return float

WorldXAt() public method

public WorldXAt ( float screenX, float zPosition, Layer layer ) : float
screenX float
zPosition float
layer Layer
return float

WorldXAt() public method

public WorldXAt ( float screenX, float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth ) : float
screenX float
zPosition float
overridingOrthogonal bool
overridingOrthogonalWidth float
return float

WorldYAt() public method

public WorldYAt ( float zPosition, bool orthogonal, float orthogonalHeight, float screenY ) : float
zPosition float
orthogonal bool
orthogonalHeight float
screenY float
return float

WorldYAt() public method

public WorldYAt ( float screenY, float zPosition ) : float
screenY float
zPosition float
return float

WorldYAt() public method

public WorldYAt ( float screenY, float zPosition, Layer layer ) : float
screenY float
zPosition float
layer Layer
return float

WorldYAt() public method

public WorldYAt ( float screenY, float zPosition, bool overridingOrthogonal, float overridingOrthogonalHeight ) : float
screenY float
zPosition float
overridingOrthogonal bool
overridingOrthogonalHeight float
return float

Property Details

BackgroundColor public_oe property

public Color BackgroundColor
return Color

DrawToScreen public_oe property

Whether or not this camera should be drawn to the screen
public bool DrawToScreen
return bool

RenderOrder public_oe property

Defines the rendering order for this camera
public List RenderOrder
return List

UpVector public_oe property

public Vector3 UpVector
return Vector3