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

C# IrrlichtNETCP.SceneNode类代码示例

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

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



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


示例16: CreateBox3DFromNode

        public static void CreateBox3DFromNode(SceneNode node, out Box3D box)
        {
            float minX = float.MaxValue;
            float minY = float.MaxValue;
            float minZ = float.MaxValue;
            float maxX = float.MinValue;
            float maxY = float.MinValue;
            float maxZ = float.MinValue;

            Vector3D[] edges;
            node.BoundingBox.GetEdges(out edges);
            Matrix4 m = new Matrix4();
            m.RotationDegrees = node.Rotation;
            m.Translation = node.Position;
            for (int i = 0; i < edges.Length; i++)
            {
                Vector3D v = edges[i] * node.Scale;
                v = m.TransformVect(ref v);

                if (v.X < minX)
                    minX = v.X;

                if (v.Y < minY)
                    minY = v.Y;

                if (v.Z < minZ)
                    minZ = v.Z;

                if (v.X > maxX)
                    maxX = v.X;

                if (v.Y > maxY)
                    maxY = v.Y;

                if (v.Z > maxZ)
                    maxZ = v.Z;
            }

            box = new Box3D(minX, minY, minZ, maxX, maxY, maxZ);
        }
开发者ID:yooyke,项目名称:work,代码行数:40,代码来源:Util.cs


示例17: AddGhostSceneNode

        public SceneNode AddGhostSceneNode(SceneNode _parentNode)
        {
            ParticleSystemSceneNode node = Reference.SceneManager.AddParticleSystemSceneNode(false, _parentNode, -1);

            ParticleEmitter em = node.CreateBoxEmitter(
                new Box3D(0, 0, 0, 0.4f, 1.4f, 0.4f),
                new Vector3D(0.000f, 0.0004f, 0.000f),
                20,
                26,
                new Color(0, 255, 255, 191),
                new Color(0, 191, 255, 255),
                600,
                900,
                360
                );

            node.SetEmitter(em);
            em.MinStartSize = new Dimension2Df(0.6f, 0.6f);
            em.MaxStartSize = new Dimension2Df(0.6f, 0.6f);
            em.Drop();
            lock (emitterCleanup) { if (!emitterCleanup.ContainsKey(_parentNode.Raw)) { emitterCleanup.Add(_parentNode.Raw, em); } }

            ParticleAffector paf = node.CreateFadeOutParticleAffector(new Color(0, 0, 0, 0), 150);
            node.AddAffector(paf);
            // paf.Dispose(); <- seems to cause AccessViolationExceptions in AvatarManager
            paf.Drop();
            lock (affectorCleanup) { if (!affectorCleanup.ContainsKey(_parentNode.Raw)) { affectorCleanup.Add(_parentNode.Raw, paf); } }

            node.Position = new Vector3D(0, 0, 0);
            node.SetMaterialFlag(MaterialFlag.Lighting, false);
            node.SetMaterialType(MaterialType.TransparentVertexAlpha);

            Texture tex = Reference.VideoDriver.GetTexture(Util.ApplicationDataDirectory + @"/media/textures/ghost.bmp");
            if (tex != null)
                node.SetMaterialTexture(0, tex);

            return node;
        }
开发者ID:foxracle,项目名称:3di-viewer-rei,代码行数:38,代码来源:EffectManager.cs


示例18: ATMOSphere

        public ATMOSphere(Timer _timer, SceneNode parent, SceneManager mgr, int id)
            : base(parent, mgr, id)
        {

            smgr = mgr;
            driver = smgr.VideoDriver;
            timer = _timer;
            currentTime = timer.RealTime;
            startTime = timer.RealTime;
            dTime = 0.0f;
            rad = 0.017453292519943295769236907684886f;
            sun_angle = new double[2];
            Ndate = new ushort[5];
            J1minute = 1.0f / 1440.0f;
            sun_interpolation_speed = 30.0f;
            dayspeed = 60.0f;
            vieta = new double[4];
            J = DateToJulian(2006, 2, 27, 7, 50);
            J1 = J;
            counter_time = 0.0f;
            uvX = 0.0f;
            time_int_step = 0.0f;
		
        }
开发者ID:RealBadAngel,项目名称:irrlicht.netcp,代码行数:24,代码来源:ATMOSphere.cs


示例19: WaterSceneNode

 public WaterSceneNode(SceneNode parent, SceneManager mgr, Dimension2Df tileSize, Dimension2D tileCount)
     : this(parent, mgr, tileSize, tileCount, new Dimension2D(256, 256), -1)
 {
 }
开发者ID:Paulus,项目名称:irrlichtnetcp,代码行数:4,代码来源:WaterSceneNode.cs


示例20: NodeCount

        private int NodeCount(SceneNode node)
        {
            int count = 1;
            foreach (SceneNode child in node.Children)
                count += NodeCount(child);

            return count;
        }
开发者ID:yooyke,项目名称:work,代码行数:8,代码来源:Information.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IrrlichtNETCP.Vector3D类代码示例发布时间:2022-05-26
下一篇:
C# Parsing.SourceLocation类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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