Package arc.util
Class Pack
java.lang.Object
arc.util.Pack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intbitmask(int bits, int mask, boolean b) static bytebyteByte(byte left, byte right) Packs two bytes with values 0-15 into one byte.static byte[]bytes(int i, byte[] result) The same array instance is returned each call.static bytebyteValue(boolean b) static intintBytes(byte[] array) Packs 4 bytes into an int.static intintBytes(byte b1, byte b2, byte b3, byte b4) static byteleftByte(byte value) static byteleftByte(short field) static intleftInt(long field) static shortleftShort(int field) static longlongInt(int x, int y) static longlongShorts(short[] s) static floatpackUv(float x, float y) Packs [0-1] texture coordinates or positions into a single float.static byterightByte(byte value) static byterightByte(short field) static intrightInt(long field) static shortrightShort(int field) static shortshortByte(byte left, byte right) static intshortInt(short left, short right) static short[]shorts(long i, short[] resultShort) The same array instance is returned each call.static intu(byte b) byte -> unsigned bytestatic longu(int b) int -> unsigned intstatic intu(short b) short -> unsigned short
-
Constructor Details
-
Pack
public Pack()
-
-
Method Details
-
packUv
public static float packUv(float x, float y) Packs [0-1] texture coordinates or positions into a single float. For use in VertexAttribute.packedTexCoords/packedPosition. -
u
public static int u(byte b) byte -> unsigned byte -
u
public static int u(short b) short -> unsigned short -
u
public static long u(int b) int -> unsigned int -
byteValue
public static byte byteValue(boolean b) -
shortInt
public static int shortInt(short left, short right) -
longInt
public static long longInt(int x, int y) -
byteByte
public static byte byteByte(byte left, byte right) Packs two bytes with values 0-15 into one byte. -
leftByte
public static byte leftByte(byte value) -
rightByte
public static byte rightByte(byte value) -
leftShort
public static short leftShort(int field) -
rightShort
public static short rightShort(int field) -
leftInt
public static int leftInt(long field) -
rightInt
public static int rightInt(long field) -
leftByte
public static byte leftByte(short field) -
rightByte
public static byte rightByte(short field) -
shortByte
public static short shortByte(byte left, byte right) -
bytes
public static byte[] bytes(int i, byte[] result) The same array instance is returned each call. -
shorts
public static short[] shorts(long i, short[] resultShort) The same array instance is returned each call. -
longShorts
public static long longShorts(short[] s) -
intBytes
public static int intBytes(byte b1, byte b2, byte b3, byte b4) -
intBytes
public static int intBytes(byte[] array) Packs 4 bytes into an int. -
bitmask
public static int bitmask(int bits, int mask, boolean b)
-