메소드 | 설명 | |
---|---|---|
Initialize ( ) : void |
Initializes the CameraComponent class. This method repositions the mouse to the center of the game window.
|
|
LookAt ( R3DVECTOR target ) : void |
Builds a look at style viewing matrix.
|
|
LookAt ( R3DVECTOR eye, R3DVECTOR target, R3DVECTOR up ) : void |
Builds a look at style viewing matrix.
|
|
MapActionToKey ( Actions action, Keys key ) : void |
Binds an action to a keyboard key.
|
|
Move ( R3DVECTOR direction, R3DVECTOR distance ) : void |
Moves the camera the specified distance in the specified direction.
|
|
Move ( float dx, float dy, float dz ) : void |
Moves the camera by dx world units to the left or right; dy world units upwards or downwards; and dz world units forwards or backwards.
|
|
Perspective ( float fovx, float aspect, float znear, float zfar ) : void |
Builds a perspective projection matrix based on a horizontal field of view.
|
|
RCameraComponent ( Microsoft.Xna.Framework.Game game ) : System |
Constructs a new instance of the CameraComponent class. The camera will have a spectator behavior, and will be initially positioned at the world origin looking down the world negative z axis. An initial perspective projection matrix is created as well as setting up initial key bindings to the actions.
|
|
Rotate ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void |
Rotates the camera. Positive angles specify counter clockwise rotations when looking down the axis of rotation towards the origin.
|
|
UndoRoll ( ) : void |
Undo any camera rolling by leveling the camera. When the camera is orbiting this method will cause the camera to become level with the orbit target.
|
|
Update ( |
Updates the state of the CameraComponent class.
|
|
Zoom ( float zoom, float minZoom, float maxZoom ) : void |
Zooms the camera. This method functions differently depending on the camera's current behavior. When the camera is orbiting this method will move the camera closer to or further away from the orbit target. For the other camera behaviors this method will change the camera's horizontal field of view.
|
메소드 | 설명 | |
---|---|---|
GetMouseWheelDirection ( ) : float |
Determines which way the mouse wheel has been rolled. The returned value is in the range [-1,1].
|
|
GetMovementDirection ( Vector3 &direction ) : void |
Determines which way to move the camera based on player input. The returned values are in the range [-1,1].
|
|
HandleGameActivatedEvent ( object sender, |
Event handler for when the game window acquires input focus.
|
|
HandleGameDeactivatedEvent ( object sender, |
Event hander for when the game window loses input focus.
|
|
PerformMouseFiltering ( float x, float y ) : void |
Filters the mouse movement based on a weighted sum of mouse movement from previous frames. For further details see: Nettle, Paul "Smooth Mouse Filtering", flipCode's Ask Midnight column. http://www.flipcode.com/cgi-bin/fcarticles.cgi?show=64462
|
|
PerformMouseSmoothing ( float x, float y ) : void |
Averages the mouse movement over a couple of frames to smooth out the mouse movement.
|
|
RotateSmoothly ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void |
Dampens the rotation by applying the rotation speed to it.
|
|
UpdateCamera ( |
Updates the state of the camera based on player input.
|
|
UpdateInput ( ) : void |
Gathers and updates input from all supported input devices for use by the CameraComponent class.
|
|
UpdatePosition ( Vector3 &direction, float elapsedTimeSec ) : void |
Moves the camera based on player input.
|
|
UpdateVelocity ( Vector3 &direction, float elapsedTimeSec ) : void |
Updates the camera's velocity based on the supplied movement direction and the elapsed time (since this method was last called). The movement direction is the in the range [-1,1].
|
public LookAt ( R3DVECTOR target ) : void | ||
target | R3DVECTOR | The target position to look at. |
리턴 | void |
public LookAt ( R3DVECTOR eye, R3DVECTOR target, R3DVECTOR up ) : void | ||
eye | R3DVECTOR | The camera position. |
target | R3DVECTOR | The target position to look at. |
up | R3DVECTOR | The up direction. |
리턴 | void |
public MapActionToKey ( Actions action, Keys key ) : void | ||
action | Actions | The action to bind. |
key | Keys | The key to map the action to. |
리턴 | void |
public Move ( R3DVECTOR direction, R3DVECTOR distance ) : void | ||
direction | R3DVECTOR | Direction to move. |
distance | R3DVECTOR | How far to move. |
리턴 | void |
public Move ( float dx, float dy, float dz ) : void | ||
dx | float | Distance to move left or right. |
dy | float | Distance to move up or down. |
dz | float | Distance to move forwards or backwards. |
리턴 | void |
public Perspective ( float fovx, float aspect, float znear, float zfar ) : void | ||
fovx | float | Horizontal field of view in degrees. |
aspect | float | The viewport's aspect ratio. |
znear | float | The distance to the near clip plane. |
zfar | float | The distance to the far clip plane. |
리턴 | void |
public RCameraComponent ( Microsoft.Xna.Framework.Game game ) : System | ||
game | Microsoft.Xna.Framework.Game | |
리턴 | System |
public Rotate ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void | ||
headingDegrees | float | Y axis rotation in degrees. |
pitchDegrees | float | X axis rotation in degrees. |
rollDegrees | float | Z axis rotation in degrees. |
리턴 | void |
public Update ( |
||
gameTime | Time elapsed since the last call to Update. | |
리턴 | void |
public Zoom ( float zoom, float minZoom, float maxZoom ) : void | ||
zoom | float | /// When orbiting this parameter is how far to move the camera. /// For the other behaviors this parameter is the new horizontal /// field of view. /// |
minZoom | float | /// When orbiting this parameter is the min allowed zoom distance to /// the orbit target. For the other behaviors this parameter is the /// min allowed horizontal field of view. /// |
maxZoom | float | /// When orbiting this parameter is the max allowed zoom distance to /// the orbit target. For the other behaviors this parameter is the max /// allowed horizontal field of view. /// |
리턴 | void |