23BoundingBoxParticleEmitter::BoundingBoxParticleEmitter(int32_t count, int64_t lifeTime, int64_t lifeTimeRnd,
float mass,
float massRnd,
OrientedBoundingBox* obb,
const Vector3& velocity,
const Vector3& velocityRnd,
const Color4& colorStart,
const Color4& colorEnd)
53 particle->
position.
add(tmpAxis.
set(obbAxes[0]).
scale((
static_cast<float>(Math::random()) * obbHalfExtensionXYZ[0] * 2.0f) - obbHalfExtensionXYZ[0]));
54 particle->
position.
add(tmpAxis.
set(obbAxes[1]).
scale((
static_cast<float>(Math::random()) * obbHalfExtensionXYZ[1] * 2.0f) - obbHalfExtensionXYZ[1]));
55 particle->
position.
add(tmpAxis.
set(obbAxes[2]).
scale((
static_cast<float>(Math::random()) * obbHalfExtensionXYZ[2] * 2.0f) - obbHalfExtensionXYZ[2]));
80 array<Vector3, 3> axes;
81 array<Vector3, 3> axesTransformed;
85 center = transformationsMatrix.multiply(
obb->
getCenter());
87 axesTransformed[0] = transformationsMatrix.multiplyNoTranslation(
obb->
getAxes()[0]);
88 axesTransformed[1] = transformationsMatrix.multiplyNoTranslation(
obb->
getAxes()[1]);
89 axesTransformed[2] = transformationsMatrix.multiplyNoTranslation(
obb->
getAxes()[2]);
92 axesTransformed[0].computeLength(),
93 axesTransformed[1].computeLength(),
94 axesTransformed[2].computeLength()
102 halfExtension.
scale(scale);
Color 4 base definition class.
void set(const array< float, 4 > &color)
Set up color.
Bounding volume interface.
const Vector3 & getCenter() const
Oriented bounding box physics primitive.
const Vector3 & getHalfExtension() const
const array< Vector3, 3 > & getAxes() const
BoundingVolume * clone() const override
Clones this bounding volume.
Bounding box particle emitter.
OrientedBoundingBox * obb
void fromTransformations(const Transformations &transformations) override
Update transformation with given transformations.
void emit(Particle *particle) override
Emits particles.
virtual ~BoundingBoxParticleEmitter()
Destructor.
OrientedBoundingBox * obbTransformed
Vector3 & normalize()
Normalize the vector.
Vector3 & set(float x, float y, float z)
Set up vector.
Vector3 & add(const Vector3 &v)
Adds a vector.
Vector3 & scale(float scale)
Scale this vector.
array< float, 3 > & getArray() const