Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BodyPart bodyPlan;
- void initBody() {
- //to anybody reading this code,
- //
- //I apologize.
- bodyPlan.initAsChest(); //set it as the chest
- //head
- bodyPlan.childParts["head"] = {}; //add a head
- bodyPlan.childParts["head"].initAsHead(); //set it to actually be a head
- bodyPlan.childParts["head"].parentPart = &bodyPlan; //link it to the body plan (chest)
- //left arm
- bodyPlan.childParts["larm"] = {};
- bodyPlan.childParts["larm"].initAsUpperArm();
- bodyPlan.childParts["larm"].name = "upper left arm";
- bodyPlan.childParts["larm"].parentPart = &bodyPlan;
- bodyPlan.childParts["larm"].childParts["forearm"] = {}; //into the rabbit hole we go!
- bodyPlan.childParts["larm"].childParts["forearm"].initAsLowerArm();
- bodyPlan.childParts["larm"].childParts["forearm"].name = "left forearm";
- bodyPlan.childParts["larm"].childParts["forearm"].parentPart = &bodyPlan.childParts["larm"];
- bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"] = {};
- bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"].initAsHand();
- bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"].name = "left hand";
- bodyPlan.childParts["larm"].childParts["forearm"].childParts["hand"].parentPart = &bodyPlan.childParts["larm"].childParts["forearm"];
- //right arm
- bodyPlan.childParts["rarm"] = {};
- bodyPlan.childParts["rarm"].initAsUpperArm();
- bodyPlan.childParts["rarm"].name = "upper right arm";
- bodyPlan.childParts["rarm"].parentPart = &bodyPlan;
- bodyPlan.childParts["rarm"].childParts["forearm"] = {}; //into the rabbit hole we go!
- bodyPlan.childParts["rarm"].childParts["forearm"].initAsLowerArm();
- bodyPlan.childParts["rarm"].childParts["forearm"].name = "right forearm";
- bodyPlan.childParts["rarm"].childParts["forearm"].parentPart = &bodyPlan.childParts["rarm"];
- bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"] = {};
- bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"].initAsHand();
- bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"].name = "right hand";
- bodyPlan.childParts["rarm"].childParts["forearm"].childParts["hand"].parentPart = &bodyPlan.childParts["rarm"].childParts["forearm"];
- //lower body
- bodyPlan.childParts["abdomen"] = {};
- bodyPlan.childParts["abdomen"].initAsAbdomen();
- bodyPlan.childParts["abdomen"].parentPart = &bodyPlan;
- //left leg
- bodyPlan.childParts["abdomen"].childParts["lleg"] = {};
- bodyPlan.childParts["abdomen"].childParts["lleg"].initAsUpperLeg();
- bodyPlan.childParts["abdomen"].childParts["lleg"].name = "upper left leg";
- bodyPlan.childParts["abdomen"].childParts["lleg"].parentPart = &bodyPlan.childParts["abdomen"];
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"] = {};
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].initAsLowerLeg();
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].name = "lower left leg";
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].parentPart = &bodyPlan.childParts["abdomen"].childParts["lleg"];
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"] = {};
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"].initAsFoot();
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"].name = "left foot";
- bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"].childParts["foot"].parentPart = &bodyPlan.childParts["abdomen"].childParts["lleg"].childParts["lowerleg"];
- //right leg
- bodyPlan.childParts["abdomen"].childParts["rleg"] = {};
- bodyPlan.childParts["abdomen"].childParts["rleg"].initAsUpperLeg();
- bodyPlan.childParts["abdomen"].childParts["rleg"].name = "upper right leg";
- bodyPlan.childParts["abdomen"].childParts["rleg"].parentPart = &bodyPlan.childParts["abdomen"];
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"] = {};
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].initAsLowerLeg();
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].name = "lower right leg";
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].parentPart = &bodyPlan.childParts["abdomen"].childParts["rleg"];
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"] = {};
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"].initAsFoot();
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"].name = "right foot";
- bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"].childParts["foot"].parentPart = &bodyPlan.childParts["abdomen"].childParts["rleg"].childParts["lowerleg"];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement