C# Class Gravitation.CameraControls.Camera

显示文件 Open project: thedamoes/Gravitation

Protected Properties

Property Type Description
_cameraPosition Vector2
_cameraZoom Vector3
_screenCenter Vector2
_view Matrix
mapHeightInPixels float
mapWidthInPixels float
prizemBase Microsoft.Xna.Framework.Rectangle
prizemTip Vector3
screenHeight int
screenWidth int
xLeftC float
xLeftM float
xRightC float
xRightM float
yBottomC float
yBottomM float
yTopC float
yTopM float

Public Methods

Method Description
Camera ( ) : System
initCamera ( GraphicsDeviceManager graphics, float leftWallPos, float rightWallPos, float topWallPos, float bottomWallPos, float mapWidth, float mapHeight ) : void
updateCamera ( Vector2 shipPos ) : void

Protected Methods

Method Description
correctCameraPositionX ( float &cameraXPos, float cameraZoom ) : void
correctCameraPositionY ( float &cameraYPos, float cameraZoom ) : void

Private Methods

Method Description
calculateGradient ( Vector2 point1, Vector2 point2 ) : float
calculateXIntercept ( Vector3 PointOnline, float gradient ) : float
calculateYIntercept ( Vector3 PointOnline, float gradient ) : float
getXForZoomLeft ( float zoom ) : float
getXForZoomRight ( float zoom ) : float
getYForZoomBottom ( float zoom ) : float
getYForZoomTop ( float zoom ) : float
initPrisemEdgeGradients ( ) : void
initYIntercepts ( ) : void
isXOutofBounds ( float &posX, float zoom ) : bool
isYOutofBounds ( float &posY, float zoom ) : bool

Method Details

Camera() public method

public Camera ( ) : System
return System

correctCameraPositionX() protected method

protected correctCameraPositionX ( float &cameraXPos, float cameraZoom ) : void
cameraXPos float
cameraZoom float
return void

correctCameraPositionY() protected method

protected correctCameraPositionY ( float &cameraYPos, float cameraZoom ) : void
cameraYPos float
cameraZoom float
return void

initCamera() public method

public initCamera ( GraphicsDeviceManager graphics, float leftWallPos, float rightWallPos, float topWallPos, float bottomWallPos, float mapWidth, float mapHeight ) : void
graphics GraphicsDeviceManager
leftWallPos float
rightWallPos float
topWallPos float
bottomWallPos float
mapWidth float
mapHeight float
return void

updateCamera() public method

public updateCamera ( Vector2 shipPos ) : void
shipPos Vector2
return void

Property Details

_cameraPosition protected_oe property

protected Vector2 _cameraPosition
return Vector2

_cameraZoom protected_oe property

protected Vector3 _cameraZoom
return Vector3

_screenCenter protected_oe property

protected Vector2 _screenCenter
return Vector2

_view protected_oe property

protected Matrix _view
return Matrix

mapHeightInPixels protected_oe property

protected float mapHeightInPixels
return float

mapWidthInPixels protected_oe property

protected float mapWidthInPixels
return float

prizemBase protected_oe property

protected Rectangle,Microsoft.Xna.Framework prizemBase
return Microsoft.Xna.Framework.Rectangle

prizemTip protected_oe property

protected Vector3 prizemTip
return Vector3

screenHeight protected_oe property

protected int screenHeight
return int

screenWidth protected_oe property

protected int screenWidth
return int

xLeftC protected_oe property

protected float xLeftC
return float

xLeftM protected_oe property

protected float xLeftM
return float

xRightC protected_oe property

protected float xRightC
return float

xRightM protected_oe property

protected float xRightM
return float

yBottomC protected_oe property

protected float yBottomC
return float

yBottomM protected_oe property

protected float yBottomM
return float

yTopC protected_oe property

protected float yTopC
return float

yTopM protected_oe property

protected float yTopM
return float