/// <summary>
        /// Carga el contenido gráfico del componente
        /// </summary>
        protected override void LoadContent()
        {
            this.m_BasicEffect = new BasicEffect(this.GraphicsDevice, null);
            this.m_BasicEffect.EnableDefaultLighting();

            this.m_Sphere = new CollisionSphere(this.Radius, this.Mass);

            VertexPositionNormalTexture[] buffer = null;
            Int16[] indices = null;

            PolyGenerator.InitializeSphere(out buffer, out indices, this.Radius);

            this.m_Geometry = new BufferedGeometryInfo()
            {
                FillMode          = FillMode.Solid,
                PrimitiveType     = PrimitiveType.TriangleList,
                Indexed           = true,
                Vertices          = buffer,
                Indices           = indices,
                VertexDeclaration = new VertexDeclaration(this.GraphicsDevice, VertexPositionNormalTexture.VertexElements),
                Texture           = this.Game.Content.Load <Texture2D>(@"Content/dharma"),
                PrimitiveCount    = indices.Length / 3,
            };

            base.LoadContent();
        }
Exemple #2
0
        /// <summary>
        /// Carga de contenidos gráficos
        /// </summary>
        protected override void LoadContent()
        {
            PolyGenerator.InitializeSphere(out this.m_Vertices, out this.m_Indices, 1f);

            this.m_VertexDeclaration = new VertexDeclaration(this.GraphicsDevice, VertexPositionNormalTexture.VertexElements);
            this.m_BasicEffect       = new BasicEffect(this.GraphicsDevice, null);
            this.m_Texture           = this.Game.Content.Load <Texture2D>(this.m_TextureAsset);

            base.LoadContent();
        }