Physics added to panels space

This commit is contained in:
Luis Fernando Molina committed 2019-10-08 08:58:32 +02:00
1 parent 052ab4d4ea
commit 8ffcf34e7f
3 files changed
+21

No files matched your search

+1
View File
@@ -121,6 +121,7 @@ function newCanvas () {
animation.addCallBackFunction('Chart Space Physics', thisObject.chartSpace.physics)
animation.addCallBackFunction('CockpitSpace Physics', thisObject.cockpitSpace.physics)
animation.addCallBackFunction('Strategy Space Physics', thisObject.strategySpace.physics)
animation.addCallBackFunction('Panels Space Physics', thisObject.panelsSpace.physics)
animation.addCallBackFunction('Floating Space Draw', thisObject.floatingSpace.draw)
animation.addCallBackFunction('Chart Space Background', thisObject.chartSpace.drawBackground)
+6
View File
@@ -5,6 +5,7 @@ function newProductsPanel () {
container: undefined,
productCards: [],
getLoadingProductCards: getLoadingProductCards,
physics: physics,
draw: draw,
getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
initialize: initialize
@@ -232,6 +233,11 @@ function newProductsPanel () {
}
}
function physics () {
if (isInitialized === false) { return }
console.log('PHYSICS!!!')
}
function draw () {
if (isInitialized === false) { return }
+14
View File
@@ -11,6 +11,7 @@ function newPanelsSpace () {
createNewPanel: createNewPanel,
destroyPanel: destroyPanel,
getPanel: getPanel,
physics: physics,
draw: draw,
panels: [],
getContainer: getContainer, // returns the inner most container that holds the point received by parameter.
@@ -104,6 +105,19 @@ function newPanelsSpace () {
}
}
function physics () {
if (thisObject.visible !== true) { return }
if (thisObject.panels !== undefined) {
for (let i = 0; i < thisObject.panels.length; i++) {
let panel = thisObject.panels[i]
if (panel.physics !== undefined) {
panel.physics()
}
}
}
}
function draw () {
if (thisObject.visible !== true) { return }