Transforming a box

hi there,



i am new on programming jME and i have a problem with a simple box ;).

I want to make a simple game, the player can drive a car (just have control about right and left moves).

Where the car was driven there is growing up a wall and the player should not crash against it.

At startup the box(wall) get the translation (position?) of the vehicle. The vehicle is driveing away and the box now should follow in the direction by expanding x or z. How can i do this? I have tried to change the values of the box by "setData". For the first parameter i set the translation of the vehicle from startup, but then the box is far away from this location. Also my box expand in poitive and negative x/z direction. Maybe its just a math issue on my site :wink:

I hope i have explained my situation as good as i can.

Good to Know: The vehicle just can turn in 90

So you want to move your box (box.setLocalTranslation(x,y,z)) or increase the size of the box ?

To rebuild your box, instead of setData() try to use updateGeometry(), setData() is deprecated.

okay thanks :wink:

i want to resize my box



Amun-Re

i have not found a command for resizing the box and the command updateGeometry() is not available.

so how  i can resize a box ?



Amun-Re

Its there in the current version: http://www.jmonkeyengine.com/doc/com/jme/scene/shape/Box.html



What version of jme do you use?

i dont know :wink: i think i am useing version 2.0,because i have downloaded jME by the CVS.

I have also a problem with the Method summary from "http://www.jmonkeyengine.com/doc/com/jme/scene/shape/Box.html".

My eclipse dont want to compile when i am using this command :frowning:

Amun-Re said:

i dont know ;) i think i am useing version 2.0,because i have downloaded jME by the CVS.
I have also a problem with the Method summary from "http://www.jmonkeyengine.com/doc/com/jme/scene/shape/Box.html".
My eclipse dont want to compile when i am using this command :(

No you're using JME 1 as only JME 1 is on CVS, JME 2 is on SVN.

okay than i 'll update my jME and test these commands.

By the way is jME 2.0 stable?

Amun-Re