Exemple #1
0
            public Ribbonizer(ShapeBuilderTrail ribbon, int newCapacity, int sectionsPerParticle)
            {
                parentTrail = 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 directionDataSize = Utilities.SizeOf <Vector3>() * particleCapacity;

                directionDataSize = (directionDataSize % 4 == 0) ? directionDataSize : (directionDataSize + 4 - (directionDataSize % 4));
                directionData     = Utilities.AllocateMemory(directionDataSize);
            }
            public Ribbonizer(ShapeBuilderTrail ribbon, int newCapacity, int sectionsPerParticle)
            {
                parentTrail = 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 directionDataSize = Utilities.SizeOf<Vector3>() * particleCapacity;
                directionDataSize = (directionDataSize % 4 == 0) ? directionDataSize : (directionDataSize + 4 - (directionDataSize % 4));
                directionData = Utilities.AllocateMemory(directionDataSize);
            }