Commit Graph

11 Commits

Author SHA1 Message Date
Mathias Agopian
7afd5e5963 Camera API and documentation improvements
- getNear() and getCullingFar() now return doubles
- updated documentation
- all setProjection() calls can now throw (when enabled) and will
  do so if preconditions are not met (instead of setting a default
  projection).
- Frustum can now be logged on debug builds
2022-07-11 09:56:41 -07:00
Mathias Agopian
b5f9c66503 model/view matrices on Camera now use double precision
This PR only changes the API, internal storage and computation are 
still done in float, but this paves the way to double precision 
transforms.
2021-08-03 18:41:48 -07:00
Ben Doherty
5572ef8574 API CHANGE: remove some Camera, Engine, and View deprecated APIs (#3965) 2021-05-18 16:02:49 -07:00
Mathias Agopian
acb2da7759 Improvements to Camera APIs (#3701)
* move the focus distance from DofOptions to Camera

The DofOption parameter is now deprecated, but will still work if the
focus distance is not set on Camera.

* A few new helper APIs on Camera

- getFocalLength() which returns the focal length used internally for
  DoF computations.

- computeEffectiveFov() and computeEffectiveFocalLength() which can be
used to better simulate a real camera's FOV changes with the
focus distance.

Modified gltf_viewer so it uses the effective fov/focallendth when
DoF is active.

* simplify setLensProjection

We can call setProjection directly instead of converting to a fov
first, which ends up performing atan(tan(x)).

Also improve parameters names.
2021-03-25 15:22:19 -07:00
Mathias Agopian
e657921b5a Camera API improvements
- Add a "shift" parameter to Camera. This has the effect of translating
  the viewport, without changing its size. 
  This is an effect similar to using a shift lens.

- Camera::setScaling() now takes a double2 instead of double4, this is
  because scaling the result of the projection in the Z direction 
  can lead to very confusing problems -- it will essentially move the
  near/far planes, and we don't want to expose that as a public API.

- setCustomProjection() now allows to set a different projection for
  rendering and culling (useful for e.g. for using an infinite far 
  rendering projection matrix).
2021-03-10 16:01:29 -08:00
Ben Doherty
b786b486b6 Add getCullingProjectionMatrix JNI method (#2847) 2020-07-22 15:12:03 -07:00
Ben Doherty
94776a01b3 Add JNI bindings for gltfio camera (#2693) 2020-06-16 15:24:24 -07:00
Romain Guy
00629bac48 Add camera controls to gltf_viewer (#2188)
Exposure: shutter speed, aperture and ISO
Focal length

The shadow plane can now be toggled  at runtime.
2020-02-28 23:46:17 -08:00
Mathias Agopian
651ccb183e New mathfwd.h header
math/mathwfd.h forward declares all {mat|vec}{2|3|4}<> classes,
which allows us to remove their respective #include in a lot of
our public headers.
Our math headers are full of templates, so this should help build times
a bit.

Also we want to keep the public headers as minimalist as possible.
2020-02-12 15:30:13 -08:00
prideout
5ee359cf40 Move math namespace to fix #746. 2019-02-07 09:23:07 -08:00
Romain Guy
b3d758f3b3 Initial commit 2018-08-03 10:38:22 -07:00