예제 #1
0
        public override void InitializeComponents()
        {
            SolidComponent s = new SolidComponent(this.game, Game1.models["small_cube"], Color.Violet);
            s.SetWorld(3f, new Vector3(5, 5.5f, 1), Quaternion.Identity);
            s.Freeze();
            this.Add(s);

            s = new SolidComponent(this.game, Game1.models["small_cube"], Color.Violet);
            s.SetWorld(3f, new Vector3(5, 7.4f, 1), Quaternion.Identity);
            s.Freeze();
            this.Add(s);

            TrackOnCollision t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Red);
            t.SetWorld(0.75f, new Vector3(5,5.69f,3.15f),
                Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(-65f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(90f))));
            this.Add(t);

            t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Red);
            t.SetWorld(0.75f, new Vector3(5, 7.12f, 3.15f),
                Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(65f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(90f))));
            this.Add(t);

            for (int i = 0; i < 3; i++)
            {
                t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Red);
                t.SetWorld(0.75f, new Vector3(5,4.1f - i * 2f,1.5f),
                    Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(90f))));
                this.Add(t);
            }

            for (int i = 0; i < 3; i++)
            {
                t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Red);
                t.SetWorld(0.75f, new Vector3(5, 8.5f + i*2f, 1.5f),
                    Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(90f))));
                this.Add(t);
            }

            //    s = new SolidComponent(this.game, Game1.models["sphere"], Color.Brown);
            //s.SetWorld(1f, new Vector3(5, 6.2f, 20), Quaternion.Identity);
            //this.Add(s);
        }
예제 #2
0
        public override void InitializeComponents()
        {
            TrackOnCollision t;

            for (int i = 0; i < 15; i++)
            {
                t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Blue);
                t.SetWorld(.75f, new Vector3(-18, 18.85f - i*2f, 1.5f),
                    Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(90f))));
                this.Add(t);
            }

            t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Blue);
            t.SetWorld(.75f, new Vector3(-17.3f, -11.15f, 1.5f),
                Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(120f))));
            this.Add(t);

            t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Blue);
            t.SetWorld(.75f, new Vector3(-16, -12.15f, 1.5f),
                Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(150f))));
            this.Add(t);
            t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Blue);
            t.SetWorld(.75f, new Vector3(-14.2f, -12.55f, 1.5f),
                Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(180f))));
            this.Add(t);

            TrackOnCollision tlast = t;
            //create a stack of dominos on top of last, which the 4th element rests on.
            for (int i = 0; i < 5; i++)
            {
                t = new TrackOnCollision(this.game, Game1.models["obelisk"], Color.Blue);
                t.SetWorld(.75f, new Vector3(-14.2f, -12.55f, 4.5f + i*3f),
                    Quaternion.CreateFromRotationMatrix(Matrix.CreateRotationY(MathHelper.ToRadians(90f)) * Matrix.CreateRotationZ(MathHelper.ToRadians(180f))));
                this.Add(t);
                GenericConstraint c = new GenericConstraint(tlast, t, new Henge3D.Frame(tlast.Position), Henge3D.Axes.All, Vector3.Zero, Vector3.Zero,
                    Henge3D.Axes.All, Vector3.Zero, Vector3.Zero);
                c.IsCollisionEnabled = false;
                this.Add(c);
                tlast = t;
            }
            t.Freeze();
        }