public void Execute(int index, [ReadOnly] ref Transform3D transform3D, ref BoidTag tag)
            {
                var floorVal = math.floor(transform3D.Position / CellRadius);
                var hash     = (int)Unity.Mathematics.math.hash(floorVal);

                HashMap.Add(hash, index);
            }
Ejemplo n.º 2
0
            public void Execute(int index, [ReadOnly] ref Transform3D transform3D, [ReadOnly] ref BoidTag Tag)
            {
                var ptr = CellAry.GetPointer(index);

                ptr->Separation = transform3D.Position;
                ptr->Alignment  = transform3D.Forward;
                ptr->Count      = 1;
            }
 private int _GetOffsetOfBoidTag_Pad()
 {
     var tempObj = new BoidTag(); BoidTag *ptr = &tempObj; var filedPtr = &(ptr->Pad); return((int)((long)filedPtr - (long)ptr));
 }