if (groupDef.shape != null) {
final ParticleDef particleDef = tempParticleDef;
particleDef.flags = groupDef.flags;
particleDef.color = groupDef.color;
particleDef.userData = groupDef.userData;
Shape shape = groupDef.shape;
transform.set(groupDef.position, groupDef.angle);
AABB aabb = temp;
int childCount = shape.getChildCount();
for (int childIndex = 0; childIndex < childCount; childIndex++) {
if (childIndex == 0) {
shape.computeAABB(aabb, identity, childIndex);
} else {
AABB childAABB = temp2;
shape.computeAABB(childAABB, identity, childIndex);
aabb.combine(childAABB);
}
}
final float upperBoundY = aabb.upperBound.y;
final float upperBoundX = aabb.upperBound.x;
for (float y = MathUtils.floor(aabb.lowerBound.y / stride) * stride; y < upperBoundY; y +=
stride) {
for (float x = MathUtils.floor(aabb.lowerBound.x / stride) * stride; x < upperBoundX; x +=
stride) {
Vec2 p = tempVec;
p.x = x;
p.y = y;
if (shape.testPoint(identity, p)) {
Transform.mulToOut(transform, p, p);
particleDef.position.x = p.x;
particleDef.position.y = p.y;
p.subLocal(groupDef.position);
Vec2.crossToOutUnsafe(groupDef.angularVelocity, p, particleDef.velocity);