restructured rendering, added Tweener & smoothMove

This commit is contained in:
STEINNI
2025-09-27 11:40:33 +00:00
parent 69c9034d73
commit dd3b4f32f4
10 changed files with 967 additions and 146 deletions
-70
View File
@@ -1,70 +0,0 @@
class MainDashboardView extends EICDomContent {
//TODO should come from the API, from some sprites lib. (allow switching representations)
agentTypes = {
molecule1:{
"type": "Mesh",
"geometry": { "type": "BoxGeometry", "args": [1, 1, 1] },
"material": { "type": "MeshStandardMaterial", "color": "orange" },
"children": [
{
"type": "Mesh",
"geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] },
"material": { "type": "MeshStandardMaterial", "color": "blue" },
"position": [0, 0.5, 0]
}
]
},
molecule2:{
"type": "Mesh",
"geometry": { "type": "SphereGeometry", "args": [1, 1, 1] },
"material": { "type": "MeshStandardMaterial", "color": "green" },
"children": [
{
"type": "Mesh",
"geometry": { "type": "SphereGeometry", "args": [0.3, 16, 16] },
"material": { "type": "MeshStandardMaterial", "color": "red" },
"position": [0, 1, 0]
}
]
}
}
constructor() {
super()
Object.assign(this, app.helpers.activeAttributes)
//this.tileMarkup = app.Assets.Store.html['/app/assets/html/mailing/tile.html']
}
DOMContentFocused(options) {
// Avoid 2nd refesh on DomContentLoaded
if(this.wasBlured){
//this.refreshyoustuff()
}
this.wasBlured = false
}
DOMContentBlured(options) { this.wasBlured = true }
DOMContentLoaded(options) {
for(let model in options.models) this[model] = options.models[model]
const components = ui.eicfy(this.el)
this.setupTriggers(components)
this.setupRefs(components)
this.ttb = new app.LoadedModules.Threetobus(this.outputs.paper43)
this.ttb.initScene()
this.ttb.startRendering(options.mode)
const m1 = this.ttb.buildFromJSON(this.agentTypes.molecule1)
m1.name = 'toto'
this.ttb.scene.add(m1)
}
}
app.registerClass('MainDashboardView', MainDashboardView)
@@ -4,10 +4,10 @@
height:100%;
background-color: #333;
}
canvas[data-output="paper43"]{
canvas[data-output="ttbCanvas"]{
width: 100%;
height: 100%;
}
</style>
<canvas data-output="paper43"></canvas>
<canvas data-output="ttbCanvas"></canvas>
+34
View File
@@ -0,0 +1,34 @@
class SpaceView extends EICDomContent {
constructor() {
super()
Object.assign(this, app.helpers.activeAttributes)
//this.tileMarkup = app.Assets.Store.html['/app/assets/html/mailing/tile.html']
}
DOMContentFocused(options) {
if(this.wasBlured){ // Avoid 2nd refesh on DomContentLoaded
//this.refreshyoustuff()
}
this.wasBlured = false
}
DOMContentBlured(options) { this.wasBlured = true }
DOMContentLoaded(options) {
for(let model in options.models) this[model] = options.models[model]
this.ttb = options.ttb
const components = ui.eicfy(this.el)
this.setupTriggers(components)
this.setupRefs(components)
this.ttb.startRendering(this.outputs.ttbCanvas, options.mode)
}
}
app.registerClass('SpaceView', SpaceView)