| 340 | } |
| 341 | |
| 342 | Vector3i GetJointPosition(const ItemInfo& item, int boneID, const Vector3i& relOffset) |
| 343 | { |
| 344 | bool incorrectBone = false; |
| 345 | if (boneID < 0 || boneID >= Objects[item.ObjectNumber].nmeshes) |
| 346 | { |
| 347 | TENLog("Unknown bone ID specified for object " + GetObjectName(item.ObjectNumber), LogLevel::Warning, LogConfig::All); |
| 348 | incorrectBone = true; |
| 349 | } |
| 350 | |
| 351 | // Always return object's root position if it's invisible. Joint position can't be predicted otherwise since it's not animated. |
| 352 | if (incorrectBone || Objects[item.ObjectNumber].Hidden || item.Status == ITEM_INVISIBLE) |
| 353 | return Geometry::TranslatePoint(item.Pose.Position, item.Pose.Orientation, relOffset); |
| 354 | |
| 355 | // Use matrices done in renderer to transform relative offset. |
| 356 | return Vector3i(g_Renderer.GetMoveableBonePosition(item.Index, boneID, relOffset.ToVector3())); |
| 357 | } |
| 358 | |
| 359 | Vector3i GetJointPosition(ItemInfo* item, int boneID, const Vector3i& relOffset) |
| 360 | { |
no test coverage detected