Page MenuHome

BGE: Fix for T42285 & T38935 crashes. They are Rayhit related.

Authored by Jorge Bernal (lordloki) on Jan 8 2015, 11:04 PM.



We make sure that good values are passed to GetPolygon() and checking that the visual mesh doesn't have a wrong displacement when it pass over a object that it has as compound bound a mesh triangle.

Diff Detail

rB Blender

Event Timeline

Jorge Bernal (lordloki) retitled this revision from to BGE: Fix for T42285 & T38935 crashes. They are Rayhit related..
Jorge Bernal (lordloki) updated this object.

This seems alright, but I'll need to look closer at the usage of glTranslated here.

@Sergej do you see any issues with this physics-wise?

Why do you switch from using the result->m_hitPoint to pulling the data out of this matrix?

It seems that with triangle mesh selected as compound bounds and under "certain conditions" when we do glTranslated(resultpoint[0],resultpoint[1],resultpoint[2]); the object that projects the shadow is translated to the hitting point of the projected shadow.

If we use glTranslated(oglmatrix[12],oglmatrix[13],oglmatrix[14]); we will ensure that we will translate the object to the object position.

Anyway, I have tried to reproduce the bug from a new blend file (copying mesh positions, physics attributes, etc) and I weren't able to do it. Then, is it possible that the mesh in the bug file is corrupted or damaged? Here is the new file

that i did and the bug file

Maybe, should we leave the check for m_hitpolygon only (to avoid the possible crashes)?

I'm not familiar with this code so I'm not sure why we get a hit reported without having a mesh, I guess this is intentional?
Doing the check to prevent the crash should be fine then, but maybe it's better to test for m_hitMesh?

Jorge Bernal (lordloki) edited edge metadata.
  • Check for m_hitMesh instead of m_hitPolygon. if this field is set, then we can trust that m_hitPolygon is a valid polygon.

I am okay with this change.

@Angus Hollands (agoose77)
You're probably the only other guy that knows anything about the BGE's physics code (that is still active), do you have any additional comments?

Mitchell Stokes (moguri) edited edge metadata.
This revision is now accepted and ready to land.Jan 14 2015, 12:53 AM
This revision was automatically updated to reflect the committed changes.