Class Camera
Mutable orbit camera; angles are radians. Mutate and render on the same thread.
Inherited Members
Namespace: Simple3D.Core
Assembly: Simple3D.Core.dll
Syntax
public sealed class Camera
Constructors
| Edit this page View SourceCamera(float, float, float)
Creates an orbit camera with positive finite distance.
Declaration
public Camera(float distance = 5, float yaw = 0.55, float pitch = 0.35)
Parameters
| Type | Name | Description |
|---|---|---|
| float | distance | |
| float | yaw | |
| float | pitch |
Properties
| Edit this page View SourceDistance
Distance from target in world units.
Declaration
public float Distance { get; }
Property Value
| Type | Description |
|---|---|
| float |
FieldOfView
Vertical field of view in radians, strictly between .01 and 3.13.
Declaration
public float FieldOfView { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
NearPlane
Positive finite distance of the clipping plane from the eye.
Declaration
public float NearPlane { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
OrthographicHeight
Positive finite visible world height in orthographic mode.
Declaration
public float OrthographicHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Pitch
Vertical orbit angle, limited to avoid the poles.
Declaration
public float Pitch { get; }
Property Value
| Type | Description |
|---|---|
| float |
Projection
Perspective or orthographic projection.
Declaration
public CameraProjection Projection { get; set; }
Property Value
| Type | Description |
|---|---|
| CameraProjection |
Target
Finite orbit center.
Declaration
public Vector3 Target { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Yaw
Horizontal orbit angle in radians.
Declaration
public float Yaw { get; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
| Edit this page View SourceFitToScene(Scene, float, float)
Fits geometry bounds using a conservative enclosing sphere. Empty scenes do nothing; aspect is width/height. Overflowing fits throw without changing the camera.
Declaration
public void FitToScene(Scene scene, float aspectRatio = 1, float padding = 1.15)
Parameters
| Type | Name | Description |
|---|---|---|
| Scene | scene | |
| float | aspectRatio | |
| float | padding |
Orbit(float, float)
Adjusts orbit angles; nonfinite deltas are ignored for gesture compatibility.
Declaration
public void Orbit(float yawDelta, float pitchDelta)
Parameters
| Type | Name | Description |
|---|---|---|
| float | yawDelta | |
| float | pitchDelta |
Zoom(float)
Divides distance and orthographic height by a positive factor, clamped to .001..1e12; invalid factors are ignored.
Declaration
public void Zoom(float factor)
Parameters
| Type | Name | Description |
|---|---|---|
| float | factor |
Events
| Edit this page View SourceChanged
Raised synchronously once after an effective property change or completed camera operation.
Declaration
public event EventHandler? Changed
Event Type
| Type | Description |
|---|---|
| EventHandler |