Merge pull request #1126 from jamesu/fix_cast_ray

Alternate fix for castRay issue
This commit is contained in:
Brian Roberts 2023-11-04 17:37:10 -05:00 committed by GitHub
commit 78aee62f71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View file

@ -1768,10 +1768,10 @@ void GuiConvexEditorCtrl::submitUndo( UndoType type, const Vector<ConvexShape*>
mIsDirty = true; mIsDirty = true;
} }
bool GuiConvexEditorCtrl::_cursorCastCallback( RayInfo* ri ) bool GuiConvexEditorCtrl::_cursorCastCallback( SceneObject* object )
{ {
// Reject anything that's not a ConvexShape. // Reject anything that's not a ConvexShape.
return dynamic_cast< ConvexShape* >( ri->object ); return dynamic_cast< ConvexShape* >( object );
} }
bool GuiConvexEditorCtrl::_cursorCast( const Gui3DMouseEvent &event, ConvexShape **hitShape, S32 *hitFace ) bool GuiConvexEditorCtrl::_cursorCast( const Gui3DMouseEvent &event, ConvexShape **hitShape, S32 *hitFace )

View file

@ -169,7 +169,7 @@ protected:
void _renderObject( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *matInst ); void _renderObject( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *matInst );
bool _cursorCast( const Gui3DMouseEvent &event, ConvexShape **hitShape, S32 *hitFace ); bool _cursorCast( const Gui3DMouseEvent &event, ConvexShape **hitShape, S32 *hitFace );
static bool _cursorCastCallback( RayInfo* ri ); static bool _cursorCastCallback( SceneObject* object );
protected: protected:

View file

@ -318,10 +318,9 @@ struct SceneRayHelper
xformedEnd.convolveInverse(ptr->mObjScale); xformedEnd.convolveInverse(ptr->mObjScale);
RayInfo ri; RayInfo ri;
ri.object = ptr;
ri.generateTexCoord = info->generateTexCoord; ri.generateTexCoord = info->generateTexCoord;
if (mFunc && !mFunc(&ri)) if (mFunc && !mFunc(ptr))
return false; return false;
bool result = false; bool result = false;

View file

@ -668,7 +668,7 @@ class SceneContainer
/// @name Line intersection /// @name Line intersection
/// @{ /// @{
typedef bool ( *CastRayCallback )( RayInfo* ri ); typedef bool ( *CastRayCallback )( SceneObject* object );
/// Test against collision geometry -- fast. /// Test against collision geometry -- fast.
bool castRay( const Point3F &start, const Point3F &end, U32 mask, RayInfo* info, CastRayCallback callback = NULL ); bool castRay( const Point3F &start, const Point3F &end, U32 mask, RayInfo* info, CastRayCallback callback = NULL );