Robot Studio SDK, Collision detection

Spawn14 Germany
Hello, does anyone know whether it is possible to determine which body of the part caused the collision in the event of a collision?


  • Spawn14
    Spawn14 Germany
    Hello, I've solved it - if anyone is interested.
    Short form: Robotstudio only returns the two parts.
    But you can use the function:
    IGfxGeoShape shape1 = (IGfxGeoShape) .propInfo.getValue (Part)
    to get the shapes of two bodies and then use the function
    result = ApiServices.Graphics.CollisionDetector.Intersect (shape1, Part1.Transform.GlobalMatrix , shape2, Part2.Transform.GlobalMatrix, false, 0.1)
    to get the results of the collision.
    It contains a gfxID. Compare this via a ForEach Body .. loop with the CollisionsPart.Body [] and you will find the corresponding body. :-)