Fixed skeleton raycasting using the incorrect bone position + renamed a variable

This commit is contained in:
parax0 2016-04-27 23:55:41 -06:00
parent 59d8de0f31
commit c4268746f2
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ public:
void RenderBuckets(const SViewInfo& rkViewInfo); void RenderBuckets(const SViewInfo& rkViewInfo);
void RenderBloom(); void RenderBloom();
void RenderSky(CModel *pSkyboxModel, const SViewInfo& rkViewInfo); 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 BeginFrame();
void EndFrame(); void EndFrame();
void ClearDepthBuffer(); void ClearDepthBuffer();

View File

@ -123,7 +123,7 @@ std::pair<s32,float> CSkeleton::RayIntersect(const CRay& rkRay, const CBoneTrans
for (u32 iBone = 0; iBone < mBones.size(); iBone++) for (u32 iBone = 0; iBone < mBones.size(); iBone++)
{ {
CBone *pBone = mBones[iBone]; CBone *pBone = mBones[iBone];
CVector3f BonePos = rkData[pBone->ID()].ExtractTranslation(); CVector3f BonePos = pBone->TransformedPosition(rkData);
std::pair<bool,float> Intersect = Math::RaySphereIntersection(rkRay, BonePos, skSphereRadius); std::pair<bool,float> Intersect = Math::RaySphereIntersection(rkRay, BonePos, skSphereRadius);
if (Intersect.first && Intersect.second < Out.second) if (Intersect.first && Intersect.second < Out.second)