public void update() { super.update(); uniformBuffer.mapMemory(BufferUtil.createByteBuffer(getWorldTransform().getWorldMatrix())); }
pushConstants.put(BufferUtil.createByteBuffer(getLocalTransform().getWorldMatrix())); pushConstants.put(BufferUtil.createByteBuffer(getWorldTransform().getWorldMatrixRTS())); pushConstants.putFloat(terrainProperties.getVerticalScaling());
public void updateUniforms(Renderable object) { setUniform("modelViewProjectionMatrix", object.getWorldTransform().getModelViewProjectionMatrix()); setUniform("worldMatrix", object.getWorldTransform().getWorldMatrix()); } }
public UIElement(int xPos, int yPos, int xScaling, int yScaling){ super(); setOrthographicMatrix(new Matrix4f().Orthographic2D()); getWorldTransform().setTranslation(xPos, yPos, 0); getWorldTransform().setScaling(xScaling, yScaling, 0); setOrthographicMatrix(getOrthographicMatrix().mul(getWorldTransform().getWorldMatrix())); }
public GLButton(int xPos, int yPos, int xScaling, int yScaling, Mesh panelMesh){ super(xPos, yPos, xScaling, yScaling); pos = new Vec2f[4]; shader = UITextPanelShader.getInstance(); vao = new GUIVAO(); config = new DefaultRenderParams(); vao.addData(panelMesh); Vec4f q0 = new Vec4f(0,0,0,0); Vec4f q1 = new Vec4f(0,0,0,0); Vec4f q2 = new Vec4f(0,0,0,0); Vec4f q3 = new Vec4f(0,0,0,0); q0 = getWorldTransform().getWorldMatrix().mul(new Vec4f(panelMesh.getVertices()[0].getPosition(),1)); q1 = getWorldTransform().getWorldMatrix().mul(new Vec4f(panelMesh.getVertices()[1].getPosition(),1)); q2 = getWorldTransform().getWorldMatrix().mul(new Vec4f(panelMesh.getVertices()[2].getPosition(),1)); q3 = getWorldTransform().getWorldMatrix().mul(new Vec4f(panelMesh.getVertices()[3].getPosition(),1)); pos[0] = new Vec2f(q0.getX(),q0.getY()+5); pos[1] = new Vec2f(q1.getX(),q1.getY()+5); pos[2] = new Vec2f(q2.getX()-7,q2.getY()-5); pos[3] = new Vec2f(q3.getX()-7,q3.getY()-5); }
texturePanel0.setTexture(new Texture2DBilinearFilter("textures/lens_flare/tex4.png")); texturePanel0.getOrthoTransform().setScaling(200,200,0); texturePanel0.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel0.getOrthoTransform().getWorldMatrix())); texturePanel0.setSpacing(0.06f); texturePanel0.setBrightness(0.2f); texturePanel1.setTexture(new Texture2DBilinearFilter("textures/lens_flare/tex01.png")); texturePanel1.getOrthoTransform().setScaling(400,400,0); texturePanel1.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel1.getOrthoTransform().getWorldMatrix())); texturePanel1.setSpacing(0.0f); texturePanel1.setBrightness(0.4f); texturePanel2.setTexture(new Texture2DBilinearFilter("textures/lens_flare/tex2.png")); texturePanel2.getOrthoTransform().setScaling(250,250,0); texturePanel2.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel2.getOrthoTransform().getWorldMatrix())); texturePanel2.setSpacing(0.2f); texturePanel2.setBrightness(0.25f); texturePanel3.setTexture(new Texture2DBilinearFilter("textures/lens_flare/tex7.png")); texturePanel3.getOrthoTransform().setScaling(200,200,0); texturePanel3.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel3.getOrthoTransform().getWorldMatrix())); texturePanel3.setSpacing(0.4f); texturePanel3.setBrightness(0.2f); texturePanel4.setTexture(new Texture2DBilinearFilter("textures/lens_flare/tex5.png")); texturePanel4.getOrthoTransform().setScaling(100,100,0); texturePanel4.setOrthographicMatrix(new Matrix4f().Orthographic2D().mul(texturePanel4.getOrthoTransform().getWorldMatrix())); texturePanel4.setSpacing(0.6f); texturePanel4.setBrightness(0.2f);
pushConstants.put(BufferUtil.createByteBuffer(getWorldTransform().getWorldMatrix())); pushConstants.flip();
Vec2f location = ((TerrainNode) object).getLocation(); setUniform("localMatrix", object.getLocalTransform().getWorldMatrix()); setUniform("worldMatrix", object.getWorldTransform().getWorldMatrix());
ubo.put(BufferUtil.createByteBuffer(getWorldTransform().getWorldMatrix())); ubo.flip();
pushConstants.put(BufferUtil.createByteBuffer(getWorldTransform().getWorldMatrix())); pushConstants.putFloat(waterConfiguration.getWindDirection().getX()); pushConstants.putFloat(waterConfiguration.getWindDirection().getY());
Vec2f location = ((TerrainNode) object).getLocation(); setUniform("localMatrix", object.getLocalTransform().getWorldMatrix()); setUniform("worldMatrix", object.getWorldTransform().getWorldMatrix());
public void updateUniforms(Renderable object) setUniform("worldMatrix", object.getWorldTransform().getWorldMatrix()); setUniform("eyePosition", BaseContext.getCamera().getPosition());
- lensFlareTexture.getOrthoTransform().getScaling().getY()/2f); lensFlareTexture.setOrthographicMatrix( new Matrix4f().Orthographic2D().mul(lensFlareTexture.getOrthoTransform().getWorldMatrix()));
setUniform("worldMatrix", object.getWorldTransform().getWorldMatrix());