[quote]I am recreating the bounds cause what I need each frame is a translated and rotated version of the original area I created. I don’t know of another way to do this so its not applying the rotation/translation to the already rotated/translated Area. Heres an example of my problem: The ship needs to be rotated at 45 degrees, and I have this value stored in a variable, but I can’t just tell it to rotate 45 degrees each frame or it will just spin. I am probably going about this wrong. maybe instead of changing the value of some theta variable, I could actualy rotate the ship on keypress… I was just trying to use it in the same way I do with a Graphics context in Java2D, g.rotate(theta, width/2, height/2) each time the screen is rendered.
[/quote]
In GoSub, each of my bounds are transformed back to original rotation each frame using
try
{// resetting shape to its normal state, so next transform is not added to the current...
((java.awt.geom.Area)collisionShape).transform( transform.createInverse() );
}
catch ( java.awt.geom.NoninvertibleTransformException e )
{
e.printStackTrace();
}
It also creates an object, but it is immediatly collectable and never gets out of first generation, so is cheap. Your duplicate objects survive for too long to be interesting for Generational GC, which might be your problem, imho.
(in the code, ‘transform’ is the AffineTransform that is applied to that bound)