//shapes[BodyPart.BODYPART_HEAD.ordinal()].
//HEAD//_________________________________________________________________________
ratio = 0.9f;
g.pushMatrix();
CapsuleShape capsule = (CapsuleShape) shapes[BodyPart.BODYPART_HEAD
.ordinal()];
float radius = capsule.getRadius();
float halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_HEAD.ordinal()].getMotionState()
.getWorldTransform(myTransform);
//g.fill(0);
applyMatrix(myTransform, g);
if (this.scaling) {
g.pushMatrix();
g.scale(GLOBAL.jBullet.getScale());
g.fill(SETTINGS.person_height_text_fill_colour);
g.text((int) (this.scale * 177f) + " cm", -50, (-radius - 2)
* (1 / GLOBAL.jBullet.getScale()));
g.fill(SETTINGS.ERGODOLL_FILL_COLOUR);
g.popMatrix();
}
/*
functions.cylinder(radius, radius * ratio, halfHeight * 2,
SETTINGS.cylinder_res, g);
g.translate(0, halfHeight, 0);
if (!GLOBAL.performanceMode)
g.sphere(radius * ratio); //jaw
g.translate(0, -halfHeight * 2, 0);
if (!GLOBAL.performanceMode)
g.sphere(radius);
this.renderFace(g);
*/
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.popMatrix();
//gl.drawCylinder(radius, halfHeight, upAxis);
//SPINE_______________________________________________________________________
ratio = 0.80f;
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_SPINE.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_SPINE.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
g.pushMatrix();
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.popMatrix();
//functions.cylinder(radius, radius * ratio, halfHeight * 2,
// SETTINGS.cylinder_res, g);
//functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * ratio);
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius); // top
g.popMatrix();
//Pelvis_________________________________________________________________________
ratio = 1.0f;
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_PELVIS.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_PELVIS.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius * ratio, radius, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius);
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * ratio); // top
g.popMatrix();
if (hasArms) {
//RIGHT_UPPER_ARM_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_RIGHT_UPPER_ARM
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_RIGHT_UPPER_ARM.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//LEFT_UPPER_ARM_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_LEFT_UPPER_ARM
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_LEFT_UPPER_ARM.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//RIGHT_LOWER_ARM_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_RIGHT_LOWER_ARM
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//LEFT_LOWER_ARM_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_LEFT_LOWER_ARM
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//LEFT HAND_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_LEFT_HAND
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_LEFT_HAND.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//RIGHT HAND_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_RIGHT_HAND
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_RIGHT_HAND.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
}
//LEFT Upper Leg_________________________________________________________________________
//ratio = .7f;
ratio = 0.9f;
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_LEFT_UPPER_LEG
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * ratio, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius);
g.popMatrix();
//Right Upper Leg_________________________________________________________________________
ratio = 0.9f;
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_RIGHT_UPPER_LEG
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_RIGHT_UPPER_LEG.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * ratio, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius);
g.popMatrix();
//LOWER LEFT LEG_________________________________________________________________________
ratio = 0.9f;
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_LEFT_LOWER_LEG
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_LEFT_LOWER_LEG.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//LOWER RIGHT LEG_________________________________________________________________________
ratio = 0.9f;
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_RIGHT_LOWER_LEG
.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_RIGHT_LOWER_LEG.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
// RIGHT Foot_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_RIGHT_FOOT.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_RIGHT_FOOT.ordinal()]
.getMotionState().getWorldTransform(myTransform);
applyMatrix(myTransform, g);
functions.cylinder(radius, radius * .5f, halfHeight * 2,
SETTINGS.cylinder_res, g);
functions.flatCylinder(radius, radius * ratio, halfHeight * 2, myTransform,g);
g.translate(0, halfHeight, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 0.7f); //jaw
g.translate(0, -halfHeight * 2, 0);
//if (!GLOBAL.performanceMode)
// g.sphere(radius * 1.1f);
g.popMatrix();
//LEFT Foot_________________________________________________________________________
g.pushMatrix();
capsule = (CapsuleShape) shapes[BodyPart.BODYPART_LEFT_FOOT.ordinal()];
radius = capsule.getRadius();
halfHeight = capsule.getHalfHeight();
if (GLOBAL.performanceMode)
halfHeight = halfHeight * 1.75f;
myTransform = bodies[BodyPart.BODYPART_LEFT_FOOT.ordinal()]
.getMotionState().getWorldTransform(myTransform);