Java Code Examples for com.badlogic.gdx.utils.NumberUtils#floatToIntBits()
The following examples show how to use
com.badlogic.gdx.utils.NumberUtils#floatToIntBits() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Version.java From gdx-texture-packer-gui with Apache License 2.0 | 5 votes |
@Override public int hashCode() { int result = (major != +0.0f ? NumberUtils.floatToIntBits(major) : 0); result = 31 * result + (minor != +0.0f ? NumberUtils.floatToIntBits(minor) : 0); result = 31 * result + (revision != +0.0f ? NumberUtils.floatToIntBits(revision) : 0); return result; }
Example 2
Source File: Tools.java From gdx-proto with Apache License 2.0 | 5 votes |
public static int writeFloatToBytes(float f, byte[] bytes, int offset) { int value = NumberUtils.floatToIntBits(f); bytes[0 + offset] = (byte) (value & 0xFF); bytes[1 + offset] = (byte) (value>>8 & 0xFF); bytes[2 + offset] = (byte) (value>>16 & 0xFF); bytes[3 + offset] = (byte) (value>>24 & 0xFF); // return next idx return offset + 4; }