use of net.minecraft.client.model.ModelRenderer in project Engine by VoltzEngine-Project.
the class FixedTechneModel method renderOnlyAroundPivot.
public void renderOnlyAroundPivot(double angle, double rotX, double rotY, double rotZ, String... groupNames) {
GL11.glPushMatrix();
setup();
bindTexture();
Iterator<Entry<String, ModelRenderer>> it = parts.entrySet().iterator();
while (it.hasNext()) {
Entry<String, ModelRenderer> entry = it.next();
for (String groupName : groupNames) {
if (entry.getKey().equalsIgnoreCase(groupName)) {
GL11.glPushMatrix();
ModelRenderer model = entry.getValue();
GL11.glTranslatef(model.rotationPointX / 16, model.rotationPointY / 16, model.rotationPointZ / 16);
GL11.glRotated(angle, rotX, rotY, rotZ);
GL11.glTranslatef(-model.rotationPointX / 16, -model.rotationPointY / 16, -model.rotationPointZ / 16);
model.render(0.0625f);
GL11.glPopMatrix();
}
}
}
GL11.glPopMatrix();
}
use of net.minecraft.client.model.ModelRenderer in project Trains-In-Motion-1.7.10 by EternalBlueFlame.
the class Bone method setAnglesToModels.
/**
* Sets the current angles of the Bone to the models attached to it.
*/
public void setAnglesToModels() {
for (ModelRenderer currentModel : models) {
Angle3D baseAngles = modelBaseRot.get(currentModel);
currentModel.rotateAngleX = baseAngles.angleX + absoluteAngles.angleX;
currentModel.rotateAngleY = baseAngles.angleY + absoluteAngles.angleY;
currentModel.rotateAngleZ = baseAngles.angleZ + absoluteAngles.angleZ;
currentModel.rotationPointX = (float) positionVector.xCoord;
currentModel.rotationPointY = (float) positionVector.yCoord;
currentModel.rotationPointZ = (float) positionVector.zCoord;
}
for (Bone node : childNodes) {
node.setAnglesToModels();
}
}
use of net.minecraft.client.model.ModelRenderer in project Trains-In-Motion-1.7.10 by EternalBlueFlame.
the class ModelRendererTurbo method render.
/**
* Renders the shape.
* @param worldScale the scale of the shape. Usually is 0.0625.
*/
public void render(float worldScale) {
if (field_1402_i & !showModel) {
return;
}
if (!compiled || forcedRecompile) {
compileDisplayList(worldScale);
}
if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) {
GL11.glPushMatrix();
GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale);
if (rotateAngleZ != 0.0F) {
GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F);
}
if (rotateAngleY != 0.0F) {
GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F);
}
if (rotateAngleX != 0.0F) {
GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F);
}
callDisplayList();
if (childModels != null) {
for (ModelRenderer model : childModels) {
model.render(worldScale);
}
}
GL11.glPopMatrix();
} else if (rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) {
GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale);
callDisplayList();
if (childModels != null) {
for (ModelRenderer model : childModels) {
model.render(worldScale);
}
}
GL11.glTranslatef(-rotationPointX * worldScale, -rotationPointY * worldScale, -rotationPointZ * worldScale);
} else {
callDisplayList();
if (childModels != null) {
for (ModelRenderer model : childModels) {
model.render(worldScale);
}
}
}
}
use of net.minecraft.client.model.ModelRenderer in project Railcraft by Railcraft.
the class ModelEngineTrunk method rotate.
public void rotate(float x, float y, float z) {
for (ModelRenderer renderer : renderers) {
renderer.rotateAngleX = x;
renderer.rotateAngleY = y;
renderer.rotateAngleZ = z;
}
}
use of net.minecraft.client.model.ModelRenderer in project Engine by VoltzEngine-Project.
the class FixedTechneModel method renderPart.
@Override
public void renderPart(String partName) {
ModelRenderer part = parts.get(partName);
if (part != null) {
GL11.glPushMatrix();
setup();
bindTexture();
part.render(0.0625f);
GL11.glPopMatrix();
}
}
Aggregations