From f967519a770b97309c02a0176c2721395b471028 Mon Sep 17 00:00:00 2001 From: parax0 Date: Wed, 29 Jun 2016 23:20:34 -0600 Subject: [PATCH] Fixed unnecessary ray tests being performed --- src/Core/Scene/CCollisionNode.cpp | 5 +++++ src/Core/Scene/CCollisionNode.h | 1 + src/Core/ScriptExtra/CScriptExtra.cpp | 3 ++- src/Core/ScriptExtra/CScriptExtra.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Core/Scene/CCollisionNode.cpp b/src/Core/Scene/CCollisionNode.cpp index 6af38244..4730c6c3 100644 --- a/src/Core/Scene/CCollisionNode.cpp +++ b/src/Core/Scene/CCollisionNode.cpp @@ -43,6 +43,11 @@ void CCollisionNode::Draw(FRenderOptions /*Options*/, int /*ComponentIndex*/, ER mpCollision->DrawWireframe(); } +void CCollisionNode::RayAABoxIntersectTest(CRayCollisionTester& /*rTester*/, const SViewInfo& /*rkViewInfo*/) +{ + // todo +} + SRayIntersection CCollisionNode::RayNodeIntersectTest(const CRay& /*rkRay*/, u32 /*AssetID*/, const SViewInfo& /*rkViewInfo*/) { // todo diff --git a/src/Core/Scene/CCollisionNode.h b/src/Core/Scene/CCollisionNode.h index 236e5c0a..0b6d3e68 100644 --- a/src/Core/Scene/CCollisionNode.h +++ b/src/Core/Scene/CCollisionNode.h @@ -13,6 +13,7 @@ public: ENodeType NodeType(); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, ERenderCommand Command, const SViewInfo& rkViewInfo); + void RayAABoxIntersectTest(CRayCollisionTester& rTester, const SViewInfo& rkViewInfo); SRayIntersection RayNodeIntersectTest(const CRay& rkRay, u32 AssetID, const SViewInfo& rkViewInfo); void SetCollision(CCollisionMeshGroup *pCollision); }; diff --git a/src/Core/ScriptExtra/CScriptExtra.cpp b/src/Core/ScriptExtra/CScriptExtra.cpp index e24dcb8a..3e2b4d20 100644 --- a/src/Core/ScriptExtra/CScriptExtra.cpp +++ b/src/Core/ScriptExtra/CScriptExtra.cpp @@ -56,7 +56,8 @@ CScriptExtra* CScriptExtra::CreateExtra(CScriptNode *pNode) case 0x53505041: // "SPPA" SplinePath (DKCR) case 0x5043544C: // "PCTL" PathControl (DKCR) case 0x434C5043: // "CLPC" ClingPathControl (DKCR) - pExtra = new CSplinePathExtra(pObj, pNode->Scene(), pNode); + if (pNode->Instance()->Area()->Game() == eReturns) + pExtra = new CSplinePathExtra(pObj, pNode->Scene(), pNode); break; case 0x574F524D: // "WORM" Sandworm (MP2) diff --git a/src/Core/ScriptExtra/CScriptExtra.h b/src/Core/ScriptExtra/CScriptExtra.h index 0f7a7588..ec5812e0 100644 --- a/src/Core/ScriptExtra/CScriptExtra.h +++ b/src/Core/ScriptExtra/CScriptExtra.h @@ -35,6 +35,7 @@ public: // Default implementations for CSceneNode virtual ENodeType NodeType() { return eScriptExtraNode; } + virtual void RayAABoxIntersectTest(CRayCollisionTester& /*rTester*/, const SViewInfo& /*rkViewInfo*/) {} virtual SRayIntersection RayNodeIntersectTest(const CRay& /*rkRay*/, u32 /*AssetID*/, const SViewInfo& /*rkViewInfo*/) { SRayIntersection out;