// constructor public Sphere(Position3 position, double radius, bool useNormalMap, CreatePositionDelegate createPosition, CreateTerrainNodeVertexBufferDelegate createTerrainNodeVertexBuffer, bool isSphere) { this.position = position; this.Radius = radius; this.useNormalMap = useNormalMap; this.createPosition = createPosition; this.createTerrainNodeVertexBuffer = createTerrainNodeVertexBuffer; this.isSphere = isSphere; Initialize(); }
/// <summary> /// Construct a terrain node instance from a pre-generated geometry map /// </summary> /// <param name="item"></param> /// <param name="level"></param> /// <param name="radius"></param> /// <param name="createTerrainNodeVertexBuffer"></param> public TerrainNode(TerrainNodeSplitItem item, int level, double radius, CreateTerrainNodeVertexBufferDelegate createTerrainNodeVertexBuffer, bool isSphere) { this.bounds = item.Bounds; this.level = level; this.radius = radius; this.createPosition = null; this.createTerrainNodeVertexBuffer = createTerrainNodeVertexBuffer; this.isSphere = isSphere; this.diffuseSurface = item.DiffuseSurface; this.normalSurface = item.NormalSurface; Initialize(item); }
/// <summary> /// Construct a terrain node instance /// </summary> /// <param name="bounds">Bounds for this node</param> /// <param name="level">Tree depth of this node</param> /// <param name="radius">Radius of the sphere this node belongs to</param> /// <param name="createPosition">Delegate for vertex position creation</param> public TerrainNode(TerrainNodeBounds bounds, int level, double radius, CreatePositionDelegate createPosition, CreateTerrainNodeVertexBufferDelegate createTerrainNodeVertexBuffer, bool isSphere) { this.bounds = bounds; this.level = level; this.radius = radius; this.createPosition = createPosition; this.createTerrainNodeVertexBuffer = createTerrainNodeVertexBuffer; this.isSphere = isSphere; Initialize(null); }