protected override void BuildSphereAndGeometryNodes(ComponentManifest manifest, SceneNode parent) { BoundingSphere bound = new BoundingSphere(); bound.Center = Vector3.Zero; // TODO: P2: Magic number? bound.Radius = 120.0f; ExplicitBoundingSphereNode meshBound = new ExplicitBoundingSphereNode(bound); parent.AddChild(meshBound); // Create the default material EffectApplication defaultMaterial = new EffectApplication(mEffect, mSettings.RenderState); defaultMaterial.AddParamSetter(new ParticlesParamSetter(delegate() { return(mCurrentTime); })); ParticleSystemGeometryNode geometry = new ParticleSystemGeometryNode(mParticleData, delegate() { mDrawCounter++; }, defaultMaterial); meshBound.AddChild(geometry); // It won't cast a shadow. geometry.AddMaterial(TraversalContext.MaterialFlags.ShadowMap, null); }
protected override void BuildSphereAndGeometryNodes(ComponentManifest manifest, SceneNode parent) { BoundingSphere bound = new BoundingSphere(); bound.Center = Vector3.Zero; // TODO: P2: Magic number? bound.Radius = 120.0f; ExplicitBoundingSphereNode meshBound = new ExplicitBoundingSphereNode(bound); parent.AddChild(meshBound); // Create the default material EffectApplication defaultMaterial = new EffectApplication(mEffect, mSettings.RenderState); defaultMaterial.AddParamSetter(new ParticlesParamSetter(delegate() { return mCurrentTime; })); ParticleSystemGeometryNode geometry = new ParticleSystemGeometryNode(mParticleData, delegate() { mDrawCounter++; }, defaultMaterial); meshBound.AddChild(geometry); // It won't cast a shadow. geometry.AddMaterial(TraversalContext.MaterialFlags.ShadowMap, null); }