mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-13 23:26:19 +00:00
Feature additions and improvements for pick mode and the POI -> World editor
This commit is contained in:
@@ -250,13 +250,15 @@ void CDamageableTriggerExtra::RayAABoxIntersectTest(CRayCollisionTester& Tester,
|
||||
std::pair<bool,float> Result = AABox().IntersectsRay(Ray);
|
||||
|
||||
if (Result.first)
|
||||
{
|
||||
Tester.AddNode(this, -1, Result.second);
|
||||
mCachedRayDistance = Result.second;
|
||||
}
|
||||
}
|
||||
|
||||
SRayIntersection CDamageableTriggerExtra::RayNodeIntersectTest(const CRay& Ray, u32 /*ComponentIndex*/, const SViewInfo& /*ViewInfo*/)
|
||||
{
|
||||
// The bounding box and all other tests already passed in RayAABoxIntersectTest, so we
|
||||
// already know that we have a positive. We just need the distance again.
|
||||
std::pair<bool,float> Result = AABox().IntersectsRay(Ray);
|
||||
return SRayIntersection(true, Result.second, mpParent, -1);
|
||||
// already know that we have a positive.
|
||||
return SRayIntersection(true, mCachedRayDistance, Ray.PointOnRay(mCachedRayDistance), mpParent, -1);
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ class CDamageableTriggerExtra : public CScriptExtra
|
||||
CMaterial *mpMat;
|
||||
CVector2f mCoordScale;
|
||||
|
||||
float mCachedRayDistance;
|
||||
|
||||
public:
|
||||
explicit CDamageableTriggerExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0);
|
||||
~CDamageableTriggerExtra();
|
||||
|
||||
Reference in New Issue
Block a user