Skip to content

Commit

Permalink
Fix array based call to transformation.
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCailin committed Feb 10, 2024
1 parent 0306de4 commit 0f1bce9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,14 @@ public void setTransformation(MCTransformation transformation) {

@Override
public void setTransformationMatrix(float[] mtrxf) {
// Note that the order of the matrix is flipped about the identity of the
// matrix. This allows us to accept inputs that are the same order as the
// /data command would accept.
Matrix4f matrix = new Matrix4f(
mtrxf[0], mtrxf[1], mtrxf[2], mtrxf[3],
mtrxf[4], mtrxf[5], mtrxf[6], mtrxf[7],
mtrxf[8], mtrxf[9], mtrxf[10], mtrxf[11],
mtrxf[12], mtrxf[13], mtrxf[14], mtrxf[15]);
mtrxf[0], mtrxf[4], mtrxf[8], mtrxf[12],
mtrxf[1], mtrxf[5], mtrxf[9], mtrxf[13],
mtrxf[2], mtrxf[6], mtrxf[10], mtrxf[14],
mtrxf[3], mtrxf[7], mtrxf[11], mtrxf[15]);
this.d.setTransformationMatrix(matrix);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5137,7 +5137,13 @@ public Integer[] numArgs() {
@Override
public String docs() {
return "void {entityUUID, array} Sets the data for a display entity."
+ " See {{function|get_display_entity}} for details about the array format.";
+ " See {{function|get_display_entity}} for details about the array format. ---- "
+ " Note that there is one additional point for setting the data that is unique to"
+ " the set function, the '''transformation''' property can be provided in the same"
+ " format as recieved (i.e. with the leftRotation, rightRotation, scale, and translation"
+ " properties) but you can also provide it as a length 16 array of floats. These are"
+ " accepted in the same order that the /data command would accept them. Regardless of"
+ " how they are input, the function will always return the complex object.";
}

@Override
Expand Down

0 comments on commit 0f1bce9

Please sign in to comment.