Quad Help, jme2 -> jme3

Hello, I’m wondering if someone can assist me in a problem I’m having porting my game from jme2 over to jme3 which is proving to be quite frustrating.

In jme2, I would create a Quad and be able to call simply player setLocalTranslation(x,y,z). Rotations I would do would all work great because the origin for the Quad seemed to be at the absolute center.

In jme3, my code ported straight over does not work the same. In simply calling setLocalTranslation(x,y,z), it seems that the origin of the Quad is the bottom left hand corner…which is causing havoc with all my rotation code!

Why the change? Is there a way to set the origin of my Quad back to absolute center? It seems odd that I’d have to do that explicitly…why the change in behavior in jme3?

I’d appreciate any feedback on this issue.



I should mention, I would add the Quad to a Node and call setLocalTranslation on the node (not call setLocalTranslation on the Quad).

The change is that Mesh and Geometry are separate now, which they werent in jME2. So only a Geometry with a Mesh is the same as the old TriMesh etc.

But I wonder why not add the ability to shift the mesh in the quad so that the coords are relative to a zero center? Like a mesh-translate method. Seems rather costly to create a Node for each quad just to get it positioned at the right center, especially if you build up a model using many quads which I do atm.

Except it’s really not hard to replace that vertexes in the quad with your own shifted ones. It would be convenient to have a method but really the JME shapes are meant to be very basic because beyond that you should be creating your own meshes.

For example, in your case, building up a model with quads is extremely expensive when you could just be building one custom mesh. How many quads are in your model?

Animation does exactly that, as does the new BatchNode.