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


C# BoundingBox.Extend方法代码示例

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


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

示例1: VegetationMiniPartCollection

 public VegetationMiniPartCollection(ICollection<VegetationMiniPart> ps)
 {
     ManagedWorld.NodeLibrary.RemoveNode(this);
     gps = ps.ToArray<VegetationMiniPart>();
     p = gps[0].sPath;
     D = gps[0].mBody.Device;
     //List<Vector3> ms = new List<Vector3>();
     //List<Quaternion> qs = new List<Quaternion>();
     List<byte> bs = new List<byte>();
     int stride = 3 * 4 + 4 * 4;//float3 + float4
     BoundingBox abs = new BoundingBox(new Vector3(1E10f), new Vector3(-1E10f));
     foreach (VegetationMiniPart gp in gps)
     {
         abs = abs.Extend(gp.bb);
         //ms.Add(gp.vPosition);
         //qs.Add(gp.qOrientation);
         bs.AddRange(gp.vPosition.GetBytes());
         bs.AddRange(gp.qOrientation.GetBytes());
     }
     this.BoundingBox = abs;
     DataStream ds = new DataStream(bs.ToArray(), true, true);
     sBuffer = new ShaderResourceBuffer(ds, SlimDX.Direct3D11.BindFlags.VertexBuffer, SlimDX.Direct3D11.CpuAccessFlags.None, SlimDX.Direct3D11.ResourceUsage.Default, SlimDX.Direct3D11.ResourceOptionFlags.None, stride, D);
     ds.Dispose();
     vb = new SlimDX.Direct3D11.VertexBufferBinding(sBuffer.Buffer, sBuffer.Description.StructureByteStride, 0);
     qTST = new GraphicNode("", null, D); qTST.BoundingBox = this.BoundingBox; qTST.ParentNode = this;
 }
开发者ID:hhergeth,项目名称:RisenEditor,代码行数:26,代码来源:GrassNode.cs

示例2: Build

 private static void Build(API_Device D, Dictionary<string, List<VegetationMiniPart>> ps)
 {
     BoundingBox bb = new BoundingBox(new Vector3(1E10f), new Vector3(-1E10f));
     foreach (KeyValuePair<string, List<VegetationMiniPart>> kvp in ps)
     {
         if (easy)
         {
             VegetationMiniPartCollection gp = new VegetationMiniPartCollection(kvp.Value);
             lrentPatches.Add(gp);
             bb = bb.Extend(gp.BoundingBox);
         }
         else
         {
             BoundingBox BB2 = new BoundingBox(new Vector3(1E10f), new Vector3(-1E10f));
             foreach (VegetationMiniPart gp in kvp.Value)
                 BB2 = BB2.Extend(gp.bb);
             bb = bb.Extend(BB2);
             mDepth = 3;
             float l = (bb.Maximum - bb.Minimum).Length();
             if (l < 5000)
                 mDepth = 0;
             bTree(kvp.Value, lrentPatches, 0, BB2);
         }
     }
     List<Node> qs = lrentPatches.Cast<Node>().ToList();
     trees.Add(new OcTree.Oc(bb, qs, 0, null));
     /*
     if (trees.Count == 0)
         return;
     bb = trees[0].ContainerBox;
     IList<Node> ns = new List<Node>();
     foreach (OcTree.Oc on in trees)
     {
         bb = bb.Extend(on.ContainerBox);
         on.Find(ref ns, ref bb);
     }
     qT = new OcTree.Oc(bb, ns, 0, trees[0].Device);*/
 }
开发者ID:hhergeth,项目名称:RisenEditor,代码行数:38,代码来源:GrassNode.cs


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