Re: Rectangle problem



"Stuart Brockman" <stuartbrockman@xxxxxxxxx> wrote in message
news:411a8485-865a-4975-a747-4217884e8670@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am currently writing a simple 2D game in C++ and I need an algorithm
to help me decide which areas of the screen need redrawing. Each of
the entities on screen that have updated in a particular frame add
themselves to a vector maintained by a "ScreenManager" class and I
have their bounding rectangles. Unfortunately, many of these entities
are overlapping and performance is an issue, so I am looking for an
algorithm to simplify the job to be done.

One possibility is the following.
http://www.geometrictools.com/SampleFoundation/BooleanIntervalRectangle/BooleanIntervalRectangle.html

--
Dave Eberly
http://www.geometrictools.com


.