Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
81 lines
1.5 KiB
Java
81 lines
1.5 KiB
Java
package electrosphere.renderer.light;
|
|
|
|
import org.joml.Vector3f;
|
|
|
|
/**
|
|
* Data about a point light
|
|
*/
|
|
public class PointLight {
|
|
Vector3f position;
|
|
float constant;
|
|
float linear;
|
|
float quadratic;
|
|
float radius;
|
|
Vector3f color;
|
|
|
|
public void setPosition(Vector3f position) {
|
|
this.position = position;
|
|
}
|
|
|
|
public void setConstant(float constant) {
|
|
this.constant = constant;
|
|
}
|
|
|
|
public void setLinear(float linear) {
|
|
this.linear = linear;
|
|
}
|
|
|
|
public void setQuadratic(float quadratic) {
|
|
this.quadratic = quadratic;
|
|
}
|
|
|
|
public void setRadius(float radius){
|
|
this.radius = radius;
|
|
}
|
|
|
|
public void setColor(Vector3f color){
|
|
this.color = color;
|
|
}
|
|
|
|
public Vector3f getPosition() {
|
|
return position;
|
|
}
|
|
|
|
public float getConstant() {
|
|
return constant;
|
|
}
|
|
|
|
public float getLinear() {
|
|
return linear;
|
|
}
|
|
|
|
public float getQuadratic() {
|
|
return quadratic;
|
|
}
|
|
|
|
public Vector3f getColor(){
|
|
return color;
|
|
}
|
|
|
|
public float getRadius(){
|
|
return radius;
|
|
}
|
|
|
|
public PointLight(Vector3f position){
|
|
this.position = position;
|
|
radius = 1;
|
|
constant = 1.0f;
|
|
linear = 0.7f;
|
|
quadratic = 1.8f;
|
|
color = new Vector3f(1.0f);
|
|
}
|
|
|
|
public PointLight(Vector3f position, Vector3f color){
|
|
this.position = position;
|
|
radius = 1;
|
|
constant = 1.0f;
|
|
linear = 0.7f;
|
|
quadratic = 1.8f;
|
|
this.color = color;
|
|
}
|
|
} |