Fix a bunch more issues arising from mutable types (#11769)
This commit is contained in:
@@ -27,9 +27,9 @@ public class Transformation {
|
||||
Preconditions.checkArgument(scale != null, "scale cannot be null");
|
||||
Preconditions.checkArgument(rightRotation != null, "rightRotation cannot be null");
|
||||
|
||||
this.translation = translation;
|
||||
this.translation = new Vector3f(translation);
|
||||
this.leftRotation = new Quaternionf(leftRotation);
|
||||
this.scale = scale;
|
||||
this.scale = new Vector3f(scale);
|
||||
this.rightRotation = new Quaternionf(rightRotation);
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ public class Transformation {
|
||||
Preconditions.checkArgument(scale != null, "scale cannot be null");
|
||||
Preconditions.checkArgument(rightRotation != null, "rightRotation cannot be null");
|
||||
|
||||
this.translation = translation;
|
||||
this.leftRotation = leftRotation;
|
||||
this.scale = scale;
|
||||
this.rightRotation = rightRotation;
|
||||
this.translation = new Vector3f(translation);
|
||||
this.leftRotation = new Quaternionf(leftRotation);
|
||||
this.scale = new Vector3f(scale);
|
||||
this.rightRotation = new Quaternionf(rightRotation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ public class Transformation {
|
||||
*/
|
||||
@NotNull
|
||||
public Vector3f getTranslation() {
|
||||
return this.translation;
|
||||
return new Vector3f(this.translation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +62,7 @@ public class Transformation {
|
||||
*/
|
||||
@NotNull
|
||||
public Quaternionf getLeftRotation() {
|
||||
return this.leftRotation;
|
||||
return new Quaternionf(this.leftRotation);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public class Transformation {
|
||||
*/
|
||||
@NotNull
|
||||
public Vector3f getScale() {
|
||||
return this.scale;
|
||||
return new Vector3f(this.scale);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ public class Transformation {
|
||||
*/
|
||||
@NotNull
|
||||
public Quaternionf getRightRotation() {
|
||||
return this.rightRotation;
|
||||
return new Quaternionf(this.rightRotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user