Clamp shine parameter in range of 0..1

This commit is contained in:
Sampo Niskanen 2013-01-06 18:10:17 +02:00
parent 31f620d1bd
commit e4cda1c751

View File

@ -1,6 +1,7 @@
package net.sf.openrocket.appearance;
import net.sf.openrocket.util.Color;
import net.sf.openrocket.util.MathUtil;
/**
* A component appearance.
@ -17,13 +18,13 @@ public class Appearance {
Appearance(final Color paint, final double shine, final Decal texture) {
this.paint = paint;
this.shine = shine;
this.shine = MathUtil.clamp(shine, 0, 1);
this.texture = texture;
}
Appearance(final Color paint, final double shine) {
this.paint = paint;
this.shine = shine;
this.shine = MathUtil.clamp(shine, 0, 1);
this.texture = null;
}