TransformUnderMouse with Alpha pixels check for quad-based Transforms

The TRayCollision.Info indeed returns only part of the information, it returns (from this comment):

the first TRayCollisionNode on the list
except it doesn’t return TRayCollisionNode that relates to
internal TCastleTransform (that has csTransient
flag is ComponentState).

I found that this is always, or almost always, all that you need, that’s why we advise to not iterate over this list yourself ( castle-engine/src/transform/castletransform_initial_types.inc at 8ce77b04e4420cfd4b9032aff43e7e883eaa8824 · castle-engine/castle-engine · GitHub ).

I’ll investigate your testcase to see why it was necessary, thank you – I will want to address it as I design the promised “new hit API”, TCastleViewport.PointingDeviceHit, mentioned in one of the posts above. I will want to account for this.

Ah, indeed. Internally the TCastleImageTransform is actually using the TCastleScene, but indeed there’s no TCastleImageTransform.PreciseCollisions so there’s no information about the exact triangle hit and position within that triangle.

Hm. I decided to just add it :slight_smile: Done in Add TCastleImageTransform.PreciseCollisions · castle-engine/castle-engine@d8ed28d · GitHub .

It will be available in downloads soon, once the commit titled " Add TCastleImageTransform.PreciseCollisions" is no longer visible on this page.

1 Like