Geometry

From Slick2D Wiki
Revision as of 16:53, 8 August 2013 by Sigtau (Talk | contribs)

Jump to: navigation, search

Slick provides some simple geometry classes in the org.newdawn.slick.geom package. These classes were originally intended for basic collision detection but the basic rendering Graphics class has been extended to include rendering of the primitives at user's request.

It is not recommended that you render using primitives like rectangles, circles and polygons. While it is possible to render these shapes it isn't particularly efficient to do so in OpenGL especially as lines and so it's recommended that you use images where possible.

The following shapes are implemented/being implemented:

Each of these shapes is designed to be used (eventually) for collision though at the current time they're under development. Note that by far the most efficient collision checking to be using is circle vs circle, so where possible it's recommended you use circles or collections of circle to approximate your collision shapes.