Node Children Implemented

This commit is contained in:
Luis Fernando Molina committed 2019-07-03 11:10:23 +02:00
1 parent 543dd3da3b
commit d7bdf28055
3 files changed
+366 -5

No files matched your search

+9
View File
@@ -170,12 +170,21 @@ function newFloatingObject () {
}
function tensionPhysics () {
/* Tension Inheritance */
if (thisObject.tensedManually === false) {
let parent = thisObject.payload.chainParent
if (parent !== undefined) {
thisObject.isTensed = parent.payload.floatingObject.isTensed
}
}
/* Tension Effect */
if (thisObject.isTensed === true) {
let parent = thisObject.payload.chainParent
if (parent !== undefined) {
let distanceToChainParent = Math.sqrt(Math.pow(parent.payload.position.x - thisObject.container.frame.position.x, 2) + Math.pow(parent.payload.position.y - thisObject.container.frame.position.y, 2)) // ... we calculate the distance ...
}
}
}
function thisObjectPhysics () {