Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
physics [2020/05/24 13:20] – [Colliders] adminphysics [2020/05/24 13:25] – [Callbacks] admin
Line 206: Line 206:
 Those callbacks will give you the both colliding elements at this moment of TQ3Body type (Gorilla.Physics.Q3.Body). Those callbacks will give you the both colliding elements at this moment of TQ3Body type (Gorilla.Physics.Q3.Body).
 Each body has an untyped pointer property "UserData", which contains the linked visual component. The type of that link you can request with the property "UserDataType". Each body has an untyped pointer property "UserData", which contains the linked visual component. The type of that link you can request with the property "UserDataType".
 +
 +<file pascal>
 +procedure TUIMainWin.doOnBeginContact(const ABodyA, ABodyB : TQ3Body);
 +begin
 +    if TComponent(ABodyA.UserData).Name.Equals('Cube1') and TComponent(ABodyB.UserData).Name.Equals('Sphere2') then
 +    begin
 +      FMX.Types.Log.D('expected collision between %s <=> %s', 
 +        [TComponent(ABodyA.UserData).Name, TComponent(ABodyB.UserData).Name]);
 +    end;
 + end;
 +</file>
 ===== Remote-Control ===== ===== Remote-Control =====