/// <summary> /// Sets the sphere's data and calls Mesh.Reconstruct() /// </summary> /// <param name="center">Center of the sphere</param> /// <param name="zSamples">Number of samples along the z-axis</param> /// <param name="radSamples">Number of samples along the radius</param> /// <param name="radius">Radius of the sphere</param> /// <param name="textureMode">Texture mode to use</param> public void SetData(Vector3 center, int zSamples, int radSamples, float radius, SphereTextureMode textureMode) { _center = center; _radius = radius; _textureMode = textureMode; GenerateGeometry(zSamples, radSamples); GenerateIndices(zSamples, radSamples); this.MeshData.Reconstruct(); UpdateModelBound(); }
/// <summary> /// Creates a new instance of a sphere. /// </summary> /// <param name="name">Name of the sphere</param> /// <param name="center">Center of the sphere</param> /// <param name="zSamples">Number of samples along the z-axis</param> /// <param name="radSamples">Number of samples along the radius</param> /// <param name="radius">Radius of the sphere</param> /// <param name="textureMode">Texture mode to use</param> public Sphere(String name, Vector3 center, int zSamples, int radSamples, float radius, SphereTextureMode textureMode) : base(name) { SetData(center, zSamples, radSamples, radius, textureMode); }