classpublicfinalPriority 3
Vec3f
com.hypixel.hytale.math.Vec3f
2
Methods
2
Public Methods
3
Fields
2
Constructors
Constants
intSIZE= 12
Constructors
public
Vec3f(float x, float y, float z)public
Vec3f()Methods
Public Methods (2)
public
void serialize(ByteBuf buf)public
String toString()@Override
Fields
Public Fields (3)
public
float xpublic
float ypublic
float zSource Code
package com.hypixel.hytale.math;
import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
public final class Vec3f {
public static final int SIZE = 12;
public float x;
public float y;
public float z;
public Vec3f(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
}
public Vec3f() {
}
@Nonnull
public static Vec3f deserialize(@Nonnull ByteBuf buf, int offset) {
return new Vec3f(
Float.intBitsToFloat(buf.getIntLE(offset)), Float.intBitsToFloat(buf.getIntLE(offset + 4)), Float.intBitsToFloat(buf.getIntLE(offset + 8))
);
}
public void serialize(@Nonnull ByteBuf buf) {
buf.writeIntLE(Float.floatToRawIntBits(this.x));
buf.writeIntLE(Float.floatToRawIntBits(this.y));
buf.writeIntLE(Float.floatToRawIntBits(this.z));
}
@Override
public String toString() {
return "Vec3f(" + this.x + ", " + this.y + ", " + this.z + ")";
}
}