Remove broken setLensProjection API (#2192)
This commit is contained in:
@@ -18,7 +18,7 @@ A new header is inserted each time a *tag* is created.
|
||||
- Added Java bindings for geometry::SurfaceOrientation.
|
||||
- Fixed bug rendering transparent objects with Metal backend.
|
||||
- Fixed crash on macOS Catalina when rendering with Metal backend.
|
||||
- Fixed bug in Camera::setLensProjection() and added a variant that accepts an aspect ratio.
|
||||
- Fixed bug in Camera::setLensProjection() and added the aspect ratio parameter. (⚠ API Change)
|
||||
- WebGL: Improved TypeScript annotations.
|
||||
- WebGL: Simplified callback API for glTF. (⚠ API Change)
|
||||
|
||||
|
||||
@@ -225,30 +225,6 @@ public class Camera {
|
||||
nSetProjectionFov(getNativeObject(), fovInDegrees, aspect, near, far, direction.ordinal());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the projection matrix from the focal length for a 35mm sensor.
|
||||
*
|
||||
* @param focalLength lens's focal length in millimeters. <code>focalLength</code> > 0
|
||||
*
|
||||
* @param near distance in world units from the camera to the near plane.
|
||||
* The near plane's position in view space is z = -<code>near</code>.
|
||||
* Precondition:
|
||||
* <code>near</code> > 0 for {@link Projection#PERSPECTIVE} or
|
||||
* <code>near</code> != <code>far</code> for {@link Projection#ORTHO}.
|
||||
*
|
||||
* @param far distance in world units from the camera to the far plane.
|
||||
* The far plane's position in view space is z = -<code>far</code>.
|
||||
* Precondition:
|
||||
* <code>far</code> > <code>near</code>
|
||||
* for {@link Projection#PERSPECTIVE} or
|
||||
* <code>far</code> != <code>near</code>
|
||||
* for {@link Projection#ORTHO}.
|
||||
*
|
||||
*/
|
||||
public void setLensProjection(double focalLength, double near, double far) {
|
||||
nSetLensProjection(getNativeObject(), focalLength, 36.0 / 24.0, near, far);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the projection matrix from the focal length.
|
||||
*
|
||||
|
||||
@@ -189,17 +189,6 @@ public:
|
||||
void setProjection(double fovInDegrees, double aspect, double near, double far,
|
||||
Fov direction = Fov::VERTICAL) noexcept;
|
||||
|
||||
/** Sets the projection matrix from the focal length. The aspect ratio is fixed
|
||||
* to that of a 35mm sensor.
|
||||
*
|
||||
* @param focalLength lens's focal length in millimeters. \p focalLength > 0.
|
||||
* @param near distance in world units from the camera to the near plane. \p near > 0.
|
||||
* @param far distance in world units from the camera to the far plane. \p far > \p near.
|
||||
*/
|
||||
void setLensProjection(double focalLength, double near, double far) noexcept {
|
||||
setLensProjection(focalLength, 36.0 / 24.0, near, far);
|
||||
}
|
||||
|
||||
/** Sets the projection matrix from the focal length.
|
||||
*
|
||||
* @param focalLength lens's focal length in millimeters. \p focalLength > 0.
|
||||
|
||||
3
web/filament-js/filament.d.ts
vendored
3
web/filament-js/filament.d.ts
vendored
@@ -259,8 +259,7 @@ export class Camera {
|
||||
top: number, near: number, far: number): void;
|
||||
public setProjectionFov(fovInDegrees: number, aspect: number,
|
||||
near: number, far: number, fov: Camera$Fov): void;
|
||||
public setLensProjection(focalLength: number, near: number, far: number): void;
|
||||
public setLensProjectionWithAspect(focalLength: number, aspect: number, near: number, far: number): void;
|
||||
public setLensProjection(focalLength: number, aspect: number, near: number, far: number): void;
|
||||
public setCustomProjection(projection: mat4, near: number, far: number): void;
|
||||
public getProjectionMatrix(): mat4;
|
||||
public getCullingProjectionMatrix(): mat4;
|
||||
|
||||
@@ -522,15 +522,7 @@ class_<Camera>("Camera")
|
||||
self->setProjection(fovInDegrees, aspect, near, far, direction);
|
||||
}), allow_raw_pointers())
|
||||
|
||||
.function("setLensProjectionWithAspect", EMBIND_LAMBDA(void, (Camera* self,
|
||||
double focalLength, double aspect, double near, double far), {
|
||||
self->setLensProjection(focalLength, aspect, near, far);
|
||||
}), allow_raw_pointers())
|
||||
|
||||
.function("setLensProjection", EMBIND_LAMBDA(void, (Camera* self,
|
||||
double focalLength, double near, double far), {
|
||||
self->setLensProjection(focalLength, near, far);
|
||||
}), allow_raw_pointers())
|
||||
.function("setLensProjection", &Camera::setLensProjection)
|
||||
|
||||
.function("setCustomProjection", EMBIND_LAMBDA(void, (Camera* self,
|
||||
flatmat4 m, double near, double far), {
|
||||
|
||||
@@ -43,8 +43,7 @@ function smoke_camera_frustum() {
|
||||
const camera: Filament.Camera = engine.createCamera();
|
||||
camera.setProjection(Filament.Camera$Projection.ORTHO, 0, 1, 0, 1, 0, 1);
|
||||
camera.setProjectionFov(45, 1.0, 0.0, 1.0, Filament.Camera$Fov.HORIZONTAL);
|
||||
camera.setLensProjection(0, 1, 2);
|
||||
camera.setLensProjectionWithAspect(0, 0.33, 1, 2);
|
||||
camera.setLensProjection(0, 0.33, 1, 2);
|
||||
camera.setCustomProjection(m4, 0, 1);
|
||||
const m5 = camera.getProjectionMatrix() as glm.mat4;
|
||||
const m6 = camera.getCullingProjectionMatrix() as glm.mat4;
|
||||
|
||||
Reference in New Issue
Block a user