Friday, April 4, 2014

Getting Back in the Saddle

Continued from the previous entry

We now have a pretty good idea of what the problem is. In all of the previous cases, when we apply rotation to the actor before attaching, we find that the actor position (and world position) are calculated incorrectly. We also found that the rotation was not applied to the attached actor, which resulted in incorrect rotation values as well. All of these issues were only present in the attached actor, the actor that we attached to was fine.

Here's the patch I came up with to fix the problem, and an update that removes need to invert the position before saving it.

To fix attaching with rotation, I noticed that the current code didn't actually transpose or rotate the actor's position based on the rotation of the object we're attaching to.

Why didn't getWorldPos() do this? When getWorldPos() is called, the actors are not attached, so they just return their own position!

While this fixes the manatee and the candles and matches the output of getpos() in the retail engine, the rotation and world position components are still broken, as is detaching actors. These will need to be addressed in future posts, but for now, the bug is fixed!

Giddy-up Little Manatee, Giddy-up

No comments:

Post a Comment