Here are the examples of the csharp api System.Collections.Generic.List.Add(hkcdStaticTreeCodec3Axis4) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
View Source File : BVH.cs
License : MIT License
Project Creator : katalash
License : MIT License
Project Creator : katalash
public List<hkcdStaticTreeCodec3Axis4> BuildAxis4Tree()
{
var ret = new List<hkcdStaticTreeCodec3Axis4>();
void CompressNode(BVNode node, Vector3 pbbmin, Vector3 pbbmax)
{
var currindex = ret.Count();
var compressed = new hkcdStaticTreeCodec3Axis4();
ret.Add(compressed);
// Compress the bounding box
compressed.m_xyz_0 = CompressDim(node.Min.X, node.Max.X, pbbmin.X, pbbmax.X);
compressed.m_xyz_1 = CompressDim(node.Min.Y, node.Max.Y, pbbmin.Y, pbbmax.Y);
compressed.m_xyz_2 = CompressDim(node.Min.Z, node.Max.Z, pbbmin.Z, pbbmax.Z);
// Read back the decompressed bounding box to use as reference for next compression
var min = compressed.DecompressMin(pbbmin, pbbmax);
var max = compressed.DecompressMax(pbbmin, pbbmax);
if (node.IsLeaf)
{
compressed.m_data = (byte)(node.Primitive * 2);
}
else
{
// Add the left as the very next node
CompressNode(node.Left, min, max);
// Encode the index of the right then add it. The index should
// always be even
compressed.m_data = (byte)((ret.Count() - currindex) | 0x1);
// Now encode the right
CompressNode(node.Right, min, max);
}
}
CompressNode(this, Min, Max);
return ret;
}