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


C# Box.GetBoxLines方法代码示例

本文整理汇总了C#中Sledge.DataStructures.Geometric.Box.GetBoxLines方法的典型用法代码示例。如果您正苦于以下问题:C# Box.GetBoxLines方法的具体用法?C# Box.GetBoxLines怎么用?C# Box.GetBoxLines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sledge.DataStructures.Geometric.Box的用法示例。


在下文中一共展示了Box.GetBoxLines方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IntersectsWithBox

 /// <summary>
 /// Test this face to see if the given bounding box intersects with it
 /// </summary>
 /// <param name="box">The box to test against</param>
 /// <returns>True if the box intersects</returns>
 public bool IntersectsWithBox(Box box)
 {
     var verts = Vertices.Select(x => x.Location).ToList();
     return box.GetBoxLines().Any(x => GetIntersectionPoint(verts, x, true) != null);
 }
开发者ID:silky,项目名称:sledge,代码行数:10,代码来源:Face.cs

示例2: Render

 public override void Render(ViewportBase viewport)
 {
     if (_state == EntityState.None) return;
     TextureHelper.DisableTexturing();
     var high = Document.GameData.MapSizeHigh;
     var low = Document.GameData.MapSizeLow;
     if (viewport is Viewport3D)
     {
         var offset = new Coordinate(20, 20, 20);
         var start = _location - offset;
         var end = _location + offset;
         var box = new Box(start, end);
         GL.Begin(BeginMode.Lines);
         GL.Color3(Color.LimeGreen);
         foreach (var line in box.GetBoxLines())
         {
             Coord(line.Start);
             Coord(line.End);
         }
         Coord(low, _location.DY, _location.DZ);
         Coord(high, _location.DY, _location.DZ);
         Coord(_location.DX, low, _location.DZ);
         Coord(_location.DX, high, _location.DZ);
         Coord(_location.DX, _location.DY, low);
         Coord(_location.DX, _location.DY, high);
         GL.End();
     }
     else if (viewport is Viewport2D)
     {
         var vp = viewport as Viewport2D;
         var units = vp.PixelsToUnits(5);
         var offset = new Coordinate(units, units, units);
         var start = vp.Flatten(_location - offset);
         var end = vp.Flatten(_location + offset);
         GL.Begin(BeginMode.LineLoop);
         GL.Color3(Color.LimeGreen);
         Coord(start.DX, start.DY, start.DZ);
         Coord(end.DX, start.DY, start.DZ);
         Coord(end.DX, end.DY, start.DZ);
         Coord(start.DX, end.DY, start.DZ);
         GL.End();
         GL.Begin(BeginMode.Lines);
         var loc = vp.Flatten(_location);
         Coord(low, loc.DY, 0);
         Coord(high, loc.DY, 0);
         Coord(loc.DX, low, 0);
         Coord(loc.DX, high, 0);
         GL.End();
     }
     TextureHelper.EnableTexturing();
 }
开发者ID:jpiolho,项目名称:sledge,代码行数:51,代码来源:EntityTool.cs

示例3: Render3DBox

 protected virtual void Render3DBox(Viewport3D viewport, Coordinate start, Coordinate end)
 {
     var box = new Box(start, end);
     TextureHelper.Unbind();
     GL.Begin(PrimitiveType.Lines);
     GL.Color4(GetRenderBoxColour());
     foreach (var line in box.GetBoxLines())
     {
         Coord(line.Start);
         Coord(line.End);
     }
     GL.End();
 }
开发者ID:KonstantinUb,项目名称:sledge,代码行数:13,代码来源:BaseBoxTool.cs

示例4: Render

        public override void Render(ViewportBase viewport)
        {
            if (_currentPoint != null)
            {
                var sub = new Coordinate(40, 40, 40);
                var pointBox = new Box(_currentPoint.CurrentPosition.Location - sub, _currentPoint.CurrentPosition.Location + sub);

                TextureHelper.Unbind();
                GL.LineWidth(3);
                GL.Begin(PrimitiveType.Lines);
                GL.Color3(1f, 1, 0);
                foreach (var line in pointBox.GetBoxLines())
                {
                    GL.Vertex3(line.Start.DX, line.Start.DY, line.Start.DZ);
                    GL.Vertex3(line.End.DX, line.End.DY, line.End.DZ);
                }
                GL.End();
                GL.LineWidth(1);
            }
        }
开发者ID:silky,项目名称:sledge,代码行数:20,代码来源:GeometryTool.cs


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