-
Notifications
You must be signed in to change notification settings - Fork 0
Math utilities
The math package contains various useful classes for dealing with problems in geometry, linear algebra, collision detection, interpolation, and common unit conversions.
The MathUtils (code) class covers a number of useful odds and ends. There is a handy static Random
member to avoid instantiating one in your own code. Using the same random instance throughout your code can also ensure consistently deterministic behavior as long as you store the seed value used. There are constants for conversion between radians and degrees as well as look-up tables for the sine and cosine functions. There are also float
versions of common java.lang.Math
functions to avoid having to cast down from double
.
A Calmull-Rom-spline (code) allows a continuous curve to be generated from a discrete list of control points. Splines can be useful for describing a smooth path of motion of a body or camera through space. Catmull-Rom splines are particularly useful in this regard as they are simple to compute and can guarantee the resulting path will pass through each control point (except the first and last points which control spline shape but do not become part of the path). Unlike Bezier splines, control tangents are implicit and control over spline shape is traded for ease of path definition. All that is required is a list of points through which the desired path must pass.
One way to triangulate a simple polygon is based on the fact that any simple polygon with at least four vertices and with no holes has at least two so called 'ears', which are triangles with two sides being the edges of the polygon and the third one completely inside it. The Ear-Clipping Triangulator (code) class implements this idea, producing a list of triangles from a list of supplied points representing a two-dimensional polygon. The input polygon may be concave and the resulting triangles have a clockwise order.
The Windowed Mean (code) class is useful for tracking the mean of a running stream of floating point values within a certain window. This can be useful for basic statistical analysis such as measuring average network speed, gauging user reaction times for dynamic difficulty adjustment, or energy-based beat detection in music visualizations.
-
Developer's Guide
- Introduction
- Goals & Features
- Community & Support
- Contributing
- Games Built with Libgdx
- Prerequisites
- Gradle Project Setup, Running, Debugging and Packaging
- Project Setup, Running & Debugging
- Third Party Services
- Working from Source
- Using libgdx with other JVM languages
- The Application Framework
- A Simple Game
- File Handling
- Networking
- Preferences
- Input Handling
- Memory Management
- Audio
-
Graphics
- Configuration & Querying Graphics ??
- Fullscreen & VSync
- Continuous & Non-Continuous Rendering
- Clearing the Screen
- Take a Screenshot
- OpenGL ES Support * Configuration & Querying OpenGL ?? * Direct Access ?? * Utility Classes * Rendering Shapes * Textures & TextureRegions * Meshes * Shaders * Frame Buffer Objects
- 2D Graphics * SpriteBatch, TextureRegions, and Sprite * 2D Animation * Clipping, with the use of ScissorStack * Orthographic camera * Mapping Touch Coordinates ?? * Viewports * NinePatches * Bitmap Fonts * Distance field fonts * Using TextureAtlases * Pixmaps * Packing Atlases Offline * Packing Atlases at Runtime * 2D Particle Effects * Tile Maps * scene2d * scene2d.ui * Skin
- 3D Graphics * Quick Start * Models * Material and environment * 3D animations and skinning * Importing Blender models in LibGDX * Perspective Camera ?? * Picking ??
- Managing Your Assets
- Utilities
-
Math Utilities
- Interpolation
- Vectors, Matrices, Quaternions
- Circles, Planes, Rays, etc.
- Path interface & Splines
- Bounding Volumes ??
- Intersection & Overlap Testing ??
- Physics
- Tools
- Extensions
- Deploying your Application
- Building Libgdx ??
- Known Issues
- Articles
- Deprecated (May be outdated)