Skip to content

Commit

Permalink
Update ImageAnnotationData to include opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Moulberry committed Sep 4, 2024
1 parent a148993 commit 0c59cea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "com.moulberry.axiom"
version = "4.0.0"
version = "4.0.1"
description = "Serverside component for Axiom on Paper"

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.joml.Quaternionf;
import org.joml.Vector3f;

public record ImageAnnotationData(String imageUrl, Vector3f position, Quaternionf rotation, Direction direction, float fallbackYaw, float width, int billboardMode) implements AnnotationData {
public record ImageAnnotationData(String imageUrl, Vector3f position, Quaternionf rotation, Direction direction, float fallbackYaw, float width, float opacity, int billboardMode) implements AnnotationData {

@Override
public void setPosition(Vector3f position) {
Expand All @@ -31,6 +31,7 @@ public void write(FriendlyByteBuf friendlyByteBuf) {
friendlyByteBuf.writeByte(this.direction.get3DDataValue());
friendlyByteBuf.writeFloat(this.fallbackYaw);
friendlyByteBuf.writeFloat(this.width);
friendlyByteBuf.writeFloat(this.opacity);
friendlyByteBuf.writeByte(this.billboardMode);
}

Expand All @@ -46,8 +47,9 @@ public static ImageAnnotationData read(FriendlyByteBuf friendlyByteBuf) {
Direction direction = Direction.from3DDataValue(friendlyByteBuf.readByte());
float fallbackYaw = friendlyByteBuf.readFloat();
float width = friendlyByteBuf.readFloat();
float opacity = friendlyByteBuf.readFloat();
int billboardMode = friendlyByteBuf.readByte();
return new ImageAnnotationData(imageUrl, new Vector3f(x, y, z), new Quaternionf(rotX, rotY, rotZ, rotW), direction, fallbackYaw, width, billboardMode);
return new ImageAnnotationData(imageUrl, new Vector3f(x, y, z), new Quaternionf(rotX, rotY, rotZ, rotW), direction, fallbackYaw, width, opacity, billboardMode);
}

}

0 comments on commit 0c59cea

Please sign in to comment.