Skip to content
master
Switch branches/tags
Code

Latest commit

* Improve MathUtils.asin(), acos()

The average and largest error are significantly better for this version (2-3 orders of magnitude), and it can be slightly faster.

* Fix missing check for INDEX_ZERO in IntIntMap, IntFloatMap.

This fixes #6347 . Thanks @tomcashman , for making this an easy fix!

* Mark key/value/entry/iterator fields as transient.

This stops a bad StackOverflowException from happening when some Map or Set types are iterated over and then written with Json. That happens in all stable versions I've tried between 1.9.6 and 1.9.13, on at least IntIntMap but probably also IntFloatMap and ObjectLongMap.

A better alternative would be to add special-case Json handling like IntMap, ObjectIntMap, and LongMap have for the other primitive-backed maps, since that would make the output much cleaner, smaller, and more readable. At one point, the special-case handling I wrote was in my PR that introduced these updated data structrures, but adding that was overruled, and the serialization code was removed without `transient` being added in its place to fields that cause problems during "vanilla" serialization.

* Fix getIndices() crash in Mesh, credit to Agueliethun

This was probably a copy/paste error, but the getIndices() code mistakenly changed the vertices buffer where it formerly changed only the indices buffer. This caused crashes in ModelCacheTest when the Cache checkbox was selected and any model was added.

* First, the test that shows an issue...

Thanks to Discord user vladimir for finding a remaining part of an issue with IntMap and LongMap, this time in the iterator() of their Values (maybe also Keys) when using remove() . Here, the sizes aren't as expected after over 9K items have been placed (actualSize is 9282 when the problem happens, but the correct value is 9283).

* In IntMap/LongMap, null out zeroValue when it is removed.

This seems to be relevant to the return value when you `put(0, something)` after that 0-key has already been put and removed. I think this fixes vladimir's bug with the Values iterator().

* Improve precision for MathUtils.sinDeg(180f)

This particular right angle was given special treatment by MathUtils, but was still wrong, yielding -8.742278E-8 instead of 0. I think the updated code is actually less complex, because it doesn't risk a difference between the double-precision radians that Math.sin() expects and the single-precision radians MathUtils can provide it. I also added tests for sinDeg() and cosDeg(), which would have failed before because of the extremely low tolerance they use.

* Shorten comment.

* MathUtilsTest checks for exact trig values.
388590e

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Apr 18, 2021

logo

GitHub Actions build status

Sonatype Nexus (Releases) Sonatype Nexus (Snapshots)

Discord Chat

Cross-platform Game Development Framework

libGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser. It provides a well-tried and robust environment for rapid prototyping and fast iterations. LibGDX does not force a specific design or coding style on you, it rather gives you the freedom to create a game the way you like it.

Open Source, Feature Packed and Offering a Big Third-Party Ecosystem

libGDX is licensed under Apache 2.0 meaning you can use it free of charge, without strings attached in commercial and non-commercial projects. We, however, love to get (non-mandatory) credit in case you release a game or app using libGDX! See our showcase for a selection of some popular libGDX games. libGDX comes with batteries included and provides everything required to develop multi-platform 2D and 3D games with Java.

libGDX also offers a very extensive third-party ecosystem. There are numerous tools and libraries that take a lot of work off the hands of developers. Take a look at awesome-libgdx for a curated list of libGDX-centered libraries and a good starting point for anyone new in the libGDX world.

An example for a game created with libGDX: Pathway by Robotality. Find more games in our Showcase.

Getting libGDX / Documentation

As we switched to Gradle, there's no need to download libGDX itself anymore: this can all be done by your favorite build tool. We also offer a setup tool, which automatically creates a project for you and downloads everything necessary. See our website for instructions on how to get started with this or read our wiki.

We also provide javadocs online. The javadocs are also bundled as source Jars with every libGDX distribution for consumption in your favorite IDE.

Community & Contributing

You can follow the latest news about libGDX on our blog. Another good way to get in touch with our community is to join the official libGDX Discord.

Reporting Issues

Use the Issue Tracker here on GitHub to report issues. Please make sure you read the Getting Help article that walks you through the process of properly reporting an issue.

Working on the Code

libGDX has a strong developer community constantly improving the code base. We love to get any and all help we can. Our Contributing Guidelines describe the process of helping libGDX to become even better. To contribute, you need to work with libGDX' sources directly, something normal users do not have to go through. The Working with the Source article will give you some directions.

You can also contribute financially to our infrastructure (build server, web server, test devices) via our Patreon!

Supported By

libGDX is supported by helpful 3rd parties via code contributions, free licenses, test devices and so forth. Make our supporters happy and visit their sites!

RoboVM
Saikoa intel Software Partner
Excelsior JET
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.