Some minor things like an improved collision detection performance for ray-polygon collisions and some cleanup work. A major addition is the possibility to now build yourself a VertexController to modify vertices of already constructed objects. This is something that wasn't possible in jPCT before. The usage of the VertexController may not be very intuitive, but i'm planning to add a demo of that. For now, look at this source code to see a sample implementation:
public class DemoVertexController extends GenericVertexController {
int count;
DemoVertexController() {
count=0;
}
public void apply() {
SimpleVector[] srcMesh=this.getSourceMesh();
SimpleVector[] dstMesh=this.getDestinationMesh();
int size=this.getMeshSize();
for (int i=0; i<size; i++) {
float z=srcMesh[i].z;
float x=0.25f*(srcMesh[i].x+count);
float sin=(float) Math.sin(x);
dstMesh[i].z=sin*3f+z;
}
count++;
}
}
Yeah right! The VertexController stuff may sound more complicated than it really is when it comes to implementing one (note that this implementation skips updating the vertex normals, which is not quite correct).
Use your new controller like this:
IVertexController demoControl=new DemoVertexController();
Object3D obj=Primitives.getPlane(20,5);
myWorld.addObject(obj);
obj.setTexture("texture");
obj.build();
obj.getMesh().setVertexController(demoControl, IVertexController.PRESERVE_SOURCE_MESH);
Note that the call to build() has to be placed before the getMesh() to make sure that the normals are calculated. This isn't mentioned in the current docs, so i'm mentioning it here.
The result will be a plane whose vertices are being modified by the VertexController in realtime. Can't show it in motion ATM, so here's a quick and dirty picture of it (not that it's very impressive but it may help to understand what a VertexController is supposed to do):