Exemplo n.º 1
0
        private SceneNode CreateSectorNode(int indexXAxis, int indexZAxis)
        {
            ActorTransformNode      actorTransform = new ActorTransformNode(Owner);
            ExplicitBoundingBoxNode explicitBox    = new ExplicitBoundingBoxNode(ComputeSectorBound(indexXAxis, indexZAxis));

            actorTransform.AddChild(explicitBox);
            int vertexOffset = indexXAxis * TerrainAsset.SectorSize +
                               indexZAxis * TerrainAsset.SectorSize * TerrainAsset.VertexCountAlongXAxis;
            GeometryNode geometryNode = new TerrainGeometryNode(TerrainAsset, vertexOffset, mDefaultMaterial);

            explicitBox.AddChild(geometryNode);
            geometryNode.AddMaterial(TraversalContext.MaterialFlags.ShadowMap, null); //mDepthOnlyMaterial);

            return(actorTransform);
        }
Exemplo n.º 2
0
        private SceneNode CreateSectorNode(int indexXAxis, int indexZAxis)
        {
            ActorTransformNode actorTransform = new ActorTransformNode(Owner);
            ExplicitBoundingBoxNode explicitBox = new ExplicitBoundingBoxNode(ComputeSectorBound(indexXAxis, indexZAxis));
            actorTransform.AddChild(explicitBox);
            int vertexOffset = indexXAxis * TerrainAsset.SectorSize +
                indexZAxis * TerrainAsset.SectorSize * TerrainAsset.VertexCountAlongXAxis;
            GeometryNode geometryNode = new TerrainGeometryNode(TerrainAsset, vertexOffset, mDefaultMaterial);
            explicitBox.AddChild(geometryNode);
            geometryNode.AddMaterial(TraversalContext.MaterialFlags.ShadowMap, null); //mDepthOnlyMaterial);

            return actorTransform;
        }