boatTex.bind(0);
//render enemies
for (int i = 0; i < enemies.size(); i++) {
Body box = enemies.get(i);
tmp.idt();
model.idt();
tmp.setToScaling(0.2f,0.2f,0.2f);
model.mul(tmp);
tmp.setToRotation(Vector3.X, 90);
model.mul(tmp);
Vector2 position = box.getPosition();
tmp.setToTranslation(-position.x+10, -position.y+10, -1f);
model.mul(tmp);
tmp.setToRotation(Vector3.Z, MathUtils.radiansToDegrees * box.getAngle());
model.mul(tmp);
diffuseShader.setUniformMatrix("MMatrix", model);
modelBoatObj.render(diffuseShader);
}
//render bullets
for (int i = 0; i < bullets.size(); i++) {
Body box = bullets.get(i);
tmp.idt();
model.idt();
tmp.setToScaling(0.2f,0.2f,0.2f);
model.mul(tmp);
tmp.setToRotation(Vector3.X, 90);
model.mul(tmp);
Vector2 position = box.getPosition();
tmp.setToTranslation(-position.x+10, -position.y+10, -1f);
model.mul(tmp);
tmp.setToScaling(0.2f,0.2f,0.2f);
model.mul(tmp);
tmp.setToRotation(Vector3.Z, MathUtils.radiansToDegrees * box.getAngle());
model.mul(tmp);
diffuseShader.setUniformMatrix("MMatrix", model);
modelCannonBallObj.render(diffuseShader);
}