发射器形状是一个定义了发射粒子起源的一维的,二维的或是三维的形状。它由emitterPosition,emitterZposition,emitterSize和emitterDepth共同影响决定。
常量
kCAEmitterLayerPoint
粒子从一个点(emitterPosition.x,emitterPosition.y,emitterZPosition)发射
kCAEmitterLayerLine
粒子沿着一条从 (emitterPosition.x - emitterSize.width/2,emitterPosition.y,emitterZPosition) 到 (emitterPosition.x + emitterSize.width/2,emitterPosition.y,emitterZPosition)的线发射
kCAEmitterLayerRectangle
粒子从对角线为 [emitterPosition.x - emitterSize.width/2, emitterPosition.y - emitterSize.height/2, emitterZPosition], [emitterPosition.x + emitterSize.width/2, emitterPosition.y + emitterSize.height/2, emitterZPosition] 的矩形发射
kCAEmitterLayerCuboid
粒子从对角线为 [emitterPosition.x - emitterSize.width/2, emitterPosition.y - emitterSize.height/2, emitterZPosition - emitterDepth/2], [emitterPosition.x + emitterSize.width/2, emitterPosition.y + emitterSize.height/2, emitterZPosition+emitterDepth/2] 的一个立方体(三维矩形)发射
kCAEmitterLayerCircle
粒子从一个圆心为 (emitterPosition.x,emitterPosition.y,emitterZPosition) 半径为emitterSize.width 的圆发射
kCAEmitterLayerSphere
粒子从一个圆心为 (emitterPosition.x,emitterPosition.y,emitterZPosition) 半径为emitterSize.width 的球体发射