How to make portals in jME?

Is it possible to make portals with jme? Something like: scenegraph A with a ‘blue portal’ connect with scenegraph B with ‘orange portal’? :smile:
And what about the bullet physics?

I’ve searched the forum but only found jme2 stuff…

I would try Render to Texture (or OffscreenRender or what it was called). Then your Portal will be like a texturized object with a dynamically changing texture.

Add a ghost control and if somebody walks through the Portal, teleport him to the other Portal.

The Problem is only with the Physics. Not the Player himself because you only need to pay attention to rotate him correctly after the Portal (i guess bettercharactercontrol already does).

But for like a block you need to use the ghostcontrol and then apply a force to the new Position in the normal direction of the Portal. That way the block will keep the speed he had whilst entering the Portal.

The only Problem is the half pushed cube as you’d have to split the spatial in someway

1 Like

Actually you could simply make a copy of the object, place it in the other physics space and copy its current linear and angular velocity, then at some point switch the controlled object and apply the velocities to the other one. (this is btw also a way you could make a partitioned physics space from multiple physics spaces)

1 Like