Fix T95527: wrong motion blur with rigid bodies

This index is not meant for the point cache data array, it's already offset.
This commit is contained in:
Brecht Van Lommel 2022-05-04 19:25:01 +02:00
parent 60772baebf
commit 5d7ee44406
Notes: blender-bot 2023-02-14 10:11:49 +01:00
Referenced by issue #97926, RigidBody simulation creates ERRATIC motion between frames
Referenced by issue #96391, Motion blur all out of whack
Referenced by issue #96364, Rigid body constraint subframe glitch
Referenced by issue #95527, Regression: Motion blur resulting from rigid body simulation vectors is amplified / wrong / too strong
1 changed files with 2 additions and 2 deletions

View File

@ -833,8 +833,8 @@ static void ptcache_rigidbody_interpolate(int index,
memcpy(orn, data + 3, sizeof(float[4]));
}
else {
PTCACHE_DATA_TO(data, BPHYS_DATA_LOCATION, index, pos);
PTCACHE_DATA_TO(data, BPHYS_DATA_ROTATION, index, orn);
PTCACHE_DATA_TO(data, BPHYS_DATA_LOCATION, 0, pos);
PTCACHE_DATA_TO(data, BPHYS_DATA_ROTATION, 0, orn);
}
const float t = (cfra - cfra1) / (cfra2 - cfra1);