Beispiel #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);
        }
        protected override void CreateSceneGraph(ComponentManifest manifest)
        {
            SceneGraph = new ActorTransformNode(Owner);

            SceneNode sphereParent = SceneGraph;

            Matrix modelAdjustment = Matrix.Identity;
            if (manifest.Properties.ContainsKey(ManifestKeys.MODEL_ADJUSTMENT))
                modelAdjustment = (Matrix)(manifest.Properties[ManifestKeys.MODEL_ADJUSTMENT]);

            if (modelAdjustment != Matrix.Identity)
            {
                sphereParent = new StaticTransformNode(modelAdjustment);
                SceneGraph.AddChild(sphereParent);
            }

            BuildSphereAndGeometryNodes(manifest, sphereParent);
        }
Beispiel #3
0
        protected override void CreateSceneGraph(ComponentManifest manifest)
        {
            SceneGraph = new ActorTransformNode(Owner);

            SceneNode sphereParent = SceneGraph;

            Matrix modelAdjustment = Matrix.Identity;

            if (manifest.Properties.ContainsKey(ManifestKeys.MODEL_ADJUSTMENT))
            {
                modelAdjustment = (Matrix)(manifest.Properties[ManifestKeys.MODEL_ADJUSTMENT]);
            }

            if (modelAdjustment != Matrix.Identity)
            {
                sphereParent = new StaticTransformNode(modelAdjustment);
                SceneGraph.AddChild(sphereParent);
            }

            BuildSphereAndGeometryNodes(manifest, sphereParent);
        }
        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;
        }