So this has been bugging me for a long time, I have a lighting “handler” that takes in a collection of vector2f’s and draws quads going down from two points on them, looking like ray-casting. I wanted a way to make textures bind into the vector2f’s to make the lighting handler know what the texture is.
How it works is everything lit extends a mesh, the mesh has a array of vector2fs called “getVertices”.
Heres how I light a quad:
public Vector2f[] getVertices() {
return new Vector2f[] {
new Vector2f(position.x, position.y),
new Vector2f(position.x, position.y + size.y),
new Vector2f(position.x + size.x, position.y + size.y),
new Vector2f(position.x + size.x, position.y)
};
}