Beispiel #1
0
            //const string SdfGenPath = "SdfGen.dll";
#endif

            public OctLean[] ManagedStructs()
            {
                var    s    = new OctLean[Length];
                IntPtr sptr = Structs;

                for (int i = 0; i < Length; i++)
                {
                    s[i]  = Marshal.PtrToStructure <OctLean>(sptr);
                    sptr += 8;
                }
                return(s);
            }
Beispiel #2
0
        private void Cast(List <OctLean> octs, List <Byte8> values, float scale, Vector3 pos, int parent, int at)
        {
            int childstart = -1;

            if (Children != null)
            {
                childstart = octs.Count;

                for (int i = 0; i < 8; i++)
                {
                    octs.Add(new OctLean());
                    values.Add(new Byte8());
                }
                for (int i = 0; i < 8; i++)
                {
                    Children[i].Cast(octs, values, scale / 2, pos + SdfMath.split(i).Vector *scale / 2, at, childstart + i);
                }
            }
            octs[at]   = new OctLean(parent, childstart);
            values[at] = new Byte8(Vertices, scale);
        }