mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Refactor matrix4.h
Sets the surprising row-major conventions used here straight. Renames rotateVect to rotateAndScaleVect: If the matrix also scales, that is applied as well by the method. Obsolete rotateVect variants are removed. The inverseRotateVect method is also renamed accordingly. Note that this applies the transpose of the product of the scale and rotation matrices, which inverts just the rotation.
This commit is contained in:
@@ -357,16 +357,18 @@ void ParticleSpawner::spawnParticle(ClientEnvironment *env, float radius,
|
||||
|
||||
if (attached_absolute_pos_rot_matrix) {
|
||||
// Apply attachment rotation
|
||||
attached_absolute_pos_rot_matrix->rotateVect(pp.vel);
|
||||
attached_absolute_pos_rot_matrix->rotateVect(pp.acc);
|
||||
pp.vel = attached_absolute_pos_rot_matrix->rotateAndScaleVect(pp.vel);
|
||||
pp.acc = attached_absolute_pos_rot_matrix->rotateAndScaleVect(pp.acc);
|
||||
}
|
||||
|
||||
if (attractor_obj)
|
||||
attractor_origin += attractor_obj->getPosition() / BS;
|
||||
if (attractor_direction_obj) {
|
||||
auto *attractor_absolute_pos_rot_matrix = attractor_direction_obj->getAbsolutePosRotMatrix();
|
||||
if (attractor_absolute_pos_rot_matrix)
|
||||
attractor_absolute_pos_rot_matrix->rotateVect(attractor_direction);
|
||||
if (attractor_absolute_pos_rot_matrix) {
|
||||
attractor_direction = attractor_absolute_pos_rot_matrix
|
||||
->rotateAndScaleVect(attractor_direction);
|
||||
}
|
||||
}
|
||||
|
||||
pp.expirationtime = r_exp.pickWithin();
|
||||
|
Reference in New Issue
Block a user