Axiom.Core.SceneManager.CreateBillboardSet C# (CSharp) Méthode

CreateBillboardSet() public méthode

Overloaded method.
public CreateBillboardSet ( string name ) : BillboardSet
name string
Résultat BillboardSet
		public virtual BillboardSet CreateBillboardSet( string name )
		{
			// return new billboardset with a default pool size of 20
			return this.CreateBillboardSet( name, 20 );
		}

Same methods

SceneManager::CreateBillboardSet ( string name, int poolSize ) : BillboardSet

Usage Example

Exemple #1
0
        protected void CreateRibbons()
        {
            viewport.BackgroundColor = ColorEx.Black;
            float scale = 100f;

            scene.AmbientLight = new ColorEx(0.5f, 0.5f, 0.5f);
            //scene.SetSkyBox(true, "Examples/SpaceSkyBox", 20f * oneMeter);
            Vector3 dir = new Vector3(-1f, -1f, 0.5f);

            dir.Normalize();
            Light light1 = scene.CreateLight("light1");

            light1.Type      = LightType.Directional;
            light1.Direction = dir;

            // Create a barrel for the ribbons to fly through
            Entity    barrel     = scene.CreateEntity("barrel", "barrel.mesh");
            SceneNode barrelNode = scene.RootSceneNode.CreateChildSceneNode();

            barrelNode.ScaleFactor = 5f * Vector3.UnitScale;
            barrelNode.AttachObject(barrel);

            RibbonTrail trail = new RibbonTrail("DemoTrail", "numberOfChains", 2, "maxElementsPerChain", 80);

            trail.MaterialName = "Examples/LightRibbonTrail";
            trail.TrailLength  = scale * 400f;
            scene.RootSceneNode.CreateChildSceneNode().AttachObject(trail);

            // Create 3 nodes for trail to follow
            SceneNode animNode = scene.RootSceneNode.CreateChildSceneNode();

            animNode.Position = scale * new Vector3(50f, 30f, 0);
            Animation anim = scene.CreateAnimation("an1", 14);

            anim.InterpolationMode = InterpolationMode.Spline;
            NodeAnimationTrack track = anim.CreateNodeTrack(1, animNode);
            TransformKeyFrame  kf    = track.CreateNodeKeyFrame(0);

            kf.Translate = scale * new Vector3(50f, 30f, 0f);
            kf           = track.CreateNodeKeyFrame(2);
            kf.Translate = scale * new Vector3(100f, -30f, 0f);
            kf           = track.CreateNodeKeyFrame(4);
            kf.Translate = scale * new Vector3(120f, -100f, 150f);
            kf           = track.CreateNodeKeyFrame(6);
            kf.Translate = scale * new Vector3(30f, -100f, 50f);
            kf           = track.CreateNodeKeyFrame(8);
            kf.Translate = scale * new Vector3(-50f, 30f, -50f);
            kf           = track.CreateNodeKeyFrame(10);
            kf.Translate = scale * new Vector3(-150f, -20f, -100f);
            kf           = track.CreateNodeKeyFrame(12);
            kf.Translate = scale * new Vector3(-50f, -30f, 0f);
            kf           = track.CreateNodeKeyFrame(14);
            kf.Translate = scale * new Vector3(50f, 30f, 0f);

            AnimationState animState = scene.CreateAnimationState("an1");

            //animState.Enabled = true;
            animStateList = new List <AnimationState>();
            animStateList.Add(animState);

            trail.SetInitialColor(0, 1.0f, 0.8f, 0f, 1.0f);
            trail.SetColorChange(0, 0.5f, 0.5f, 0.5f, 0.5f);
            trail.SetInitialWidth(0, scale * 5f);
            trail.AddNode(animNode);

            // Add light
            Light light2 = scene.CreateLight("light2");

            light2.Diffuse = trail.GetInitialColor(0);
            animNode.AttachObject(light2);

            // Add billboard
            BillboardSet bbs = scene.CreateBillboardSet("bb", 1);

            bbs.CreateBillboard(Vector3.Zero, trail.GetInitialColor(0));
            bbs.MaterialName = "flare";
            animNode.AttachObject(bbs);

            animNode          = scene.RootSceneNode.CreateChildSceneNode();
            animNode.Position = scale * new Vector3(-50f, 100f, 0f);
            anim = scene.CreateAnimation("an2", 10);
            anim.InterpolationMode = InterpolationMode.Spline;
            track        = anim.CreateNodeTrack(1, animNode);
            kf           = track.CreateNodeKeyFrame(0);
            kf.Translate = scale * new Vector3(-50f, 100f, 0f);
            kf           = track.CreateNodeKeyFrame(2);
            kf.Translate = scale * new Vector3(-100f, 150f, -30f);
            kf           = track.CreateNodeKeyFrame(4);
            kf.Translate = scale * new Vector3(-200f, 0f, 40f);
            kf           = track.CreateNodeKeyFrame(6);
            kf.Translate = scale * new Vector3(0f, -150f, 70f);
            kf           = track.CreateNodeKeyFrame(8);
            kf.Translate = scale * new Vector3(50f, 0f, 30f);
            kf           = track.CreateNodeKeyFrame(10);
            kf.Translate = scale * new Vector3(-50f, 100f, 0f);

            animState = scene.CreateAnimationState("an2");
            //animState.setEnabled(true);
            animStateList.Add(animState);

            trail.SetInitialColor(1, 0.0f, 1.0f, 0.4f, 1.0f);
            trail.SetColorChange(1, 0.5f, 0.5f, 0.5f, 0.5f);
            trail.SetInitialWidth(1, scale * 5f);
            trail.AddNode(animNode);


            // Add light
            Light light3 = scene.CreateLight("l3");

            light3.Diffuse = trail.GetInitialColor(1);
            animNode.AttachObject(light3);

            // Add billboard
            bbs = scene.CreateBillboardSet("bb2", 1);
            bbs.CreateBillboard(Vector3.Zero, trail.GetInitialColor(1));
            bbs.MaterialName = "flare";
            animNode.AttachObject(bbs);
        }
SceneManager