当前位置: 首页>>代码示例>>C#>>正文


C# Core.SceneManager类代码示例

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


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

示例5: 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

示例6: 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

示例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


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