Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        protected override void Initialize()
        {
            fixedCrate = new Crate(new Vector3(0.1f, 0.1f, 0.1f));
            fixedCrate.Position = new Vector3(0f, 0f, 0f);
            fixedCrate.Mass = 1;

            crate = new Crate(new Vector3(0.1f, 0.1f, 0.1f));
            crate.Position = new Vector3(-0f, -1f, -0f);
            crate.Mass = 1;

            cg = new ContactGenerator();
            cg.AddBody(fixedCrate);
            //cg.AddBody(crate);

            cg.AddJoint(new PhysiXEngine.Joint(fixedCrate,crate,new Vector3(0,0,0),new Vector3(0.1f, 0.1f, 0.1f),0.15f));

            camera = new Camera(this, new Vector3(0, 0, 0.1f),
                Vector3.Zero, Vector3.Up);
            Components.Add(camera);
            g = new Gravity(new Vector3(0f, -10f, 0f));
            //g.AddBody(crate);
            //zfixedCrate.InverseMass = 0;
            //fixedCrate.InverseInertiaTensor = new Matrix();
            //crate.InverseInertiaTensor = new Matrix();
            base.Initialize();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        protected override void Initialize()
        {
            fixedBall = new Ball(1f);
            fixedBall.Texture = Content.Load<Texture2D>(@"basic_material");
            fixedBall.Position = new Vector3(0f, 0, 0f);

            ball = new Ball(0.3f);
            ball.Texture = Content.Load<Texture2D>(@"basic_material");
            ball.Position = new Vector3(0f, -2f, 0f);

            crate = new Crate(new Vector3(0.07f, 0.05f, 0.05f));
            crate.Position = new Vector3(0.3f, 5f, 0.20f);
            crate.Mass = 10;

            cg = new ContactGenerator();
            cg.AddBody(fixedBall);
            cg.AddBody(ball);
            cg.AddBody(crate);

            fixedBall.model = Content.Load<Model>(@"ball");
            ball.model = fixedBall.model;
            camera = new Camera(this, new Vector3(0, 0, 10f),
                Vector3.Zero, Vector3.Up);
            Components.Add(camera);
            g = new Gravity(new Vector3(0f, -10f, 0f));

            fixedBall.InverseMass = 0;
            fixedBall.InverseInertiaTensor = new Matrix();
            ball.Mass = 1f;
            sp = new Spring(fixedBall, ball, 3f, 2f, 0.995f, Vector3.Zero, new Vector3(0.5f, 0.5f, 0.5f));
            base.Initialize();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        protected override void Initialize()
        {
            fixedCrate = new Crate(new Vector3(0.5f, 0.5f, 0.5f));
            fixedCrate.Position = new Vector3(0, 0, 0);
            fixedCrate.AddScaledOrientation(new Vector3(0,0,20));

            crate = new Crate(new Vector3(0.5f, 0.5f, 0.5f));
            crate.Position = new Vector3(0, 4, 0);
            crate.Mass = 10;

            cg = new ContactGenerator();
            cg.AddBody(fixedCrate);
            cg.AddBody(crate);

            camera = new Camera(this, new Vector3(0, 0, 0.1f),
                Vector3.Zero, Vector3.Up);
            Components.Add(camera);
            g = new Gravity(new Vector3(0f, -10f, 0f));

            //fixedCrate.InverseMass = 0;
            //fixedCrate.InverseInertiaTensor = new Matrix();

            base.Initialize();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        protected override void Initialize()
        {
            //crates = new Crate[NUM_CRATES];

            Ball b = new Ball(2);
            b.Position = Vector3.Up * 1000;

            cg = new ContactGenerator();
            cg.AddBody(b);

            joints = new Joint[NUM_JOINTS];
            balls = new Ball[NUM_BALLS];
            fixedBalls = new Ball[4];
            ground = new Crate(new Vector3(10, 1, 10));

            #region oldcode
            /*
            //Arms
            crates[0] = new Crate(new Vector3(0.3f, 1f, 0.2f));
            crates[1] = new Crate(new Vector3(0.3f, 1f, 0.2f));
            crates[2] = new Crate(new Vector3(0.3f, 1f, 0.2f));
            crates[3] = new Crate(new Vector3(0.3f, 1f, 0.2f));

            crates[4] = new Crate(new Vector3(0.4f, 0.3f, 0.6f));

            crates[5] = new Crate(new Vector3(0.3f, 0.3f, 0.6f));
            crates[6] = new Crate(new Vector3(0.4f, 0.3f, 0.7f));
            crates[7] = new Crate(new Vector3(0.4f, 0.5f, 0.4f));

            //Legs
            crates[8] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));
            crates[9] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));
            crates[10] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));
            crates[11] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));

            crates[0].Position=new Vector3(0,0.9f,-0.5f);
            crates[1].Position = new Vector3(0, 3.159f, -0.56f);
            crates[2].Position = new Vector3(0, 0.993f, 0.5f);
            crates[3].Position = new Vector3(0, 3.15f, 0.56f);
            crates[4].Position = new Vector3(-0.054f, 4.683f, 0.013f);
            crates[5].Position = new Vector3(0.043f, 5.603f, 0.013f);
            crates[6].Position = new Vector3(0, 6.485f, 0.013f);
            crates[7].Position = new Vector3(0, 7.759f, 0.013f);
            crates[8].Position = new Vector3(0, 5.946f, -1.066f);
            crates[9].Position = new Vector3(0, 4.024f, -1.066f);
            crates[10].Position = new Vector3(0, 5.946f, 1.066f);
            crates[11].Position = new Vector3(0, 4.024f, 1.066f);

            for (int i = 0; i < NUM_CRATES; i++)
            {
                crates[i].Mass = 1;
                crates[i].Position = Vector3.Zero;
            }

            //right leg
            joints[0]=new Joint(crates[0],crates[1],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //Left leg
            joints[1]=new Joint(crates[2],crates[3],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //right arm
            joints[2]=new Joint(crates[9],crates[8],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //left arm
            joints[3]=new Joint(crates[8],crates[1],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //stomach to waist
            joints[4]=new Joint(crates[4],crates[5],new Vector3(0.05f,0.5f,0),new Vector3(-0.04f,-0.45f,0),0.15f);

            //
            joints[5]=new Joint(crates[5],crates[6],new Vector3(-0.04f,0.4f,0),new Vector3(0,-4,0),0.15f);

            joints[6]=new Joint(crates[6],crates[7],new Vector3(0,0.5f,0),new Vector3(0,-0.7f,0),0.15f);

            joints[7]=new Joint(crates[1],crates[4],new Vector3(0,1,0),new Vector3(0,-0.45f,-.5f),0.15f);

            joints[8]=new Joint(crates[3],crates[4],new Vector3(0,1,0),new Vector3(0,-0.45f,0.5f),0.15f);

            joints[9]=new Joint(crates[6],crates[8],new Vector3(0,0.3f,-.8f),new Vector3(0,0.8f,.3f),0.15f);

            joints[10]=new Joint(crates[6],crates[10],new Vector3(0,0.3f,0.8f),new Vector3(0,0.8f,-0.3f),0.15f);
            */
            #endregion

            #region
            ////Head
            //crates[0] = new Crate(new Vector3(0.1f / 2f, 0.1f / 2f, 0.1f / 2f));

            ////Arms
            //crates[1] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            //crates[2] = new Crate(new Vector3(0.1f / 2f, 0.3f / 2f, 0.1f / 2f));
            //crates[3] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            //crates[4] = new Crate(new Vector3(0.1f / 2f, 0.3f / 2f, 0.1f / 2f));

            ////Shoulder
            //crates[5] = new Crate(new Vector3(0.5f / 2f, 0.1f / 2f, 0.1f / 2f));

            ////chest
            //crates[6] = new Crate(new Vector3(0.4f / 2f, 0.1f / 2f, 0.1f / 2f));

            ////Stomach
            //crates[7] = new Crate(new Vector3(0.4f / 2f, 0.1f / 2f, 0.1f / 2f));

            ////Legs
            //crates[8] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            //crates[9] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            //crates[10] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            //crates[11] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));

            ////Head
            //crates[0].Position = new Vector3(0, 0.45f, 0);

            ////Arms
            //crates[1].Position = new Vector3(0.35f, 0.25f, 0);
            //crates[2].Position = new Vector3(0.35f, -.05f, 0);
            //crates[3].Position = new Vector3(-0.35f, .25f, 0);
            //crates[4].Position = new Vector3(-0.35f, -0.05f, 0);

            ////Shoulder
            //crates[5].Position = new Vector3(0, 0.3f, -.05f);

            ////chest
            //crates[6].Position = new Vector3(0, 0.15f, 0);

            ////Center Stomach
            //crates[7].Position = new Vector3(0, 0f, 0.05f);

            ////legs
            //crates[8].Position = new Vector3(0.15f, -0.2f, 0);
            //crates[9].Position = new Vector3(0.15f, -0.45f, 0);
            //crates[10].Position = new Vector3(-0.15f, -0.2f, 0);
            //crates[11].Position = new Vector3(-0.15f, -0.45f, 0);

            ////Head and shoulders :)
            //joints[0] = new Joint(crates[0], crates[5], new Vector3(0, -0.05f, -0.05f), new Vector3(0, 0.05f, 0), 0.05f);

            ////right arm
            //joints[1] = new Joint(crates[1], crates[2], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.15f, 0), 0.05f);

            ////left arm
            //joints[2] = new Joint(crates[3], crates[4], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.15f, 0), 0.05f);

            ////right leg
            //joints[3] = new Joint(crates[8], crates[9], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.1f, 0), 0.05f);

            ////left leg
            //joints[4] = new Joint(crates[10], crates[11], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.1f, 0), 0.05f);

            ////right arm with shoulders
            //joints[5] = new Joint(crates[5], crates[1], new Vector3(.25f, 0.05f, 0), new Vector3(-0.05f, 0.1f, 0), 0.05f);

            ////left arm with shoulders
            //joints[6] = new Joint(crates[5], crates[3], new Vector3(-.25f, 0.05f, 0), new Vector3(0.05f, 0.1f, 0), 0.05f);

            //joints[7] = new Joint(crates[5], crates[6], new Vector3(0, -0.05f, 0.05f), new Vector3(0, 0.05f, 0), 0.05f);

            //joints[8] = new Joint(crates[6], crates[7], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, -.05f), 0.05f);

            //joints[9] = new Joint(crates[7], crates[8], new Vector3(.15f, -0.05f, 0), new Vector3(0, 0.1f, 0), 0.05f);

            //joints[10] = new Joint(crates[7], crates[10], new Vector3(-.15f, -0.05f, 0), new Vector3(0, 0.1f, 0), 0.05f);
            #endregion

            #region newBall
            balls[0] = new Ball(0.1f);
            balls[1] = new Ball(0.15f);
            balls[2] = new Ball(0.15f);
            balls[3] = new Ball(0.05f);
            balls[4] = new Ball(0.05f);
            balls[5] = new Ball(0.05f);
            balls[6] = new Ball(0.05f);
            balls[7] = new Ball(0.05f);
            balls[8] = new Ball(0.05f);
            balls[9] = new Ball(0.05f);
            balls[10] = new Ball(0.05f);
            balls[11] = new Ball(0.05f);
            balls[12] = new Ball(0.05f);
            balls[13] = new Ball(0.05f);
            balls[14] = new Ball(0.05f);
            fixedBalls[0] = new Ball(0.05f);
            fixedBalls[1] = new Ball(0.05f);
            fixedBalls[2] = new Ball(0.05f);
            fixedBalls[3] = new Ball(0.05f);
            #endregion

            #region position
            balls[0].Position = new Vector3(0, 0.6f, 0);
            balls[1].Position = new Vector3(0, 0.3f, 0);
            balls[2].Position = new Vector3(0, -0.05f, 0);

            balls[3].Position = new Vector3(0.25f, 0.3f, 0);
            balls[4].Position = new Vector3(0.25f, 0.15f, 0);
            balls[5].Position = new Vector3(0.25f, 0, 0);
            balls[6].Position = new Vector3(-0.25f, 0.3f, 0);
            balls[7].Position = new Vector3(-0.25f, 0.15f, 0);
            balls[8].Position = new Vector3(-0.25f, 0, 0);

            balls[9].Position = new Vector3(0.1f, -.25f, 0);
            balls[10].Position = new Vector3(0.1f, -.4f, 0);
            balls[11].Position = new Vector3(0.1f, -.55f, 0);
            balls[12].Position = new Vector3(-0.1f, -.25f, 0);
            balls[13].Position = new Vector3(-0.1f, -.4f, 0);
            balls[14].Position = new Vector3(-0.1f, -.55f, 0);

            fixedBalls[0].Position = new Vector3(0.7f, 0.6f, 0);
            fixedBalls[1].Position = new Vector3(-0.7f, 0.6f, 0);
            fixedBalls[2].Position = new Vector3(0.7f, -1, 0);
            fixedBalls[3].Position = new Vector3(-0.7f, -1, 0);

            ground.Position = new Vector3(0, -3, 0);
            #endregion
            #region Masses
            balls[0].Mass = 5;
            balls[1].Mass = 5;
            balls[2].Mass = 5;
            balls[3].Mass = 1;
            balls[4].Mass = 1;
            balls[5].Mass = 1;
            balls[6].Mass = 1;
            balls[7].Mass = 1;
            balls[8].Mass = 1;
            balls[9].Mass = 1;
            balls[10].Mass = 1;
            balls[11].Mass = 1;
            balls[12].Mass = 1;
            balls[13].Mass = 1;
            balls[14].Mass = 1;
            #endregion

            //head and shoulder :)
            joints[0] = new Joint(balls[0], balls[1], new Vector3(0, -0.1f,0f), new Vector3(0, 0.15f, 0), 0.05f);

            joints[1] = new Joint(balls[1], balls[2], new Vector3(0, -0.15f, 0), new Vector3(0, 0.15f, 0), 0.05f);

            //right arm with shoulders
            joints[2] = new Joint(balls[1], balls[3], new Vector3(0.1f, 0.1f, 0), new Vector3(-0.04f, 0.03f, 0), 0.05f);

            //left arm with shoulders
            joints[3] = new Joint(balls[1], balls[6], new Vector3(-0.1f, 0.1f, 0), new Vector3(0.04f, 0.03f, 0), 0.05f);

            //right arm
            joints[4] = new Joint(balls[3], balls[4], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);
            joints[5] = new Joint(balls[4], balls[5], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);

            //left arm
            joints[6] = new Joint(balls[6], balls[7], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);
            joints[7] = new Joint(balls[7], balls[8], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);

            //Stomach with right leg
            joints[8] = new Joint(balls[2], balls[9], new Vector3(0.1f, -0.15f, 0), new Vector3(0, 0.05f, 0), 0.05f);

            //Stomach with left leg
            joints[9] = new Joint(balls[2], balls[12], new Vector3(-.1f, -0.15f, 0), new Vector3(0, 0.05f, 0), 0.05f);

            //right leg
            joints[10] = new Joint(balls[9], balls[10], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);
            joints[11] = new Joint(balls[10], balls[11], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);

            joints[12] = new Joint(balls[12], balls[13], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);
            joints[13] = new Joint(balls[13], balls[14], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, 0), 0.05f);

            Model model = this.Content.Load<Model>(@"ball");
            Texture2D texture = this.Content.Load<Texture2D>(@"basic_material");

            for (int i = 0; i < NUM_BALLS; i++)
            {
                balls[i].model = model;
                balls[i].Texture = texture;
                cg.AddBody(balls[i]);
                //balls[i].Mass = 1;
            }

            for (int i = 0; i < 4; i++)
            {
                fixedBalls[i].Lock();
                fixedBalls[i].model = model;
                fixedBalls[i].Texture = texture;
            }

            cg.AddConductor(new Cable(balls[5], fixedBalls[0], (balls[5].Position - fixedBalls[0].Position).Length(), 0.5f));
            cg.AddConductor(new Cable(balls[8], fixedBalls[1], (balls[8].Position - fixedBalls[1].Position).Length(), 0.5f));
            cg.AddConductor(new Cable(balls[11], fixedBalls[2], (balls[11].Position - fixedBalls[2].Position).Length(), 0.5f));
            cg.AddConductor(new Cable(balls[14], fixedBalls[3], (balls[14].Position - fixedBalls[3].Position).Length(), 0.5f));

            ground.Lock();

            for (int i = 0; i < NUM_JOINTS; i++)
                cg.AddJoint(joints[i]);
            cg.AddBody(ground);
                camera = new Camera(this, new Vector3(0, 0, 0.1f),
                    Vector3.Zero, Vector3.Up);
            Components.Add(camera);
            g = new Gravity(new Vector3(0f, -1f, 0f));

            base.Initialize();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            camera = new Camera(this, new Vector3(0, 0, 100),
                Vector3.Zero, Vector3.Up);
            Components.Add(camera);
            ball = new Ball(100f);
            dummy = new Ball(100f);
            crate = new Crate(new Vector3(1,1,1));
            crate.Position = new Vector3(20,20,20);
            //dummy.InverseMass = 0;
            //dummy.InverseInertiaTensor = new Matrix3();
            //spring = new Spring(ball, dummy, dummy.Position, 0.3f, 20.0f);
            //spring.AddBody(ball);
            g = new Gravity(Vector3.Down * 10f);
            g.AddBody(ball);
            //TODO determine which is down for the world
            //BoundingSphereRenderer.InitializeGraphics(GraphicsDevice, 10^100);

            base.Initialize();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        protected override void Initialize()
        {
            crates = new Crate[NUM_CRATES];

            Ball b = new Ball(2);
            b.Position = Vector3.Up * 1000;

            cg = new ContactGenerator();
            cg.AddBody(b);

            joints = new Joint[NUM_JOINTS];

            #region oldcode
            /*
            //Arms
            crates[0] = new Crate(new Vector3(0.3f, 1f, 0.2f));
            crates[1] = new Crate(new Vector3(0.3f, 1f, 0.2f));
            crates[2] = new Crate(new Vector3(0.3f, 1f, 0.2f));
            crates[3] = new Crate(new Vector3(0.3f, 1f, 0.2f));

            crates[4] = new Crate(new Vector3(0.4f, 0.3f, 0.6f));

            crates[5] = new Crate(new Vector3(0.3f, 0.3f, 0.6f));
            crates[6] = new Crate(new Vector3(0.4f, 0.3f, 0.7f));
            crates[7] = new Crate(new Vector3(0.4f, 0.5f, 0.4f));

            //Legs
            crates[8] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));
            crates[9] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));
            crates[10] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));
            crates[11] = new Crate(new Vector3(0.2f, 0.8f, 0.2f));

            crates[0].Position=new Vector3(0,0.9f,-0.5f);
            crates[1].Position = new Vector3(0, 3.159f, -0.56f);
            crates[2].Position = new Vector3(0, 0.993f, 0.5f);
            crates[3].Position = new Vector3(0, 3.15f, 0.56f);
            crates[4].Position = new Vector3(-0.054f, 4.683f, 0.013f);
            crates[5].Position = new Vector3(0.043f, 5.603f, 0.013f);
            crates[6].Position = new Vector3(0, 6.485f, 0.013f);
            crates[7].Position = new Vector3(0, 7.759f, 0.013f);
            crates[8].Position = new Vector3(0, 5.946f, -1.066f);
            crates[9].Position = new Vector3(0, 4.024f, -1.066f);
            crates[10].Position = new Vector3(0, 5.946f, 1.066f);
            crates[11].Position = new Vector3(0, 4.024f, 1.066f);

            for (int i = 0; i < NUM_CRATES; i++)
            {
                crates[i].Mass = 1;
                crates[i].Position = Vector3.Zero;
            }

            //right leg
            joints[0]=new Joint(crates[0],crates[1],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //Left leg
            joints[1]=new Joint(crates[2],crates[3],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //right arm
            joints[2]=new Joint(crates[9],crates[8],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //left arm
            joints[3]=new Joint(crates[8],crates[1],new Vector3(0,1,0),new Vector3(0,-1,0),0.15f);

            //stomach to waist
            joints[4]=new Joint(crates[4],crates[5],new Vector3(0.05f,0.5f,0),new Vector3(-0.04f,-0.45f,0),0.15f);

            //
            joints[5]=new Joint(crates[5],crates[6],new Vector3(-0.04f,0.4f,0),new Vector3(0,-4,0),0.15f);

            joints[6]=new Joint(crates[6],crates[7],new Vector3(0,0.5f,0),new Vector3(0,-0.7f,0),0.15f);

            joints[7]=new Joint(crates[1],crates[4],new Vector3(0,1,0),new Vector3(0,-0.45f,-.5f),0.15f);

            joints[8]=new Joint(crates[3],crates[4],new Vector3(0,1,0),new Vector3(0,-0.45f,0.5f),0.15f);

            joints[9]=new Joint(crates[6],crates[8],new Vector3(0,0.3f,-.8f),new Vector3(0,0.8f,.3f),0.15f);

            joints[10]=new Joint(crates[6],crates[10],new Vector3(0,0.3f,0.8f),new Vector3(0,0.8f,-0.3f),0.15f);
            */
            #endregion

            //Head
            crates[0] = new Crate(new Vector3(0.1f / 2f, 0.1f / 2f, 0.1f / 2f));

            //Arms
            crates[1] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            crates[2] = new Crate(new Vector3(0.1f / 2f, 0.3f / 2f, 0.1f / 2f));
            crates[3] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            crates[4] = new Crate(new Vector3(0.1f / 2f, 0.3f / 2f, 0.1f / 2f));

            //Shoulder
            crates[5] = new Crate(new Vector3(0.5f / 2f, 0.1f / 2f, 0.1f / 2f));

            //chest
            crates[6] = new Crate(new Vector3(0.4f / 2f, 0.1f / 2f, 0.1f / 2f));

            //Stomach
            crates[7] = new Crate(new Vector3(0.4f / 2f, 0.1f / 2f, 0.1f / 2f));

            //Legs
            crates[8] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            crates[9] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            crates[10] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));
            crates[11] = new Crate(new Vector3(0.1f / 2f, 0.2f / 2f, 0.1f / 2f));

            //Head
            crates[0].Position = new Vector3(0, 0.45f, 0);

            //Arms
            crates[1].Position = new Vector3(0.35f, 0.25f, 0);
            crates[2].Position = new Vector3(0.35f, -.05f, 0);
            crates[3].Position = new Vector3(-0.35f, .25f, 0);
            crates[4].Position = new Vector3(-0.35f, -0.05f, 0);

            //Shoulder
            crates[5].Position = new Vector3(0, 0.3f, -.05f);

            //chest
            crates[6].Position = new Vector3(0, 0.15f, 0);

            //Center Stomach
            crates[7].Position = new Vector3(0, 0f, 0.05f);

            //legs
            crates[8].Position = new Vector3(0.15f, -0.2f, 0);
            crates[9].Position = new Vector3(0.15f, -0.45f, 0);
            crates[10].Position = new Vector3(-0.15f, -0.2f, 0);
            crates[11].Position = new Vector3(-0.15f, -0.45f, 0);

            //Head and shoulders :)
            joints[0] = new Joint(crates[0], crates[5], new Vector3(0, -0.05f, -0.05f), new Vector3(0, 0.05f, 0), 0.05f);

            //right arm
            joints[1] = new Joint(crates[1], crates[2], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.15f, 0), 0.05f);

            //left arm
            joints[2] = new Joint(crates[3], crates[4], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.15f, 0), 0.05f);

            //right leg
            joints[3] = new Joint(crates[8], crates[9], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.1f, 0), 0.05f);

            //left leg
            joints[4] = new Joint(crates[10], crates[11], new Vector3(0, -0.1f, 0.05f), new Vector3(0, 0.1f, 0), 0.05f);

            //right arm with shoulders
            joints[5] = new Joint(crates[5], crates[1], new Vector3(.25f, 0.05f, 0), new Vector3(-0.05f, 0.1f, 0), 0.05f);

            //left arm with shoulders
            joints[6] = new Joint(crates[5], crates[3], new Vector3(-.25f, 0.05f, 0), new Vector3(0.05f, 0.1f, 0), 0.05f);

            joints[7] = new Joint(crates[5], crates[6], new Vector3(0, -0.05f, 0.05f), new Vector3(0, 0.05f, 0), 0.05f);

            joints[8] = new Joint(crates[6], crates[7], new Vector3(0, -0.05f, 0), new Vector3(0, 0.05f, -.05f), 0.05f);

            joints[9] = new Joint(crates[7], crates[8], new Vector3(.15f, -0.05f, 0), new Vector3(0, 0.1f, 0), 0.05f);

            joints[10] = new Joint(crates[7], crates[10], new Vector3(-.15f, -0.05f, 0), new Vector3(0, 0.1f, 0), 0.05f);

            for (int i = 0; i < NUM_CRATES; i++)
            {
                crates[i].InverseMass = 1;
                //cg.AddBody(crates[i]);
                //crates[i].InverseInertiaTensor = new Matrix();
            }

            for (int i = 0; i < NUM_JOINTS; i++)
                cg.AddJoint(joints[i]);

            camera = new Camera(this, new Vector3(0, 0, 0.1f),
                Vector3.Zero, Vector3.Up);
            Components.Add(camera);
            g = new Gravity(new Vector3(0f, -1f, 0f));

            //crates[0].InverseMass = 0;
            //crates[7].InverseMass = 0;
            //crates[6].InverseInertiaTensor = new Matrix();

            base.Initialize();
        }