Fix WebGL build (#2189)
This commit is contained in:
1
web/filament-js/filament.d.ts
vendored
1
web/filament-js/filament.d.ts
vendored
@@ -260,6 +260,7 @@ export class Camera {
|
||||
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 setCustomProjection(projection: mat4, near: number, far: number): void;
|
||||
public getProjectionMatrix(): mat4;
|
||||
public getCullingProjectionMatrix(): mat4;
|
||||
|
||||
@@ -522,7 +522,15 @@ class_<Camera>("Camera")
|
||||
self->setProjection(fovInDegrees, aspect, near, far, direction);
|
||||
}), allow_raw_pointers())
|
||||
|
||||
.function("setLensProjection", &Camera::setLensProjection)
|
||||
.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("setCustomProjection", EMBIND_LAMBDA(void, (Camera* self,
|
||||
flatmat4 m, double near, double far), {
|
||||
|
||||
@@ -44,6 +44,7 @@ function smoke_camera_frustum() {
|
||||
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.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