Skip to content

Commit

Permalink
small changes to alt model
Browse files Browse the repository at this point in the history
  • Loading branch information
theoxylo committed May 9, 2012
1 parent 7f8c1cf commit 40e1b3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Binary file modified project/resources/thx/helicopter-alt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -18,12 +18,12 @@ public ThxModelHelicopterAlt()
// in 1st person view, body is invisible and only
// windshield and rotors are rendered

float length = 12f;
float length = 12f; // units are pixels in a 64x32 texture
float height = 8f;
float width = 6f;
body = new ModelRenderer(this, 0, 12);
body.addBox(-length/2f, -height/2f, -width/2f, (int)length, (int)height, (int)width);
body.setRotationPoint(-2f, -1f, 0f);
body.setRotationPoint(0f, -2f, 0f); // move up
}
mainRotor:
{
Expand All @@ -50,7 +50,7 @@ public ThxModelHelicopterAlt()
float width = 0f;
windshield = new ModelRenderer(this, 0, 4);
windshield.addBox(-length/2f, -height/2f, -width/2f, (int)length, (int)height, (int)width);
windshield.setRotationPoint(-5.5f, -4.5f, 0f);
windshield.setRotationPoint(-6.5f, -5.5f, 0f);
windshield.rotateAngleY = PI * 1.5f; // rotate 270 deg yaw for proper orientation
}
}
Expand All @@ -66,17 +66,17 @@ public void render()
body.render(scale * 2f);

mainRotor.rotateAngleY = mainRotorAngle;
mainRotor.render(scale);
mainRotor.render(scale * 1.3f);
// rotate 1/4 turn and render again
mainRotor.rotateAngleY += 1.5707f;
mainRotor.render(scale);
mainRotor.render(scale * 1.3f);

tailRotor.rotateAngleZ = tailRotorAngle;
tailRotor.render(scale);
tailRotor.render(scale * 1.3f);
// rotate 1/4 turn and render again
tailRotor.rotateAngleZ += 1.5707f;
tailRotor.render(scale);
tailRotor.render(scale * 1.3f);

windshield.render(scale);
windshield.render(scale * 1.3f);
}
}

0 comments on commit 40e1b3f

Please sign in to comment.