fix: shadow JS<->WASM bridge methods
This commit is contained in:
@@ -135,8 +135,8 @@ class ThermionViewerJSDartBridge {
|
||||
.loadGlb(path, numInstances: numInstances)
|
||||
.then((entity) => entity.toJS)
|
||||
.catchError((err) {
|
||||
print("Error: $err");
|
||||
}).toJS;
|
||||
print("Error: $err");
|
||||
}).toJS;
|
||||
}
|
||||
|
||||
@JSExport()
|
||||
@@ -720,4 +720,20 @@ class ThermionViewerJSDartBridge {
|
||||
{JSFunction? callback, bool affectsTransform = false}) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@JSExport()
|
||||
JSPromise setShadowsEnabled(bool enabled) {
|
||||
return viewer.setShadowsEnabled(enabled).toJS;
|
||||
}
|
||||
|
||||
@JSExport()
|
||||
JSPromise setShadowType(int shadowType) {
|
||||
return viewer.setShadowType(ShadowType.values[shadowType]).toJS;
|
||||
}
|
||||
|
||||
@JSExport()
|
||||
JSPromise setSoftShadowOptions(
|
||||
double penumbraScale, double penumbraRatioScale) {
|
||||
return viewer.setSoftShadowOptions(penumbraScale, penumbraRatioScale).toJS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ class ThermionViewerJS implements ThermionViewer {
|
||||
|
||||
@override
|
||||
Future setShadowType(ShadowType shadowType) {
|
||||
return _shim.setShadowType(shadowType).toDart;
|
||||
return _shim.setShadowType(shadowType.index).toDart;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -412,7 +412,7 @@ extension type ThermionViewerJSShim(JSObject _) implements JSObject {
|
||||
|
||||
@JS('setShadowType')
|
||||
external JSPromise setShadowType(
|
||||
ShadowType shadowType);
|
||||
int shadowType);
|
||||
|
||||
@JS('setSoftShadowOptions')
|
||||
external JSPromise setSoftShadowOptions(
|
||||
|
||||
Reference in New Issue
Block a user