I'm thinking of something like the following. The idea would be to use the Java2D things like the contains methods when your world (like my QG game) is 2D...
Object3D something = ...;
VertexController somethingController = new VertexController(something);
SimpleVector[] worldSpaceVectors = somethingController.getWorldSpaceVertices();
Camera camera = world.getCamera();
java.awt.Polygon 2dPoly = Interact2D.getPolygon(worldSpaceVectors, camera);
class VertexController extends GenericVertexController {
private Object3D theObject;
public VertexController(Object3D theObject) {
super.init(theObject.getMesh(), true);
this.theObject = theObject;
}
public SimpleVector[] getWorldspaceVertices() {
SimpleVector[] vertices = getSourceMesh(), wsVertices = new SimpleVector[vertices.length];
for (int i = 0; i < vertices.length; i++) {
wsVertices[i] = vertices[i];
wsVertices[i].matMul(theObject.getWorldTransformation());//Object3D.getMesh() RETURNS THE MESH (OBJECTSPACE)
}
return wsVertices;
}
public void apply() {}
}