Package limn.render3d
Class Camera
java.lang.Object
limn.render3d.Camera
A perspective camera positioned by
eye/target/up.
Mutable so controllers (orbit/fly) can move it; the aspect ratio is supplied at
render time from the target's dimensions.
Right-handed, looking down −Z in view space. Distances are in scene units and angles in radians. The setters chain and mutate in place; a camera handed to a controller is the same object the renderer reads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclip(float near, float far) Sets the clip range.eye()Where the camera is.Moves the camera without changing what it looks at.floatfar()Far clip distance, in scene units.fovy(float radians) Sets the vertical field of view in radians; the horizontal one follows the aspect.floatVertical field of view, in radians.floatnear()Near clip distance, in scene units.projection(float aspect) The projection matrix for a viewport of the given width/height ratio.target()The point the camera looks at.Aims the camera at a point, keeping its position.up()The world-space up hint that fixes roll.Sets the up hint.view()The world-to-view matrix for the current eye, target and up.viewProjection(float aspect) projection(float)timesview(), which is what a shader usually wants.
-
Constructor Details
-
Camera
public Camera()
-
-
Method Details
-
eye
Where the camera is. -
eye
Moves the camera without changing what it looks at. -
target
The point the camera looks at. -
target
Aims the camera at a point, keeping its position. -
up
The world-space up hint that fixes roll. -
up
Sets the up hint. Must not be parallel to the eye-to-target direction, which would leave the view basis degenerate. -
fovyRadians
public float fovyRadians()Vertical field of view, in radians. -
fovy
Sets the vertical field of view in radians; the horizontal one follows the aspect. -
near
public float near()Near clip distance, in scene units. -
far
public float far()Far clip distance, in scene units. -
clip
Sets the clip range. Depth precision comes from the ratio far/near, so a near plane far smaller than the scene needs is what causes z-fighting, not a large far plane. -
view
The world-to-view matrix for the current eye, target and up. -
projection
The projection matrix for a viewport of the given width/height ratio. -
viewProjection
projection(float)timesview(), which is what a shader usually wants.
-