Creating a Player Node

@zarch said:
So the obvious approach is to do just that, create the ship, put the player inside, move the ship around.

Okay, I know that but if I move the ship around my player is going to bounce, and this whole topic is about that, if I attach the player to the ship node and use CharacterControl... Well let's just say Control and Nodes don't like each other.

Another 2 questions made up now, hopefully you can answer at least one:
1) Can I create a camera that I don't look through but I see what it sees on a 3D screen (example: A security camera in the game)
2) Is it possible to make a screen (a block or something) that you can change its text (example: In game console that shows sensor info)
@ivandonat said:
Well let's just say Control and Nodes don't like each other.


Just to clarify for anyone stumbling across this thread later. The above statement is totally false.

CharacterControl may not have the behavior you like but Controls and Nodes generally get along just fine.
  1. Create a physics object to guide the camera.
  2. Nifty has a console element built-in.



    http://nifty-gui.sourceforge.net/webstart/nifty-default-controls-examples-1.3.1.jnlp
@glaucomardano said:
1) Create a physics object to guide the camera.
2) Nifty has a console element built-in.

http://nifty-gui.sourceforge.net/webstart/nifty-default-controls-examples-1.3.1.jnlp

Thanks

If your ship is a node in the “main” world physics space then you just need to make the spatial with the character part of the ship physics space and set it to local physics and then attach it to the ship and it will be like you want it.



pseudo-code:

[java]

//boarding ship

worldPhysicsSpace.remove(character);

character.setApplyPhysicsLocal(true);

character.setPhysicsLocation(shipDoorLocation);

shipNode.attachChild(characterSpatial);

shipPhysicsSpace.add(character);



//leaving ship

shipPhysicsSpace.remove(character);

character.setApplyPhysicsLocal(false);

character.setPhysicsLocation(worldDoorLocation);

rootNode.attachChild(characterSpatial);

worldPhysicsSpace.add(character);

[/java]

@ivandonat said:
Thanks


Be aware that the nifty embedding trick works well but is not super-fast. It would be fine for one or two things (for example a main screen inside the starship) but you wouldn't want to use it for hundreds (for example a street full of animated billboards).