First |
public class FirstPersonCamera : SphericalCamera, ICameraPositionCamera
The FirstPersonCamera type exposes the following members.
Name | Description | |
---|---|---|
FirstPersonCamera | Constructor |
Name | Description | |
---|---|---|
CameraPosition | Gets the position of the camera as Vector3. |
Name | Description | |
---|---|---|
GetCameraPosition |
Returns the current position of the camera.
(Overrides CameraGetCameraPosition) | |
GetLookDirection |
Returns the normalized look direction of the camera.
(Overrides CameraGetLookDirection) | |
GetUpDirection |
Returns the normalized up direction of the camera.
(Overrides CameraGetUpDirection) | |
MoveBackward | Moves the camera backward (in the opposite as look direction) | |
MoveCamera | Moves the camera for the moveVector (regardless of the current camera's LookDirection and UpDirection) | |
MoveDown | Moves the camera down (in the opposite up direction) | |
MoveFor | Animates the CameraPosition by changing it for the specified cameraPositionOffset. The animation takes animationDurationInMilliseconds and uses the specified easingFunction. | |
MoveForward | Moves the camera forward (in the look direction) | |
MoveLeft | Moves the camera left (strafe) | |
MoveRight | Moves the camera right (strafe) | |
MoveTo | Animates the CameraPosition to the finalTargetPosition. The animation takes animationDurationInMilliseconds and uses the specified easingFunction. | |
MoveUp | Moves the camera up (in the up direction) | |
RotateFor | Animates the camera rotation with changing the Camera's Heading and Attitude for the specified amount. The animation takes animationDurationInMilliseconds and uses easingFunction. | |
RotateTo | Animates the camera rotation to the targetHeading and targetAttitude. The animation takes animationDurationInMilliseconds and uses easingFunction. By default (when useShortestPath is true), the animation uses the shortest path to get to the target heading and attitude. | |
StrafeCamera | Strafes the camera - moves it in the direction perpendicular to the camera's LookDirection and UpDirection. | |
TurnToDirection | Turns the camera to the specified direction | |
TurnToPosition | Turns the camera to the direction of the specified position | |
Update |
Update method updates the camera matrices when needed (when there were any change in the camera properties) or when forceMatrixUpdate is set to true.
(Overrides CameraUpdate(Boolean)) |
FirstPersonCamera is a camera that simulates the person's view on the world. It is defined by the CameraPosition of the person and the direction of the camera - defined by Heading, Attitude and Bank properties.
The ShowCameraLight and the CameraLight properties can be used to add a CameraLight to the Scene. The CameraLight is a DirectionalLight is illuminating the scene looking from the position of the camera and in the camera's look direction. In the real world this would be a light that is mounted to the camera. This way the 3D objects that are viewed with the camera are always illuminated regardless of the cameras position.
The ShowCameraLight defines when the camera light is shown. The possible values are:
The First person camera defines methods to simplify the movement of "the person":
MoveForward(Single), MoveBackward(Single), MoveRight(Single), MoveLeft(Single), MoveDown(Single), MoveUp(Single), StrafeCamera(Single, Single, Single) and MoveCamera(Vector3).
The following code creates a FirstPersonCamera and assign it to the SceneView:
var firstPersonCamera = new FirstPersonCamera() { CameraPosition = new Vector3(0, 30, 200), Heading = 30, Attitude = -10 }; sceneView.Camera = firstPersonCamera;