コード例 #1
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, 0.1f), Vector3.Zero, Vector3.Up);
            Components.Add(camera);

            //player = new BCXMLPlayer(Bodies, @"D:\Lab.xml");

            base.Initialize();
        }
コード例 #2
0
ファイル: Crate.cs プロジェクト: IdeasStorm/PhysiXLab
        public void Draw(Camera camera)
        {
            Matrix[] transforms = new Matrix[model.Bones.Count];
            model.CopyAbsoluteBoneTransformsTo(transforms);
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect be in mesh.Effects)
                {
                    if (Texture != null)
                    {
                        be.Texture = this.Texture;
                        be.TextureEnabled = true;
                    }
                    be.EnableDefaultLighting();
                    be.World = mesh.ParentBone.Transform *  Matrix.CreateScale(HalfSize) * TransformMatrix;
                    be.View = camera.view;
                    be.Projection = camera.projection;
                    be.Alpha = 1f;
                    if (Selected)
                    {
                        if (SelectedTexture != null)
                        {
                            be.Texture = this.SelectedTexture;
                            be.TextureEnabled = true;
                        }
                        be.Alpha = 3;
                        Selected = false;
                    }
                    if (ShowPanel)
                    {
                        if (SelectedTexture_Panel != null)
                        {
                            be.Texture = this.SelectedTexture_Panel;
                            be.TextureEnabled = true;
                        }
                        be.Alpha = 3;
                    }
                }

                mesh.Draw();
            }
        }
コード例 #3
0
ファイル: Lab.cs プロジェクト: IdeasStorm/PhysiXLab
        /// <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()
        {
            this.IsMouseVisible = true;

            basicLab = new BasicLab(this);
            Components.Add(basicLab);
            panel = new PanelObject(this);
            Components.Add(panel);
            camera = new Camera(this, new Vector3(0, 0, 20f),
                Vector3.Zero, Vector3.Up);
            Components.Add(camera);

            //Recorder = new XMLRecorder(basicLab.bodys,@"D:\Lab.xml");

            base.Initialize();
        }