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