From c4268746f2c1ee56ba1b61ec5b02cbefa3bc3e84 Mon Sep 17 00:00:00 2001 From: parax0 Date: Wed, 27 Apr 2016 23:55:41 -0600 Subject: [PATCH] Fixed skeleton raycasting using the incorrect bone position + renamed a variable --- src/Core/Render/CRenderer.h | 2 +- src/Core/Resource/CSkeleton.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Render/CRenderer.h b/src/Core/Render/CRenderer.h index 5e8885aa..28bcac25 100644 --- a/src/Core/Render/CRenderer.h +++ b/src/Core/Render/CRenderer.h @@ -72,7 +72,7 @@ public: void RenderBuckets(const SViewInfo& rkViewInfo); void RenderBloom(); void RenderSky(CModel *pSkyboxModel, const SViewInfo& rkViewInfo); - void AddMesh(IRenderable *pRenderable, int AssetID, const CAABox& rkAABox, bool Transparent, ERenderCommand Command, EDepthGroup DepthGroup = eMidground); + void AddMesh(IRenderable *pRenderable, int ComponentIndex, const CAABox& rkAABox, bool Transparent, ERenderCommand Command, EDepthGroup DepthGroup = eMidground); void BeginFrame(); void EndFrame(); void ClearDepthBuffer(); diff --git a/src/Core/Resource/CSkeleton.cpp b/src/Core/Resource/CSkeleton.cpp index 9f9a13cb..fe7a8f8e 100644 --- a/src/Core/Resource/CSkeleton.cpp +++ b/src/Core/Resource/CSkeleton.cpp @@ -123,7 +123,7 @@ std::pair CSkeleton::RayIntersect(const CRay& rkRay, const CBoneTrans for (u32 iBone = 0; iBone < mBones.size(); iBone++) { CBone *pBone = mBones[iBone]; - CVector3f BonePos = rkData[pBone->ID()].ExtractTranslation(); + CVector3f BonePos = pBone->TransformedPosition(rkData); std::pair Intersect = Math::RaySphereIntersection(rkRay, BonePos, skSphereRadius); if (Intersect.first && Intersect.second < Out.second)