Clamp shine parameter in range of 0..1
This commit is contained in:
parent
31f620d1bd
commit
e4cda1c751
@ -1,6 +1,7 @@
|
||||
package net.sf.openrocket.appearance;
|
||||
|
||||
import net.sf.openrocket.util.Color;
|
||||
import net.sf.openrocket.util.MathUtil;
|
||||
|
||||
/**
|
||||
* A component appearance.
|
||||
@ -9,21 +10,21 @@ import net.sf.openrocket.util.Color;
|
||||
* @author Bill Kuker <bkuker@billkuker.com>
|
||||
*/
|
||||
public class Appearance {
|
||||
public static final Appearance MISSING = new Appearance(new Color(0,0,0), 100, null);
|
||||
public static final Appearance MISSING = new Appearance(new Color(0, 0, 0), 100, null);
|
||||
|
||||
private final Color paint;
|
||||
private final double shine;
|
||||
private final Decal texture;
|
||||
|
||||
Appearance(final Color paint, final double shine, final Decal texture){
|
||||
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){
|
||||
Appearance(final Color paint, final double shine) {
|
||||
this.paint = paint;
|
||||
this.shine = shine;
|
||||
this.shine = MathUtil.clamp(shine, 0, 1);
|
||||
this.texture = null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user