|
@@ -29,16 +29,17 @@ import { Camera } from './camera';
|
|
|
import { ParamDefinition as PD } from 'mol-util/param-definition';
|
|
|
import { BoundingSphereHelper } from './helper/bounding-sphere-helper';
|
|
|
|
|
|
-export const Canvas3DParams = {
|
|
|
+export const Canvas3DParams: PD.Params = {
|
|
|
// TODO: FPS cap?
|
|
|
// maxFps: PD.Numeric(30),
|
|
|
cameraPosition: PD.Vec3(Vec3.create(0, 0, 50)), // TODO or should it be in a seperate 'state' property?
|
|
|
- cameraMode: PD.Select('perspective', [['perspective', 'Perspective'], ['orthographic', 'Orthographic']]),
|
|
|
- backgroundColor: PD.Color(Color(0x000000)),
|
|
|
pickingAlphaThreshold: PD.Numeric(0.5, { min: 0.0, max: 1.0, step: 0.01 }, { description: 'The minimum opacity value needed for an object to be pickable.' }),
|
|
|
- debug: PD.Group({
|
|
|
- showBoundingSpheres: PD.Boolean(true, { description: 'Show bounding spheres of render objects.' }),
|
|
|
- })
|
|
|
+ backgroundColor: PD.Color(Color(0x000000)),
|
|
|
+ cameraMode: PD.Select('perspective', [['perspective', 'Perspective'], ['orthographic', 'Orthographic']]),
|
|
|
+ showBoundingSpheres: PD.Boolean(true, { description: 'Show bounding spheres of render objects.' }),
|
|
|
+ // debug: PD.Group({
|
|
|
+ // showBoundingSpheres: PD.Boolean(true, { description: 'Show bounding spheres of render objects.' }),
|
|
|
+ // })
|
|
|
}
|
|
|
export type Canvas3DParams = typeof Canvas3DParams
|
|
|
|
|
@@ -126,7 +127,7 @@ namespace Canvas3D {
|
|
|
let drawPending = false
|
|
|
let lastRenderTime = -1
|
|
|
|
|
|
- const boundingSphereHelper = new BoundingSphereHelper(scene, p.debug.showBoundingSpheres)
|
|
|
+ const boundingSphereHelper = new BoundingSphereHelper(scene, p.showBoundingSpheres)
|
|
|
|
|
|
function getLoci(pickingId: PickingId) {
|
|
|
let loci: Loci = EmptyLoci
|
|
@@ -377,8 +378,8 @@ namespace Canvas3D {
|
|
|
if (props.pickingAlphaThreshold !== undefined && props.pickingAlphaThreshold !== renderer.props.pickingAlphaThreshold) {
|
|
|
renderer.setPickingAlphaThreshold(props.pickingAlphaThreshold)
|
|
|
}
|
|
|
- if (props.debug && props.debug.showBoundingSpheres) {
|
|
|
- boundingSphereHelper.visible = props.debug.showBoundingSpheres
|
|
|
+ if (props.showBoundingSpheres !== undefined) {
|
|
|
+ boundingSphereHelper.visible = props.showBoundingSpheres
|
|
|
}
|
|
|
requestDraw(true)
|
|
|
},
|
|
@@ -389,9 +390,7 @@ namespace Canvas3D {
|
|
|
cameraMode: camera.state.mode,
|
|
|
backgroundColor: renderer.props.clearColor,
|
|
|
pickingAlphaThreshold: renderer.props.pickingAlphaThreshold,
|
|
|
- debug: {
|
|
|
- showBoundingSpheres: boundingSphereHelper.visible
|
|
|
- }
|
|
|
+ showBoundingSpheres: boundingSphereHelper.visible
|
|
|
}
|
|
|
},
|
|
|
get input() {
|