initialize in random positions within cube
| 221 | |
| 222 | // initialize in random positions within cube |
| 223 | void ParticleSystem::initCubeRandom(vec3f origin, vec3f size, vec3f vel, float lifetime) |
| 224 | { |
| 225 | float4 *posPtr = m_pos.getHostPtr(); |
| 226 | float4 *velPtr = m_vel.getHostPtr(); |
| 227 | |
| 228 | for (uint i = 0; i < m_numParticles; i++) { |
| 229 | vec3f pos = origin + svrand() * size; |
| 230 | posPtr[i] = make_float4(pos.x, pos.y, pos.z, 0.0f); |
| 231 | velPtr[i] = make_float4(vel.x, vel.y, vel.z, lifetime); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | // add sphere on regular grid |
| 236 | void ParticleSystem::addSphere(uint &index, vec3f pos, vec3f vel, int r, float spacing, float jitter, float lifetime) |
nothing calls this directly
no test coverage detected