Skip to content
Snippets Groups Projects
Commit 40cc5fd4 authored by Richard Pajerský's avatar Richard Pajerský
Browse files

Changed transparency to float

parent ec62563b
No related branches found
No related tags found
No related merge requests found
...@@ -82,25 +82,25 @@ public class RegistrationCPEventListener { ...@@ -82,25 +82,25 @@ public class RegistrationCPEventListener {
public void setTransparency(int value) { public void setTransparency(int value) {
if (value == transparencyRange) { if (value == transparencyRange) {
setPrimaryTransparency(1d); setPrimaryTransparency(1);
setSecondaryTransparency(1d); setSecondaryTransparency(1);
} }
if (value < transparencyRange) { if (value < transparencyRange) {
setPrimaryTransparency(value / 10d); setPrimaryTransparency(value / 10f);
setSecondaryTransparency(1d); setSecondaryTransparency(1);
} }
if (value > transparencyRange) { if (value > transparencyRange) {
setSecondaryTransparency((2 * transparencyRange - value) / 10d); setSecondaryTransparency((2 * transparencyRange - value) / 10f);
setPrimaryTransparency(1d); setPrimaryTransparency(1);
} }
canvas.renderScene(); canvas.renderScene();
} }
public void setPrimaryTransparency(double transparency) { public void setPrimaryTransparency(float transparency) {
primaryFace.setTransparency(transparency); primaryFace.setTransparency(transparency);
} }
public void setSecondaryTransparency(double transparency) { public void setSecondaryTransparency(float transparency) {
secondaryFace.setTransparency(transparency); secondaryFace.setTransparency(transparency);
} }
......
...@@ -21,7 +21,7 @@ public class DrawableMesh { ...@@ -21,7 +21,7 @@ public class DrawableMesh {
// TO DO - R. Pajersky: add transformation attributes and methods // TO DO - R. Pajersky: add transformation attributes and methods
private Color color = new Color(255, 255, 255); private Color color = new Color(255, 255, 255);
private double transparency = 1f; private float transparency = 1;
private Vector3d translation = new Vector3d(0, 0, 0); private Vector3d translation = new Vector3d(0, 0, 0);
private Vector3d rotation = new Vector3d(0, 0, 0); private Vector3d rotation = new Vector3d(0, 0, 0);
private Vector3d scale = new Vector3d(0, 0, 0); private Vector3d scale = new Vector3d(0, 0, 0);
...@@ -78,11 +78,11 @@ public class DrawableMesh { ...@@ -78,11 +78,11 @@ public class DrawableMesh {
return color; return color;
} }
public double getTransparency() { public float getTransparency() {
return transparency; return transparency;
} }
public void setTransparency(double transparency) { public void setTransparency(float transparency) {
this.transparency = transparency; this.transparency = transparency;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment