本文整理汇总了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;
}
示例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);*/
}