public Ribbonizer(ShapeBuilderRibbon ribbon, int newCapacity, int sectionsPerParticle) { parentRibbon = ribbon; lastParticle = 0; sections = sectionsPerParticle; int requiredCapacity = sectionsPerParticle * newCapacity; particleCapacity = requiredCapacity; int positionDataSize = Utilities.SizeOf <Vector3>() * particleCapacity; positionDataSize = (positionDataSize % 4 == 0) ? positionDataSize : (positionDataSize + 4 - (positionDataSize % 4)); positionData = Utilities.AllocateMemory(positionDataSize); int sizeDataSize = Utilities.SizeOf <float>() * particleCapacity; sizeDataSize = (sizeDataSize % 4 == 0) ? sizeDataSize : (sizeDataSize + 4 - (sizeDataSize % 4)); sizeData = Utilities.AllocateMemory(sizeDataSize); }
public Ribbonizer(ShapeBuilderRibbon ribbon, int newCapacity, int sectionsPerParticle) { parentRibbon = ribbon; lastParticle = 0; sections = sectionsPerParticle; int requiredCapacity = sectionsPerParticle * newCapacity; particleCapacity = requiredCapacity; int positionDataSize = Utilities.SizeOf<Vector3>() * particleCapacity; positionDataSize = (positionDataSize % 4 == 0) ? positionDataSize : (positionDataSize + 4 - (positionDataSize % 4)); positionData = Utilities.AllocateMemory(positionDataSize); int sizeDataSize = Utilities.SizeOf<float>() * particleCapacity; sizeDataSize = (sizeDataSize % 4 == 0) ? sizeDataSize : (sizeDataSize + 4 - (sizeDataSize % 4)); sizeData = Utilities.AllocateMemory(sizeDataSize); }