[fix] Changed MassCalculator to compare 'MIN_MASS < ', instead of '0=='
This commit is contained in:
parent
cce900d408
commit
0dc259ab4e
@ -54,7 +54,7 @@ public class MassCalculation {
|
|||||||
// =========== Instance Functions ========================
|
// =========== Instance Functions ========================
|
||||||
|
|
||||||
public void merge( final MassCalculation other ) {
|
public void merge( final MassCalculation other ) {
|
||||||
if( 0 < other.getMass()) {
|
if( MIN_MASS < other.getMass()) {
|
||||||
// Adjust Center-of-mass
|
// Adjust Center-of-mass
|
||||||
this.addMass( other.getCM() );
|
this.addMass( other.getCM() );
|
||||||
this.bodies.addAll( other.bodies );
|
this.bodies.addAll( other.bodies );
|
||||||
@ -66,7 +66,7 @@ public class MassCalculation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addMass( final Coordinate pointMass ) {
|
public void addMass( final Coordinate pointMass ) {
|
||||||
if( 0 == this.centerOfMass.weight ){
|
if( MIN_MASS < this.centerOfMass.weight ){
|
||||||
this.centerOfMass = pointMass;
|
this.centerOfMass = pointMass;
|
||||||
}else {
|
}else {
|
||||||
this.centerOfMass = this.centerOfMass.average( pointMass);
|
this.centerOfMass = this.centerOfMass.average( pointMass);
|
||||||
@ -298,7 +298,7 @@ public class MassCalculation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( 0 < children.getMass() ) {
|
if( MIN_MASS < children.getMass() ) {
|
||||||
this.merge( children );
|
this.merge( children );
|
||||||
// // vvv DEBUG
|
// // vvv DEBUG
|
||||||
// System.err.println(String.format( "%s....assembly mass (incl/children): %s", prefix, this.toCMDebug()));
|
// System.err.println(String.format( "%s....assembly mass (incl/children): %s", prefix, this.toCMDebug()));
|
||||||
@ -398,7 +398,7 @@ public class MassCalculation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( 0 < children.getMass() ) {
|
if( MIN_MASS < children.getMass() ) {
|
||||||
this.merge( children );
|
this.merge( children );
|
||||||
//System.err.println(String.format( "%s....assembly mass (incl/children): %s", prefix, this.toCMDebug()));
|
//System.err.println(String.format( "%s....assembly mass (incl/children): %s", prefix, this.toCMDebug()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user