Rename parachute naming leftover
This commit is contained in:
parent
a0c7851ffb
commit
4290ff298b
@ -53,10 +53,10 @@ public abstract class MassObject extends InternalComponent {
|
|||||||
@Override
|
@Override
|
||||||
public double getLength() {
|
public double getLength() {
|
||||||
if (this.autoRadius) {
|
if (this.autoRadius) {
|
||||||
// Calculate the parachute volume using the non auto radius and the non auto length, and transform that back
|
// Calculate the volume using the non auto radius and the non auto length, and transform that back
|
||||||
// to the auto radius situation to get the auto radius length (the volume in both situations is the same).
|
// to the auto radius situation to get the auto radius length (the volume in both situations is the same).
|
||||||
double parachuteVolume = Math.pow(this.radius, 2) * this.length; // Math.PI left out, not needed
|
double volume = Math.pow(this.radius, 2) * this.length; // Math.PI left out, not needed
|
||||||
return parachuteVolume / Math.pow(getRadius(), 2);
|
return volume / Math.pow(getRadius(), 2);
|
||||||
}
|
}
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
@ -93,10 +93,10 @@ public abstract class MassObject extends InternalComponent {
|
|||||||
|
|
||||||
length = Math.max(length, 0);
|
length = Math.max(length, 0);
|
||||||
if (this.autoRadius) {
|
if (this.autoRadius) {
|
||||||
// Calculate the parachute volume using the auto radius and the new "auto" length, and transform that back
|
// Calculate the volume using the auto radius and the new "auto" length, and transform that back
|
||||||
// to the non auto radius situation to set this.length (the volume in both situations is the same).
|
// to the non auto radius situation to set this.length (the volume in both situations is the same).
|
||||||
double parachuteVolume = Math.pow(getRadius(), 2) * length; // Math.PI left out, not needed
|
double volume = Math.pow(getRadius(), 2) * length; // Math.PI left out, not needed
|
||||||
double newLength = parachuteVolume / Math.pow(this.radius, 2);
|
double newLength = volume / Math.pow(this.radius, 2);
|
||||||
if (MathUtil.equals(this.length, newLength))
|
if (MathUtil.equals(this.length, newLength))
|
||||||
return;
|
return;
|
||||||
this.length = newLength;
|
this.length = newLength;
|
||||||
@ -168,8 +168,8 @@ public abstract class MassObject extends InternalComponent {
|
|||||||
autoRadius = auto;
|
autoRadius = auto;
|
||||||
|
|
||||||
// Set the length
|
// Set the length
|
||||||
double parachuteVolume = (Math.PI * Math.pow(getRadius(), 2) * length);
|
double volume = (Math.PI * Math.pow(getRadius(), 2) * length);
|
||||||
length = parachuteVolume / (Math.PI * Math.pow(getRadius(), 2));
|
length = volume / (Math.PI * Math.pow(getRadius(), 2));
|
||||||
|
|
||||||
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
|
fireComponentChangeEvent(ComponentChangeEvent.BOTH_CHANGE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user