• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Core.SceneManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Axiom.Core.SceneManager的典型用法代码示例。如果您正苦于以下问题:C# SceneManager类的具体用法?C# SceneManager怎么用?C# SceneManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SceneManager类属于Axiom.Core命名空间,在下文中一共展示了SceneManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SmoothCamera

        public SmoothCamera(String pName, SceneManager pSceneManager, MovingObject pTarget, Int32 pFramesBehind)
            : base(pName, pSceneManager)
        {
            Node = pSceneManager.RootSceneNode.CreateChildSceneNode();
            Node.Position = cameraOffset;
            Node.AttachObject(this);

            x = new List<double>(pFramesBehind);
            y = new List<double>(pFramesBehind);
            dx = new List<double>(pFramesBehind);
            dy = new List<double>(pFramesBehind);
            framesBehind = Math.Max(1, pFramesBehind);
            target = pTarget;

            for (var i = 0; i < pFramesBehind; i++)
            {
                x.Add(pTarget.Position.x);
                y.Add(pTarget.Position.y);
                dx.Add(0);
                dy.Add(0);
            }

            x.Insert(0, pTarget.Position.x);
            y.Insert(0, pTarget.Position.y);
            dx.Insert(0, pTarget.Velocity.x);
            dy.Insert(0, pTarget.Velocity.y);

            isYawFixed = true;
            FixedYawAxis = Vector3.UnitZ;
            Near = 5;
            AutoAspectRatio = true;
        }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:32,代码来源:SmoothCamera.cs


示例2: PCZCamera

		public PCZCamera( string name, SceneManager sceneManager )
			: base( name, sceneManager )
		{
			this.box = new AxisAlignedBox( new Vector3( -0.1f, -0.1f, -0.1f ), new Vector3( 0.1f, 0.1f, 0.1f ) );
			this.extraCullingFrustum = new PCZFrustum();
			this.extraCullingFrustum.SetUseOriginPlane( true );
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:PCZCamera.cs


示例3: World

 public World(SceneManager pSceneManager)
 {
     SceneManager = pSceneManager;
     Ships = new List<Ship>(48);
     Bullets = new List<Bullet>(256);
     Trails = new List<Trail>(256);
 }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:7,代码来源:World.cs


示例4: OnLoad

        public void OnLoad()
        {
            var dir = Directory.GetCurrentDirectory();
            ResourceGroupManager.Instance.AddResourceLocation(dir, "Folder");
            //MaterialManager.Instance.Initialize();

            _scene = _root.CreateSceneManager("DefaultSceneManager", "SLSharpInstance");
            _scene.ClearScene();

            Bindings.Axiom.SLSharp.Init();
            Shader.DebugMode = true;

            //Shader.DebugMode = true;

            _clipmap = new Clipmap(_scene);
            RecalcHeight();

            _camera = _scene.CreateCamera("MainCamera");
            _camera.Position = new Vector3(0, 0, 5);
            _camera.LookAt(Vector3.Zero);
            _camera.Near = 0.001f;
            _camera.Far = 20.0f;
            _camera.AutoAspectRatio = true;

            var vp = _window.AddViewport(_camera);
            vp.BackgroundColor = ColorEx.CornflowerBlue;
        }
开发者ID:hach-que,项目名称:SLSharp,代码行数:27,代码来源:DemoWindow.cs


示例5: MultiLights

        public MultiLights(SceneManager pSceneManager, SceneNode pCamNode, MovingObject pPlayerShip, Int32 pNumberOfLights)
        {
            oldCamLightColor = CamLightColor = new ColorEx(0.13f, 0.1f, 0.05f);
            PlayerLightColor = ColorEx.White;
            camLights = new List<Light>(pNumberOfLights);

            innerLights = (Int32)Math.Round(pNumberOfLights / 3.0f, MidpointRounding.AwayFromZero);
            outerLights = pNumberOfLights - innerLights;

            // create the playership's light.
            playerLight = pSceneManager.CreateLight("playerSpotLight");
            playerLight.Type = LightType.Spotlight;
            playerLight.Diffuse = PlayerLightColor;
            playerLight.Specular = ColorEx.White;
            playerLight.SetSpotlightRange(0.0f, 120.0f);
            playerLight.Direction = Vector3.NegativeUnitZ;

            playerLightNode = pPlayerShip.Node.CreateChildSceneNode();
            playerLightNode.AttachObject(playerLight);
            playerLightNode.Position = new Vector3(0, 0, 0);
            playerLightNode.SetDirection(new Vector3(1, 0, 0), TransformSpace.Local);

            // create the camera spotlights around the camera's direction.
            camInnerLightNode = pCamNode.CreateChildSceneNode();
            camInnerLightNode.Position = new Vector3(0, 0, 0);
            camOuterLightNode = pCamNode.CreateChildSceneNode();
            camOuterLightNode.Position = new Vector3(0, 0, 0);

            for (var i = 0; i < innerLights; i++)
            {
                var light = pSceneManager.CreateLight("camInnerLight " + (i + 1));
                light.Type = LightType.Spotlight;
                light.Diffuse = CamLightColor;
                light.Specular = ColorEx.White;
                light.SetSpotlightRange(0.0f, 25.0f);
                light.Direction = Quaternion.FromAngleAxis(360.0 * i / innerLights * Constants.DegreesToRadians, Vector3.UnitZ) *
                    Quaternion.FromAngleAxis(10.0 * Constants.DegreesToRadians, Vector3.UnitX) *
                    Vector3.NegativeUnitZ;

                camLights.Add(light);
                camInnerLightNode.AttachObject(light);
            }
            for (var i = 0; i < outerLights; i++)
            {
                var light = pSceneManager.CreateLight("camOuterLight " + (i + 1));
                light.Type = LightType.Spotlight;
                light.Diffuse = CamLightColor;
                light.Specular = ColorEx.White;
                light.SetSpotlightRange(0.0f, 25.0f);
                light.Direction = Quaternion.FromAngleAxis(360.0 * i / outerLights * Constants.DegreesToRadians, Vector3.UnitZ) *
                    Quaternion.FromAngleAxis(20.0 * Constants.DegreesToRadians, Vector3.UnitX) *
                    Vector3.NegativeUnitZ;

                camLights.Add(light);
                camOuterLightNode.AttachObject(light);
            }
        }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:57,代码来源:MultiLights.cs


示例6: Clipmap

        public Clipmap(SceneManager scene)
        {
            _scene = scene;
            _scene.QueueStarted += (sender, args) =>
            {
                if (args.RenderQueueId == _scene.GetRenderQueue().DefaultRenderGroup)
                    QueuePatches(_scene.GetRenderQueue());
                args.SkipInvocation = false;
            };

            using (var testMap = (Bitmap)Image.FromFile(@"height.jpg"))
            {
                _testMapWidth = testMap.Width;
                _testMapHeight = testMap.Height;
                _testMap = new float[_testMapWidth * _testMapHeight];
                var i = 0;
                for (var y = 0; y < testMap.Height; y++)
                    for (var x = 0; x < testMap.Width; x++)
                        _testMap[i++] = testMap.GetPixel(x, y).R / 255.0f;
            }

            var tu = _shader.Sampler(() => _shader.Heightmap);
            tu.DesiredFormat = PixelFormat.FLOAT32_RGB;
            tu.SetTextureFiltering(FilterOptions.Point, FilterOptions.Point, FilterOptions.None);
            tu.SetTextureAddressingMode(TextureAddressing.Wrap);
            tu.BindingType = TextureBindingType.Vertex;

            _shader.SetAuto(() => _shader.ModelViewProjectionMatrix, GpuProgramParameters.AutoConstantType.WorldViewProjMatrix);
            //_shader.SetAuto(() => _shader.NormalMatrix, GpuProgramParameters.AutoConstantType.ACT_INVERSE_TRANSPOSE_WORLDVIEW_MATRIX);
            _shader.SetAuto(() => _shader.ScaleFactor, GpuProgramParameters.AutoConstantType.Custom, 0);
            _shader.SetAuto(() => _shader.FineBlockOrigin, GpuProgramParameters.AutoConstantType.Custom, 1);

            Position = new IntFloatVector2(new IntFloat(-_testMapWidth / 4), new IntFloat(-_testMapHeight / 4));

            Locations = new PatchLocations(H, M);

            var scale = Scale;
            var scaleInt = 1;

            for (var i = 0; i < Levels; i++)
            {
                _levels[i] = new ClipmapLevel(scale, scaleInt, this);
                var level = _levels[i];
                tu.SetTextureName(level.Heightmap.Name);
                var m = _shader.CloneMaterial("ClipmapLevel" + i);
                _levels[i].Material = m;

                scale *= 2.0f;
                scaleInt *= 2;
            }

            UpdatePosition();
            Reset();

            _initialized = true;
        }
开发者ID:hach-que,项目名称:SLSharp,代码行数:56,代码来源:Clipmap.cs


示例7: PCZSceneNode

		public PCZSceneNode( SceneManager creator, string name )
			: base( creator, name )
		{
			homeZone = null;
			anchored = false;
			allowedToVisit = true;
			lastVisibleFrame = 0;
			lastVisibleFromCamera = null;
			enabled = true;
		}
开发者ID:WolfgangSt,项目名称:axiom,代码行数:10,代码来源:PCZSceneNode.cs


示例8: PCZSceneNode

		public PCZSceneNode( SceneManager creator, string name )
			: base( creator, name )
		{
			this.homeZone = null;
			this.anchored = false;
			AllowToVisit = true;
			LastVisibleFrame = 0;
			LastVisibleFromCamera = null;
			Enabled = true;
		}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:10,代码来源:PCZSceneNode.cs


示例9: PointLight

 public PointLight(WorldEditor worldEditor, IWorldContainer parent, SceneManager scene, string name, ColorEx specular, ColorEx diffuse, Vector3 position)
 {
     this.app = worldEditor;
     this.parent = parent;
     this.scene = scene;
     this.name = name;
     this.position = position;
     this.specular = specular;
     this.diffuse = diffuse;
     this.terrainOffset = app.Config.DefaultPointLightHeight;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:11,代码来源:PointLight.cs


示例10: Region

 public Region(StaticGeometry parent, string name, SceneManager mgr, UInt32 regionID, Vector3 center)
 {
     this.parent = parent;
     this.name = name;
     this.sceneMgr = mgr;
     this.regionID = regionID;
     this.center = center;
     queuedSubMeshes = new List<QueuedSubMesh>();
     lodSquaredDistances = new List<float>();
     aabb = new AxisAlignedBox();
     lodBucketList = new List<LODBucket>();
     shadowRenderables = new ShadowRenderableList();
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:13,代码来源:Region.cs


示例11: ManagerContainsNode

        private static bool ManagerContainsNode( SceneManager sceneManager, SceneNode childNode )
        {
            bool managerContainsChild = false;

            foreach ( SceneNode sceneNode in sceneManager.SceneNodes )
            {
                if ( sceneNode.Equals( childNode ) )
                {
                    managerContainsChild = true;
                }
            }
            return managerContainsChild;
        }
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:13,代码来源:PCZSceneManagerRegressionTests.cs


示例12: DisplayParticleSystem

 public DisplayParticleSystem(String name, SceneManager scene, string particleSystemName, Vector3 position, Vector3 scale, Vector3 rotation, float velocityScale, float particleScale)
 {
     this.name = name;
     this.scene = scene;
     this.particleSystemName = particleSystemName;
     this.position = position;
     this.scale = scale;
     this.rotation = rotation;
     this.particleScale = particleScale;
     this.velocityScale = velocityScale;
     attached = false;
     AddToScene();
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:13,代码来源:DisplayParticleSystem.cs


示例13: SceneManagerEnumerator

        /// <summary>
        ///     Internal constructor.  This class cannot be instantiated externally.
        /// </summary>
        internal SceneManagerEnumerator()
        {
            if (instance == null) {
                instance = this;

                // by default, use the standard scene manager.
                defaultSceneManager = new SceneManager("Default Scene Manager");

                // by default, all scenetypes use the default Scene Manager.  Note: These can be overridden by plugins.
                SetSceneManager(SceneType.Generic, defaultSceneManager);
                SetSceneManager(SceneType.ExteriorClose, defaultSceneManager);
                SetSceneManager(SceneType.ExteriorFar, defaultSceneManager);
                SetSceneManager(SceneType.Interior, defaultSceneManager);
                SetSceneManager(SceneType.Overhead, defaultSceneManager);
            }
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:19,代码来源:SceneManagerList.cs


示例14: OnLoad

		public void OnLoad()
		{
			//ResourceGroupManager.Instance.AddResourceLocation("media", "Folder", true);

			_root.SceneManager = _sceneManager = _root.CreateSceneManager(SceneType.ExteriorClose);
			_sceneManager.ClearScene();

			_camera = _sceneManager.CreateCamera("MainCamera");

			_camera.Position = new Vector3(0, 0, 500);
			_camera.LookAt(new Vector3(0, 0, -300));
			_camera.Near = 5;
			_camera.AutoAspectRatio = true;
			_camera.FieldOfView = 0.70f;
			_viewport = _renderWindow.AddViewport(_camera, 0, 0, 1.0f, 1.0f, 100);
			_viewport.BackgroundColor = ColorEx.Black; ;

			_light = _sceneManager.CreateLight("light1");
			_light.Type = LightType.Directional;
			_light.Position = new Vector3(0, 150, 300);
			_light.Diffuse = ColorEx.Blue;
			_light.Specular = ColorEx.Blue;
			//_light.Direction = new Vector3(0, 0, -300);
			_sceneManager.AmbientLight = ColorEx.White;// new ColorEx(0.2f, 0.2f, 0.2f);

			ResourceGroupManager.Instance.InitializeAllResourceGroups();


			_inputReader = PlatformManager.Instance.CreateInputReader();
			_inputReader.Initialize(_renderWindow, true, true, false, false);

			_inputReader.UseKeyboardEvents = true;
			_inputReader.UseMouseEvents = false;

			//_renderItems.Add(new BasicCube());
			_renderItems.Add(new CubeBrowser());
			foreach (var i in _renderItems)
			{
				i.Initialise(_root);
			}
		}
开发者ID:Azerothian,项目名称:Illisian.Niva,代码行数:41,代码来源:Game.cs


示例15: Ship

        public Ship(SceneManager pSceneManager, Controller pController)
            : base(pController)
        {
            var name = Methods.GenerateUniqueID.ToString();

            Node = pSceneManager.RootSceneNode.CreateChildSceneNode(name);
            MeshNode = Node.CreateChildSceneNode();
            MeshNode.Orientation = new Quaternion(0.5, 0.5, -0.5, -0.5);
            MeshNode.AttachObject(pSceneManager.CreateEntity(name, "ship_assault_1.mesh"));

            UpgradeGroup = new UpgradeGroup
            {
                CannonAutoFire = { Level = 10 },
                CannonMultiFire = { Level = 10 },
                CannonSpeed = { Level = 7 },
                CannonPower = { Level = 5 }
            };

            cannon = new Cannon(this);
            UpgradeGroup.UpgradeCannon(ref cannon, UpgradeGroup);
        }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:21,代码来源:Ship.cs


示例16: Arena

        public Arena(SceneManager pSceneManager, Int32 pScale, Int32 pNumAdditionalGrids)
        {
            var random = new Random();
            var topgrid = pSceneManager.CreateEntity("grid top", "grid.mesh");
            var topgridnode = pSceneManager.RootSceneNode.CreateChildSceneNode("grid top");

            topgridnode.Position = new Vector3(0, 0, -10);
            topgridnode.Orientation = Quaternion.FromAxes(Vector3.UnitX, Vector3.UnitZ, Vector3.NegativeUnitY);
            topgridnode.Scale = new Vector3(pScale, 1, pScale);
            topgridnode.AttachObject(topgrid);

            Width = (Int32)(topgrid.BoundingBox.Size.x * pScale);
            Height = (Int32)(topgrid.BoundingBox.Size.z * pScale);

            Right = Width / 2;
            Bottom = Height / 2;
            Left = -Right;
            Top = -Bottom;

            for (var i = 1; i <= pNumAdditionalGrids; i++)
            {
                var grid = pSceneManager.CreateEntity("grid" + i, "grid.mesh");
                var gridnode = pSceneManager.RootSceneNode.CreateChildSceneNode("grid" + i);

                gridnode.Position = new Vector3(
                    random.Next(-pScale / 5, pScale / 5),
                    random.Next(-pScale / 5, pScale / 5),
                    -10 - pScale * i / 10);
                gridnode.Orientation = Quaternion.FromAxes(
                    Vector3.UnitX,
                    Vector3.UnitZ,
                    Vector3.NegativeUnitY);
                gridnode.Scale = new Vector3(
                    pScale + i * random.Next(pScale / 8, pScale / 4),
                    1,
                    pScale + i * random.Next(pScale / 8, pScale / 4));
                gridnode.AttachObject(grid);
            }
        }
开发者ID:jonathandlo,项目名称:Evolution_War,代码行数:39,代码来源:Arena.cs


示例17: DisplayObject

        public DisplayObject(IWorldObject parent, WorldEditor app, string name, string type, SceneManager scene, string meshName, Vector3 position, Vector3 scale, Vector3 rotation, SubMeshCollection subMeshCollection)
        {
            this.name = name;
            this.scene = scene;
            this.meshName = meshName;
            this.type = type;
            this.parent = parent;
            oidCounter++;
            this.oid = oidCounter;
            this.app = app;

            // if we were passed a subMeshCollection, then use it, otherwise make one.
            if (subMeshCollection == null)
            {
                this.subMeshCollection = new SubMeshCollection(meshName);
            }
            else
            {
                this.subMeshCollection = subMeshCollection;
            }

            AddToScene(position, scale, rotation);
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:23,代码来源:DisplayObject.cs


示例18: ChooseSceneManager

 protected void ChooseSceneManager()
 {
     scene = Root.Instance.SceneManagers.GetSceneManager(SceneType.ExteriorClose);
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:4,代码来源:TerrainGenerator.cs


示例19: DestroyInstance

		/// <summary>
		///		Destroys an instance of a SceneManager.
		/// </summary>
		/// <param name="instance"></param>
		public abstract void DestroyInstance( SceneManager instance );
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:5,代码来源:SceneManager.cs


示例20: DefaultIntersectionSceneQuery

		protected internal DefaultIntersectionSceneQuery( SceneManager creator )
			: base( creator )
		{
			// No world geometry results supported
			this.AddWorldFragmentType( WorldFragmentType.None );
		}
开发者ID:mono-soc-2011,项目名称:axiom,代码行数:6,代码来源:SceneManager.cs



注:本文中的Axiom.Core.SceneManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Core.SceneNode类代码示例发布时间:2022-05-24
下一篇:
C# Core.ColorEx类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap