How to use scene composer and physics controller

i try to add some physics control to some ball in single scene and link it to another scene, then i try to move the ball position to some position and save it but after closing scene composer and open it again the ball position back to 0,0,0. did i doing something wrong here ?

1 Like

Thats probably a bug/feature in the SDK:
A Model has a position and a physical Location.
The Position gets overriden each time the Physics Change, so go to the Properties Panel and modify the Physics location

yeah, I have fixed it for jMB on editor level, but I have no idea how to fix it on engine level :frowning:

Well you would have to rewrite every control.
But still then you can’t, it’s a feature to separate the visualization from the actual physics object position (you might want to offset it or something).

It’s just something you have to know and then it’s no problem.
It’s also why it’s not in the SDK yet (maybe with a toggle switch would be an idea, so the user knows when he’s editing the physics position and when the location).

A common use case would be networking btw: you might set the new physics location and then have the local translation be an interpolation

i think by default when physics controller loaded from j3o it’s must copy current location to motion state as initial transform ? maybe i:smile: ?

Aren’t they all…aren’t they all… :wink:

1 Like

I think that when we attach a spatial with physics control to a node, the control should refresh it’s physical position, because it seems like “object spawn” in games, but now a developer should does it manually.

you can use the method resetPhysicsControlPositions() from:

after loading your scene, it will synchronize physical position with world position.

Just set the physics object location and not the spatial location. It will be saved.

When I tested it, it wasn’t saved.

I tested JMB and it didn’t start. That doesn’t say much.

1 Like