7 #include "imstkRenderParticles.h" 8 #include "imstkLogger.h" 14 if (maxNumParticles <= 128)
21 LOG(WARNING) <<
"The maximum number of decals is 128";
24 m_vertexPositions[0] = Vec3d(0.5, 0.5, 0);
25 m_vertexPositions[1] = Vec3d(0.5, -0.5, 0);
26 m_vertexPositions[2] = Vec3d(-0.5, 0.5, 0);
27 m_vertexPositions[3] = Vec3d(-0.5, -0.5, 0);
29 m_vertexNormals[0] = Vec3d(0.0, 0.0, 1.0);
30 m_vertexNormals[1] = Vec3d(0.0, 0.0, 1.0);
31 m_vertexNormals[2] = Vec3d(0.0, 0.0, 1.0);
32 m_vertexNormals[3] = Vec3d(0.0, 0.0, 1.0);
34 m_vertexUVs[0] = Vec2d(1.0, 1.0);
35 m_vertexUVs[1] = Vec2d(1.0, 0);
36 m_vertexUVs[2] = Vec2d(0, 1.0);
37 m_vertexUVs[3] = Vec2d(0, 0);
39 m_triangles[0] = Vec3i(1, 0, 3);
40 m_triangles[1] = Vec3i(0, 2, 3);
46 m_particleSize = size;
49 std::vector<std::unique_ptr<RenderParticle>>&
70 return m_numParticles;
82 LOG(WARNING) <<
"applyTransform Not implemented!";
86 RenderParticles::cloneImplementation()
const 91 geom->m_particleSize = m_particleSize;
97 for (
int i = 0; i < 4; i++)
99 geom->m_vertexPositions[i] = m_vertexPositions[i];
100 geom->m_vertexNormals[i] = m_vertexNormals[i];
101 geom->m_vertexTangents[i] = m_vertexTangents[i];
102 geom->m_vertexUVs[i] = m_vertexUVs[i];
104 geom->m_triangles[0] = m_triangles[0];
105 geom->m_triangles[1] = m_triangles[1];
void reset()
Reset number of particles.
std::vector< std::unique_ptr< RenderParticle > > m_particles
Particle objects.
std::vector< std::unique_ptr< RenderParticle > > & getParticles()
Get particles.
unsigned int m_maxNumParticles
Maximum particles.
RenderParticles(const unsigned int maxNumParticles=128)
Constructor.
void setParticleSize(const float size)
Set size of particle.
void incrementNumOfParticles()
Increment number of particles.
void applyTransform(const Mat4d &m) override
Directly apply transform to data.
unsigned int getMaxNumParticles()
Get maximum number of particles.
unsigned int getNumParticles()
Get number of particles.