.9 beta

.9 beta is in and we are within throwing distance of a final release.



In this release:


  • All bounding classes now extend BoundingVolume (which is now an abstract class instead of an interface.)  This means that bounds do not have the extra overhead of also containing vertices, normals, etc.  Can you hear that mem footprint drop?  :slight_smile:


  • OBB2 and OrientedBoundingBox were folded into a single class called OrientedBoundingBox.


  • drawBounds is no longer part of renderer and onDrawBounds is no longer part of Spatial.


  • There is a new class in jme.util.geom called Debugger.  Use the static methods in there to draw bounds or normals for an object (some code from the short lived class NormalDebugger was folded in there.)  The Debugger does not touch your scene graph or create new objects, so it is a fairly cheap tool to use.


  • The Line and Point classes have been upgraded in many ways.  Now they also use vertex arrays and such instead of glBegin, glVert, etc.  You can also set Line widths, Point sizes, Line stipple patterns and factors, Line and Point antialiasing and choose from 3 modes of line drawing (segments, loop or connected.)


  • Some fixes have been added to the renderer to improve performance on lower end cards.


  • A ClodMesh bug introduced in .9a is now fixed.

I get an error in physicsEntityFactory on (has a todo):



geometry = (Geometry) geometry.getModelBound();



fix?

What is the error you are receiving?



darkfrog

cannot cast from Bounding volume to geometry



also on a bunch of others that do the same thing.

BoundingVolume bv = jmeMesh.getModelBound();

if (bv instanceof BoundingSphere) {

return createSphere((Sphere) bv, obj, jmeMesh );

} else if (bv instanceof BoundingBox) {

return createBox((Box) bv, obj, jmeMesh );

} else if (bv instanceof OrientedBoundingBox) {

return createOrientedBox((OrientedBox) bv, obj, jmeMesh );

} else {

// trimesh doesn't have a bounding box, throw an exception

throw new JmeException("Trimesh (" + jmeGeo.getName()

  • ") does not have a bounding volume.");

    }



    Same casting errors.



    I'd have a look at it it but I'm busy retrofitting the cull changes to my codebase atm.

Please keep in mind what I said above.  BoundingVolumes are NOT Geometry classes anymore, they are pure math.

Instead of just casting to Geometry, you'll have to use the Bounding's values to build new Geometry.



If it's just those two areas, it should be easy. Let us know if you need help converting the physics library.


I think it will be a relatively simple fix.  Probably just a cast occurring can be changed and everything will work…I hope. :o  I'll try to take a look at it tonight or tomorrow night unless someone else gets around to it first.



darkfrog

mojomonk said:

Instead of just casting to Geometry, you'll have to use the Bounding's values to build new Geometry.

If it's just those two areas, it should be easy. Let us know if you need help converting the physics library.




mmm...a hint would be nice. I don't have my mind reading cap on:-)

Instead of casting… create the new Geometry. About as explicit a hint you can get :wink:



instead of casting:



geometry = (Geometry) geometry.getModelBound();



create the new Geometry:



if(geometry.getModelBound().getType() == BoundingVolume.BOUND_SPHERE) {

    geometry = new Sphere("blah', izSamples, radialSamples, ((BoundingSphere)geometry.getModelBound()).getRadius());

}



etc etc

How are you dealing with Spatial ID's now? You were going to make them integers instead of strings?

Turns out some people were using the Strings for some game logic. So, for now, they are staying as is.

Hmm, okey… but isn't it better to change it now if you're planning on doing so in the future (it sounded a bit like that on your tone :))? If you wait, even more people will "use them for game logic".



I'm really not taking any side here – I think either way is good. I guess that for games with tons of entities you won't use a scenegraph anyway…

sometime we'll put in a solution that will allow for current behavior with a second option for better memory. Right now, you can just pass in null for the name if you want.