You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanna combine some nodes who have already add into the scene to a root and apply the transform to the root directly so that I didnot need to apply the transform to each of them. And I just have a simple try to set the connection as below:
val tmManager = engine.transformManager
val rootEntity = EntityManager.get().create()
scene.addEntity(rootEntity)
val entity1 = EntityManager.get().create()
scene.addEntity(entity1)
val entity2 = EntityManager.get().create()
scene.addEntity(entity2)
val entity3 = EntityManager.get().create()
scene.addEntity(entity3)
val entity4 = EntityManager.get().create()
scene.addEntity(entity4)
tmManager.setParent(entity1, rootEntity)
tmManager.setParent(entity2, rootEntity)
tmManager.setParent(entity3, rootEntity)
tmManager.setParent(entity4, rootEntity)
val r1 = tmManager.getParent(entity1)
val r2 = tmManager.getParent(entity2)
val r3 = tmManager.getParent(entity3)
val r4 = tmManager.getParent(entity4)
Timber.i("delete after check: root entity: ${rootEntity}, e1: ${entity1}, e2: ${entity2}, e3:${entity3}, e4: ${entity4}, r1:${r1} , r2:${r2} ,r3:${r3} ,r4:${r4}")
and I'm confused that I did nothing except set rootEntity as the root to entity14, but the result is all of the r1r4 printed out is 0 after the code executed. This is the reuslt printed out: delete after check: root entity: 5359, e1: 5360, e2: 5361, e3:5362, e4: 5363, r1:0 , r2:0 ,r3:0 ,r4:0 .It shows that I failed to set entity1~4's parent to the rootEntity. May I know what's mistake I have made and thanks so much!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I wanna combine some nodes who have already add into the scene to a root and apply the transform to the root directly so that I didnot need to apply the transform to each of them. And I just have a simple try to set the connection as below:
and I'm confused that I did nothing except set rootEntity as the root to entity1
4, but the result is all of the r1r4 printed out is 0 after the code executed. This is the reuslt printed out: delete after check: root entity: 5359, e1: 5360, e2: 5361, e3:5362, e4: 5363, r1:0 , r2:0 ,r3:0 ,r4:0 .It shows that I failed to set entity1~4's parent to the rootEntity. May I know what's mistake I have made and thanks so much!Beta Was this translation helpful? Give feedback.
All reactions