96 lines
2.5 KiB
JavaScript
96 lines
2.5 KiB
JavaScript
class DashboardsController extends EICController {
|
|
|
|
constructor(params) {
|
|
super(params)
|
|
this.agentDefs = app.Assets.Store.json.agentDefs
|
|
this.eventsMapping = app.Assets.Store.json.eventsMapping
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @returns
|
|
*/
|
|
index() {
|
|
const models = {
|
|
}
|
|
|
|
const ttb = new app.LoadedModules.Threetobus({
|
|
eventsMapping: this.eventsMapping,
|
|
})
|
|
ttb.initScene({
|
|
axes: true,
|
|
grid: true,
|
|
})
|
|
|
|
console.log('===CTRL molecule1==>', this.agentDefs.molecule1)
|
|
const m1 = ttb.buildFromJSON('agent42', this.agentDefs.molecule1)
|
|
ttb.scene.add(m1)
|
|
// setTimeout(() => {
|
|
// ttb.smoothRelMove({
|
|
// object: m1,
|
|
// dX: 5,
|
|
// dY:0,
|
|
// dZ:0,
|
|
// delay: 1500,
|
|
// easing: 'Quadratic',
|
|
// easingMode: 'InOut',
|
|
// })
|
|
// },3000)
|
|
|
|
//TODO : side switches
|
|
// window.addEventListener('keydown', (e) => {
|
|
// if (e.key.toLowerCase() === 'g') {
|
|
// ttb.grid.visible = !grid.visible
|
|
// }
|
|
// if (e.key.toLowerCase() === 'a') {
|
|
// ttb.axes.visible = !axes.visible
|
|
// }
|
|
// })
|
|
|
|
|
|
this.loadWindow(
|
|
'visualisers/SpaceView',
|
|
{
|
|
title: '3D view',
|
|
static: true,
|
|
expanded: false,
|
|
windowStyle:{
|
|
width: '800px',
|
|
height: '600px',
|
|
left: '50px',
|
|
top: '100px',
|
|
}
|
|
},
|
|
{
|
|
models: models,
|
|
agentDefs: this.agentDefs,
|
|
rendererId:'3drenderer',
|
|
mode: '3D',
|
|
ttb: ttb,
|
|
}
|
|
)
|
|
this.loadWindow(
|
|
'visualisers/SpaceView',
|
|
{
|
|
title: '2D View',
|
|
static: true,
|
|
expanded: false,
|
|
windowStyle:{
|
|
width: '600px',
|
|
height: '450px',
|
|
right:'10px',
|
|
top:'100px',
|
|
}
|
|
},
|
|
{
|
|
models: models,
|
|
agentDefs: this.agentDefs,
|
|
rendererId:'2drenderer',
|
|
mode: '2D',
|
|
ttb: ttb,
|
|
}
|
|
)
|
|
}
|
|
}
|
|
|
|
app.registerClass('DashboardsController', DashboardsController); |