Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Graphics2D

Started by koatto Oct 25, 2000 at 9:07 PM 2 replies 650+ views
Original Post
koatto
koatto
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?
Jim_Ross
Jim_Ross
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.
Jerry Lynn
Jerry Lynn
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?
Natman
Natman
Why not simply use the x and y coords? It works fine...

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.