Files
P42_UI/app/controllers/dashboard/DashboardsController.js
T

79 lines
2.1 KiB
JavaScript

class DashboardsController extends EICController {
constructor(params) {
super(params)
this.arenaConfig = app.Assets.Store.json.arenaConfig
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,
sceneSize: this.arenaConfig.arenaSize,
})
ttb.initScene({
axes: true,
grid: true,
})
const m1 = ttb.agentFromJSON('agent42', this.agentDefs.molecule1)
ttb.scene.add(m1)
//TODO: eventsMapping: address child by suffix in assignations
this.loadWindow(
'visualisers/SpaceView',
{
title: '3D view',
static: true,
expanded: false,
withSettings: true,
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,
withSettings: true,
windowStyle:{
width: '600px',
height: '450px',
right:'10px',
top:'100px',
}
},
{
models: models,
agentDefs: this.agentDefs,
rendererId:'2drenderer',
mode: '2D',
ttb: ttb,
}
)
}
}
app.registerClass('DashboardsController', DashboardsController);