diff --git a/assets/Data/entity/creatures/human.json b/assets/Data/entity/creatures/human.json index 2b402579..76004362 100644 --- a/assets/Data/entity/creatures/human.json +++ b/assets/Data/entity/creatures/human.json @@ -532,13 +532,18 @@ }, "pointLight" : { "const": 1.0, - "linear": 0.7, - "quadratic": 0.35, - "radius": 1.0, + "linear": 0.9, + "quadratic": 0.9, + "radius": 3.0, "color": { "x": 0.3, "y": 0.3, "z": 0.3 + }, + "offset": { + "x": 0.0, + "y": 0.6, + "z": 0.0 } }, "idleData": { diff --git a/assets/Data/entity/creatures/skeleton.json b/assets/Data/entity/creatures/skeleton.json index b8d5110e..20b52fed 100644 --- a/assets/Data/entity/creatures/skeleton.json +++ b/assets/Data/entity/creatures/skeleton.json @@ -416,13 +416,18 @@ }, "pointLight" : { "const": 1.0, - "linear": 0.7, - "quadratic": 0.35, - "radius": 1.0, + "linear": 0.9, + "quadratic": 0.9, + "radius": 3.0, "color": { "x": 0.3, "y": 0.3, "z": 0.3 + }, + "offset": { + "x": 0.0, + "y": 0.3, + "z": 0.0 } }, "idleData": { diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 95276e03..b95a2c09 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -812,6 +812,9 @@ Fix terrain editing across chunk borders on server - Also because the client doesn't scan border chunks to see if they should update Fix shader program bug with no-bone variants Particle Emitter work (it renders! it has management!) +Texture atlasing for particle system +Texture atlas caching +Point light offsets # TODO diff --git a/src/main/java/electrosphere/entity/state/light/ClientPointLightComponent.java b/src/main/java/electrosphere/entity/state/light/ClientPointLightComponent.java index f3434c22..68d4476c 100644 --- a/src/main/java/electrosphere/entity/state/light/ClientPointLightComponent.java +++ b/src/main/java/electrosphere/entity/state/light/ClientPointLightComponent.java @@ -36,7 +36,13 @@ public class ClientPointLightComponent implements BehaviorTree { @Override public void simulate(float deltaTime) { Vector3d entityPos = EntityUtils.getPosition(parent); - light.setPosition(new Vector3f((float)entityPos.x,(float)entityPos.y,(float)entityPos.z)); + Vector3d offset = null; + if(description.getOffset() != null){ + offset = new Vector3d(description.getOffset()); + } else { + offset = new Vector3d(); + } + light.setPosition(new Vector3f((float)entityPos.x,(float)entityPos.y,(float)entityPos.z).add((float)offset.x,(float)offset.y,(float)offset.z)); } /** diff --git a/src/main/java/electrosphere/game/data/common/light/PointLightDescription.java b/src/main/java/electrosphere/game/data/common/light/PointLightDescription.java index ab0aedfb..1f476693 100644 --- a/src/main/java/electrosphere/game/data/common/light/PointLightDescription.java +++ b/src/main/java/electrosphere/game/data/common/light/PointLightDescription.java @@ -1,5 +1,6 @@ package electrosphere.game.data.common.light; +import org.joml.Vector3d; import org.joml.Vector3f; /** @@ -32,6 +33,11 @@ public class PointLightDescription { */ Vector3f color; + /** + * The offset from the entity base to place the point light at + */ + Vector3d offset; + /** * Sets the constant attenuation factor * @param constant The constant attenuation factor @@ -112,4 +118,12 @@ public class PointLightDescription { return radius; } + /** + * Gets the offset from the base of the entity to place the point light at + * @return The offset + */ + public Vector3d getOffset(){ + return offset; + } + }