C# Class Reactor.RCamera

Inheritance: RSceneNode, ICamera, IDisposable
Datei anzeigen Open project: reisergames/reactor-v1 Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
InView ( RActor node ) : bool
InView ( RMesh node ) : bool
InView ( RSceneNode node ) : bool
LevelRoll ( ) : void
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.

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.

RCamera ( ) : System

Constructs a new instance of the camera class. The camera will have a flight behavior, and will be initially positioned at the world origin looking down the world negative z axis.

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.

RotateFirstPerson ( float headingDegrees, float pitchDegrees ) : void

Rotates the camera for first person and spectator behaviors. Pitching is limited to 90 degrees straight up and down.

RotateFlight ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void

Rotates the camera for flight behavior.

RotateOrbit ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void

Rotates the camera for orbit behavior. Rotations are either about the camera's local y axis or the orbit target's y axis. The property PreferTargetYAxisOrbiting controls which rotation method to use.

RotateX ( float value ) : void
RotateY ( float value ) : void
RotateZ ( float value ) : void
SetClipPlanes ( float znear, float zfar ) : void
SetFieldOfView ( float value ) : void
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.

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.

Private Methods

Method Description
ChangeBehavior ( Behavior newBehavior ) : void

Change to a new camera behavior.

ChangeOrientation ( Microsoft.Xna.Framework.Quaternion newOrientation ) : void

Sets a new camera orientation.

UpdateViewMatrix ( ) : void

Rebuild the view matrix.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

InView() public method

public InView ( RActor node ) : bool
node RActor
return bool

InView() public method

public InView ( RMesh node ) : bool
node RMesh
return bool

InView() public method

public InView ( RSceneNode node ) : bool
node RSceneNode
return bool

LevelRoll() public method

public LevelRoll ( ) : void
return void

LookAt() public method

Builds a look at style viewing matrix.
public LookAt ( R3DVECTOR target ) : void
target R3DVECTOR The target position to look at.
return void

LookAt() public method

Builds a look at style viewing matrix.
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.
return void

Move() public method

Moves the camera the specified distance in the specified direction.
public Move ( R3DVECTOR direction, R3DVECTOR distance ) : void
direction R3DVECTOR Direction to move.
distance R3DVECTOR How far to move.
return void

Move() public method

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.
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.
return void

Perspective() public method

Builds a perspective projection matrix based on a horizontal field of view.
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.
return void

RCamera() public method

Constructs a new instance of the camera class. The camera will have a flight behavior, and will be initially positioned at the world origin looking down the world negative z axis.
public RCamera ( ) : System
return System

Rotate() public method

Rotates the camera. Positive angles specify counter clockwise rotations when looking down the axis of rotation towards the origin.
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.
return void

RotateFirstPerson() public method

Rotates the camera for first person and spectator behaviors. Pitching is limited to 90 degrees straight up and down.
public RotateFirstPerson ( float headingDegrees, float pitchDegrees ) : void
headingDegrees float Y axis rotation angle.
pitchDegrees float X axis rotation angle.
return void

RotateFlight() public method

Rotates the camera for flight behavior.
public RotateFlight ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void
headingDegrees float Y axis rotation angle.
pitchDegrees float X axis rotation angle.
rollDegrees float Z axis rotation angle.
return void

RotateOrbit() public method

Rotates the camera for orbit behavior. Rotations are either about the camera's local y axis or the orbit target's y axis. The property PreferTargetYAxisOrbiting controls which rotation method to use.
public RotateOrbit ( float headingDegrees, float pitchDegrees, float rollDegrees ) : void
headingDegrees float Y axis rotation angle.
pitchDegrees float X axis rotation angle.
rollDegrees float Z axis rotation angle.
return void

RotateX() public method

public RotateX ( float value ) : void
value float
return void

RotateY() public method

public RotateY ( float value ) : void
value float
return void

RotateZ() public method

public RotateZ ( float value ) : void
value float
return void

SetClipPlanes() public method

public SetClipPlanes ( float znear, float zfar ) : void
znear float
zfar float
return void

SetFieldOfView() public method

public SetFieldOfView ( float value ) : void
value float
return void

UndoRoll() public method

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.
public UndoRoll ( ) : void
return void

Zoom() public method

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.
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. ///
return void