13 using std::make_unique;
14 using std::unique_ptr;
25 SphereParticleEmitter::SphereParticleEmitter(int32_t count, int64_t lifeTime, int64_t lifeTimeRnd,
float mass,
float massRnd,
Sphere* sphere,
const Vector3& velocity,
const Vector3& velocityRnd,
const Color4& colorStart,
const Color4& colorEnd)
32 this->sphere = unique_ptr<Sphere>(
sphere);
49 Math::random() * 2.0f - 1.0f,
50 Math::random() * 2.0f - 1.0f,
51 Math::random() * 2.0f - 1.0f
76 worldCenter = transformMatrix.multiply(
sphere->getCenter());
79 transformMatrix.getScale(worldScale);
80 worldSphere = make_unique<Sphere>(worldCenter,
sphere->getRadius() * Math::max(worldScale.
getX(), Math::max(worldScale.
getY(), worldScale.
getZ())));
Color 4 definition class.
void set(float r, float g, float b, float a)
Sets this color by its components.
Bounding volume interface.
Sphere physics primitive.
virtual ~SphereParticleEmitter()
Destructor.
unique_ptr< Sphere > worldSphere
void setTransform(const Transform &transform) override
Update transform with given transform.
unique_ptr< Sphere > sphere
void emit(Particle *particle) override
Emits particles.
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Vector3 & scale(float scalar)
Scales by scalar.
Vector3 & set(float x, float y, float z)
Sets this vector3 by its components.
Vector3 & normalize()
Normalizes this vector3.