Class StrategyCamera
- Namespace
- OmegaEngine.Graphics.Cameras
- Assembly
- OmegaEngine.dll
A RTS-style camera with a rotateable horizontal view and an automatic vertical angle.
public class StrategyCamera : MatrixCamera, IPositionable
- Inheritance
-
StrategyCamera
- Implements
- Inherited Members
- Extension Methods
Constructors
StrategyCamera(double, double, float, float, Func<DoubleVector3, double>)
Creates a new strategy camera.
public StrategyCamera(double minRadius, double maxRadius, float minAngle, float maxAngle, Func<DoubleVector3, double> heightController)
Parameters
minRadius
doubleThe minimum radius allowed. Also used as the initial radius
maxRadius
doubleThe maximum radius allowed.
minAngle
floatThe minimum vertical angle in degrees. Effective when Radius is equal to MinRadius.
maxAngle
floatThe maximum vertical angle in degrees. Effective when Radius is equal to MaxRadius.
heightController
Func<DoubleVector3, double>This delegate is called to control the minimum height of the strategy camera based on its 2D coordinates.
Properties
HorizontalRotation
The horizontal rotation in degrees.
public float HorizontalRotation { get; set; }
Property Value
Remarks
Must be a real number.
MaxAngle
public float MaxAngle { get; set; }
Property Value
Remarks
Must be a real number.
MaxRadius
The maximum radius allowed.
public double MaxRadius { get; set; }
Property Value
Remarks
Must be a positive real number.
MinAngle
public float MinAngle { get; set; }
Property Value
Remarks
Must be a real number.
MinRadius
The minimum radius allowed.
public double MinRadius { get; set; }
Property Value
Remarks
Must be a positive real number.
Radius
The distance between the camera and the center of the focues object.
public double Radius { get; set; }
Property Value
Remarks
Must be a positiv real number.
Target
The position the camera is looking at.
public override DoubleVector3 Target { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The coordinates lie outside the range of the height-controlling terrain.
Methods
PerspectiveChange(float, float, float, float)
Called when the user changes the view perspective.
public override void PerspectiveChange(float panX, float panY, float rotation, float zoom)
Parameters
panX
floatThe number of pixels panned along the X-axis divided by the number of pixels of the longest side of the viewport.
panY
floatThe number of pixels panned along the Y-axis divided by the number of pixels of the longest side of the viewport.
rotation
floatHorizontal rotation in degrees.
zoom
floatScaling factor; 1 for no change, must not be 0.
UpdateView()
Update cached versions of View and related matrices.
protected override void UpdateView()