Advertisement

[java] Graphics2D

Started by October 25, 2000 09:07 PM
2 comments, last by koatto 24 years, 2 months ago
The Graphics class contains a method that checks if a shape and a rectangle are colliding. Is this method good int terms of performance? Does It perform a big number of calculations slowing down the overall speed of my program?
It''s good enough. What was that first rule of optimization... "Never optimize something that doesn''t work" or something like that. Because it uses objects it''s always going to perform more calculations that straight primatives. But it is sufficient enough to get your sprite engine in shape. If you want to implement your own, stripped-down rectangle class later you can.
Advertisement
Does anyone have any suggestions on how we might develop a performance test for the Java 2D collision detection (such as what should a test concentrate on - processor utilization during a fixed number of collision detections per second, maxmimum number of collision detections per second, etc...)?

What would be a ''typical'' C++ 2D sprite engine be able to achieve in collision detection performance?

What might be an acceptable level for a typical 2D game?
Why not simply use the x and y coords? It works fine...

/N
-- http://surf.to/natman
/N -- http://surf.to/natman

This topic is closed to new replies.

Advertisement