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


C# IrrlichtNETCP.SceneNode类代码示例

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


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

示例1: Sea

 public Sea(Viewer viewer, SceneNode _parentNode)
     : base(viewer, -1, _parentNode)
 {
     shaderDirectory = Util.ApplicationDataDirectory + @"\media\shaders\";
     modelDirectory = Util.ApplicationDataDirectory + @"\media\models\";
     textureDirectory = Util.ApplicationDataDirectory + @"\media\textures\";
 }
开发者ID:caocao,项目名称:3di-viewer-rei,代码行数:7,代码来源:Sea.cs

示例2: GrassPatchSceneNode

        public GrassPatchSceneNode(SceneNode parent, SceneManager mgr, int id, bool createIfEmpty,
                                   Vector3D gridPos, string filepath, Texture heightMap, Texture colourMap,
                                   Texture grassMap, SceneNode terrain, WindGenerator wind)
            : base(parent, mgr, id)
        {
            DrawDistance = GRASS_PATCH_SIZE * 1.5f;
            MaxDensity = 800;
            TerrainHeightMap = heightMap;
            TerrainColourMap = colourMap;
            TerrainGrassMap = grassMap;
            Terrain = terrain;
            WindGen = wind;
            lastwindtime = 0;
            lastdrawcount = 0;
            redrawnextloop = true;
            MaxFPS = 0;
            _mgr = mgr;
            WindRes = 5;

            filename = string.Format("{0}/{1}.{2}.grass", filepath, gridpos.X, gridpos.Z);
            gridpos = gridPos;
            Position = new Vector3D(gridpos.X * GRASS_PATCH_SIZE, 0f,
                                    gridpos.Z * GRASS_PATCH_SIZE);

            ImageCount = new Dimension2D(4, 2);

            if (!Load())
                Create(createIfEmpty);
        }
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:29,代码来源:GrassPatchSceneNode.cs

示例3: DirectionalLight

 public DirectionalLight(Viewer viewer, SceneNode _parentNode, string _name)
     : base(viewer, -1)
 {
     parentNode = _parentNode;
     rotation = new Vector3D();
     name = _name;
 }
开发者ID:caocao,项目名称:3di-viewer-rei,代码行数:7,代码来源:DirectionalLight.cs

示例4: Load

        public override void Load()
        {
            node = Render.Scene.AddSphereSceneNode(0.1f, 32, Root);
            node.SetMaterialFlag(MaterialFlag.Lighting, true);

            base.Load();
        }
开发者ID:yooyke,项目名称:work,代码行数:7,代码来源:Point.cs

示例5: AnimateNode

 public override void AnimateNode(SceneNode node, uint timeMs)
 {
     Vector3D NewRotation = node.Rotation;
     NewRotation += Rotation* ((timeMs-StartTime)/10.0f);
     node.Rotation = (NewRotation);
     StartTime = timeMs;
 }
开发者ID:Paulus,项目名称:irrlichtnetcp,代码行数:7,代码来源:Program.cs

示例6: AbsoluteMatrix

        public static Matrix4 AbsoluteMatrix(SceneNode bone)
        {
            Matrix4 mat = bone.RelativeTransformation;

            if (bone.Parent != null)
                mat *= AbsoluteMatrix(bone.Parent);

            return mat;
        }
开发者ID:yooyke,项目名称:work,代码行数:9,代码来源:Util.cs

示例7: LaserDataSceneNode

        public LaserDataSceneNode(SceneNode parent, SceneManager mgr, int id)
            : base(parent, mgr, id)
        {
            _mgr = mgr;
            _driver = _mgr.VideoDriver;
            Material.Wireframe = false;
            Material.Lighting = false;

            create_mesh();
        }
开发者ID:uplusplus,项目名称:ubuntu-android-env,代码行数:10,代码来源:LaserViewer3D.cs

示例8: AddTextSceneNodeW

        public TextSceneNode AddTextSceneNodeW(GUIFont font, string text, Color color, SceneNode parent)
        {
            IntPtr par = IntPtr.Zero;
            if (parent != null)
                par = parent.Raw;
#if !LINUX
			return (TextSceneNode)
                NativeElement.GetObject(SceneManager_AddTextSceneNodeW(_raw, font.Raw, text, color.ToUnmanaged(), par),
                                        typeof(TextSceneNode));
#else
			return (TextSceneNode)
                NativeElement.GetObject(SceneManager_AddTextSceneNode(_raw, font.Raw, text, color.ToUnmanaged(), par),
                                        typeof(TextSceneNode));
#endif
		}
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:15,代码来源:IrrlichtNETCP_Unicode_Partial.cs

示例9: WaterSceneNode

		public WaterSceneNode(SceneNode parent, SceneManager mgr, Dimension2Df tileSize,
		                      Dimension2D tileCount, Dimension2D precision, int id) : 
			base(parent, mgr, id)
		{
			_scene = mgr;
			_driver = mgr.VideoDriver;
			
			AnimatedMesh wmesh =  _scene.AddHillPlaneMesh("watermesh" + _current,
                tileSize,
                tileCount, 0,
                new Dimension2Df(0, 0),
                new Dimension2Df(1, 1));
           	_current++; 
           	 
            int dmat = (int)MaterialType.Reflection2Layer;
            if(_driver.DriverType == DriverType.OpenGL)
                dmat = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
                 WATER_VERTEX_GLSL, "main", VertexShaderType._1_1, WATER_FRAGMENT_GLSL,
                 "main", PixelShaderType._1_1, OnShaderSet, MaterialType.TransparentAlphaChannel, 0);
            else
                dmat = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
                 WATER_HLSL, "vertexMain", VertexShaderType._2_0, WATER_HLSL,
                 "pixelMain", PixelShaderType._2_0, OnShaderSet, MaterialType.TransparentAlphaChannel, 2);

            if (_driver.DriverType == DriverType.OpenGL)
                ClampShader = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
                 CLAMP_VERTEX_GLSL, "main", VertexShaderType._1_1, CLAMP_FRAGMENT_GLSL,
                 "main", PixelShaderType._1_1, OnShaderSet, MaterialType.TransparentAlphaChannel, 1);
            else
                ClampShader = _driver.GPUProgrammingServices.AddHighLevelShaderMaterial(
                 CLAMP_HLSL, "vertexMain", VertexShaderType._2_0, CLAMP_HLSL,
                 "pixelMain", PixelShaderType._2_0, OnShaderSet, MaterialType.TransparentAlphaChannel, 3);
                 
           	_waternode = _scene.AddMeshSceneNode(wmesh.GetMesh(0), this, -1);  
            _waternode.SetMaterialType(dmat);
            _waternode.SetMaterialFlag(MaterialFlag.BackFaceCulling, false);
            _waternode.SetMaterialFlag(MaterialFlag.Lighting, false);
            _waternode.SetMaterialFlag(MaterialFlag.FogEnable, false);
            
            _rt = _driver.CreateRenderTargetTexture(precision);
            _waternode.SetMaterialTexture(0, _rt); 
            
            CameraSceneNode oldcam = _scene.ActiveCamera;
            _fixedcam = _scene.AddCameraSceneNode(null);
            if(oldcam != null)
            	_scene.ActiveCamera = oldcam;
		}
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:47,代码来源:WaterSceneNode.cs

示例10: ATMOSkySceneNode

        public ATMOSkySceneNode(Texture tex, SceneNode parent, SceneManager mgr, int faces, int id)
            : base(parent, mgr, id)
        {
            smgr = mgr;
            AutomaticCulling = CullingType.Off;
            material = new Material();
            material.Lighting = false;
            material.ZBuffer = 0;
            material.Texture1 = tex;

            face = faces;
            vertices = new Vertex3D[face + 1];
            indices = new ushort[face * 3];

            double angle = 0.0f;
            double angle2 = 360.0f / face;
            vert = 0;                          //vertice nr
            int nr = -3;                     //indices nr

            vertices[0] = new Vertex3D(Vector3D.From(0.0f, 100.0f, 0.0f),
                                       Vector3D.From(0.0568988f, 0.688538f, -0.722965f),
                                       Color.White,
                                       Vector2D.From(0.0f, 0.1f)
                                      );

            double x, z;

            for (ushort n = 1; n < face + 1; n++)
            {
                vert++;
                nr += 3;
                x = Math.Cos(angle * 0.017453292519943295769236907684886f) * 100;
                z = Math.Sin(angle * 0.017453292519943295769236907684886f) * 100;

                vertices[vert] = new Vertex3D(Vector3D.From((float)x, -5.0f, (float)z),
                                       Vector3D.From(0.0568988f, 0.688538f, -0.722965f),
                                       Color.White,
                                       Vector2D.From(0.0f, 0.9f)
                                      );

                angle = angle + angle2;
                indices[nr] = 0;
                indices[nr + 1] = (ushort)vert;
                indices[nr + 2] = (ushort)(vert + 1);
            }
            indices[nr + 2] = 1;
        }
开发者ID:Paulus,项目名称:irrlichtnetcp,代码行数:47,代码来源:ATMOSphere.cs

示例11: CustomSceneNode

        public CustomSceneNode(SceneNode parent, SceneManager mgr, int id)
            : base(parent, mgr, id)
        {
            _mgr = mgr;
            _driver = _mgr.VideoDriver;
            Material.Wireframe = false;
            Material.Lighting = false;

            Vertices[0] = new Vertex3D(new Vector3D(0, 0, 10), new Vector3D(1, 1, 0), Color.From(255, 0, 255, 255), new Vector2D(0, 1));
            Vertices[1] = new Vertex3D(new Vector3D(10, 0, -10), new Vector3D(1, 0, 0), Color.From(255, 255, 0, 255), new Vector2D(1, 1));
            Vertices[2] = new Vertex3D(new Vector3D(0, 20, 0), new Vector3D(0, 1, 1), Color.From(255, 255, 255, 0), new Vector2D(1, 0));
            Vertices[3] = new Vertex3D(new Vector3D(-10, 0, -10), new Vector3D(0, 0, 1), Color.From(255, 0, 255, 0), new Vector2D(0, 0));

            Box = new Box3D();
            for (int i = 0; i < Vertices.Length; i++)
                Box.AddInternalPoint(Vertices[i].Position);
        }
开发者ID:Paulus,项目名称:irrlichtnetcp,代码行数:17,代码来源:Program.cs

示例12: LensflareSceneNode

        public LensflareSceneNode(SceneNode parent, SceneManager mgr, int id, Vector3D position)
            : base(parent, mgr, id)
        {
            draw_flare = true;
            ign_geom = false;
            smgr = mgr;

            indices = new ushort[6];
            indices[0] = 0;
            indices[1] = 2;
            indices[2] = 1;
            indices[3] = 0;
            indices[4] = 3;
            indices[5] = 2;

            vertices = new Vertex3D[4];
            for (int i = 0; i < 4; i++)
            {
                vertices[i] = new Vertex3D();
            }
            vertices[0].TCoords = Vector2D.From(0.0f, 1.0f);
            vertices[0].Color = Color.White;
            vertices[1].TCoords = Vector2D.From(0.0f, 0.0f);
            vertices[1].Color = Color.White;
            vertices[2].TCoords = Vector2D.From(1.0f, 0.0f);
            vertices[2].Color = Color.White;
            vertices[3].TCoords = Vector2D.From(1.0f, 1.0f);
            vertices[3].Color = Color.White;

            material = new Material();

            material.Lighting = false;

            material.MaterialType = MaterialType.TransparentAddColor;

            material.ZBuffer = 0;

            material.ZWriteEnable = false;

            bbox = new Box3D();

            bbox.MinEdge = Vector3D.From(-2, -2, -2);

            bbox.MaxEdge = Vector3D.From(2, 2, 2);

        }
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:46,代码来源:LensflareSceneNode.cs

示例13: Initialize

        public override void Initialize()
        {
            base.Initialize();

            // Set title camera
            System.Type type = this.GetType();
            camera = Render.Scene.AddCameraSceneNode(Render.Scene.RootSceneNode);
            camera.Position = new Vector3D(0, 0, -256);
            camera.Target = new Vector3D(0, 0, 0);
            camera.UpVector = new Vector3D(0, 0, 1);
            camera.Name = type.FullName + ".Camera" ;

            root = Render.Scene.AddEmptySceneNode(Render.Scene.RootSceneNode, -1);
            root.Name = type.FullName + ".Root";

            CreateTitle();
        }
开发者ID:yooyke,项目名称:work,代码行数:17,代码来源:Title.cs

示例14: BeamNode

        public BeamNode(SceneNode parent, SceneManager mgr, int id, string szBeam)
            : base(parent, mgr, id)
        {
            smgr = mgr;
            driver = smgr.VideoDriver;
            Material = new Material();
            // Setup the beam material
            Material.Wireframe = false;
            Material.Lighting = false;
            Material.MaterialType = MaterialType.TransparentAlphaChannel;
            Material.Texture1 = mgr.VideoDriver.GetTexture(szBeam);

            // Default to 32 units for the scale
            flScale = 32.0f;

            // Default to white
            beamColor.Set(255, 255, 255, 255);
        }
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:18,代码来源:BeamNode.cs

示例15: AnimateNode

 public override void AnimateNode(SceneNode p_node, uint p_currentTimeMs)
 {
     if (m_startTime == 0)
     {
         m_startTime = p_currentTimeMs;
     }
     if (p_currentTimeMs - m_startTime <= m_durationMs)
     {
         Vector3D t_currRotation = p_node.Rotation;
         t_currRotation = m_rotationStart.GetInterpolated(m_rotationEnd, (p_currentTimeMs - m_startTime) / (float)m_durationMs);
         p_node.Rotation = (t_currRotation);
         //m_startTime = p_currentTimeMs;
     }
     else
     {
         p_node.Rotation = m_rotationEnd;
         this.Null();
     }
 }
开发者ID:Paulus,项目名称:irrlichtnetcp,代码行数:19,代码来源:RotateAnimator.cs


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