Bug fixed
This commit is contained in:
1 parent
612f835fea
commit
9cf9eab2a6
3 files changed
+28
-1
No files matched your search
@@ -265,8 +265,24 @@ function newFloatingLayer () {
|
||||
try {
|
||||
makeVisible()
|
||||
makeInvisible()
|
||||
invisiblePhysics()
|
||||
visiblePhysics()
|
||||
applyPhysics()
|
||||
|
||||
function invisiblePhysics () {
|
||||
for (let i = 0; i < invisibleFloatingObjects.length; i++) {
|
||||
let floatingObject = invisibleFloatingObjects[i]
|
||||
floatingObject.invisiblePhysics()
|
||||
}
|
||||
}
|
||||
|
||||
function visiblePhysics () {
|
||||
for (let i = 0; i < visibleFloatingObjects.length; i++) {
|
||||
let floatingObject = visibleFloatingObjects[i]
|
||||
floatingObject.physics()
|
||||
}
|
||||
}
|
||||
|
||||
function applyPhysics () {
|
||||
/* This function makes all the calculations to apply phisycs on all visible floatingObjects in this layer. */
|
||||
|
||||
@@ -276,7 +292,6 @@ function newFloatingLayer () {
|
||||
|
||||
for (let i = 0; i < visibleFloatingObjects.length; i++) {
|
||||
let floatingObject = visibleFloatingObjects[i]
|
||||
floatingObject.physics()
|
||||
|
||||
/* From here on, only if they are not too far. */
|
||||
if (canvas.floatingSpace.isItFar(floatingObject.payload)) { continue }
|
||||
|
||||
@@ -41,6 +41,7 @@ function newFloatingObject () {
|
||||
angleToParentToggle: angleToParentToggle,
|
||||
distanceToParentToggle: distanceToParentToggle,
|
||||
physics: physics,
|
||||
invisiblePhysics: invisiblePhysics,
|
||||
initializeMass: initializeMass,
|
||||
initializeRadius: initializeRadius,
|
||||
initializeImageSize: initializeImageSize,
|
||||
@@ -220,6 +221,12 @@ function newFloatingObject () {
|
||||
return thisObject.distanceToParent
|
||||
}
|
||||
|
||||
function invisiblePhysics () {
|
||||
if (thisObject.payload.uiObject !== undefined) {
|
||||
thisObject.payload.uiObject.invisiblePhysics()
|
||||
}
|
||||
}
|
||||
|
||||
function physics () {
|
||||
frozenPhysics()
|
||||
/* From here on, only if they are not too far. */
|
||||
|
||||
@@ -36,6 +36,7 @@ function newUiObject () {
|
||||
setPercentage: setPercentage,
|
||||
setStatus: setStatus,
|
||||
physics: physics,
|
||||
invisiblePhysics: invisiblePhysics,
|
||||
drawBackground: drawBackground,
|
||||
drawMiddleground: drawMiddleground,
|
||||
drawForeground: drawForeground,
|
||||
@@ -256,6 +257,10 @@ function newUiObject () {
|
||||
}
|
||||
}
|
||||
|
||||
function invisiblePhysics () {
|
||||
childrenRunningPhysics()
|
||||
}
|
||||
|
||||
function physics () {
|
||||
thisObject.menu.physics()
|
||||
thisObject.uiObjectTitle.physics()
|
||||
|
||||
Reference in new issue
Block a user