當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。