Module org.dyn4j

Class DetectResult


  • public class DetectResult
    extends java.lang.Object
    Represents the result of a static detection of the world.
    Since:
    3.1.9
    Version:
    3.2.0
    Author:
    William Bittle
    • Constructor Detail

      • DetectResult

        public DetectResult()
        Default constructor.
      • DetectResult

        public DetectResult​(Body body,
                            BodyFixture fixture)
        Optional constructor.
        Parameters:
        body - the body
        fixture - the fixture
      • DetectResult

        public DetectResult​(Body body,
                            BodyFixture fixture,
                            Penetration penetration)
        Full constructor.
        Parameters:
        body - the body
        fixture - the fixture
        penetration - the penetration; can be null
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getBody

        public Body getBody()
        Returns the overlapping body.
        Returns:
        Body
      • setBody

        public void setBody​(Body body)
        Sets the overlapping body.
        Parameters:
        body - the Body
      • setFixture

        public void setFixture​(BodyFixture fixture)
        Sets the overlapping fixture.
        Parameters:
        fixture - the BodyFixture
      • getPenetration

        public Penetration getPenetration()
        Returns the overlap penetration (collision data).

        This will return null if the collision data was flagged to not be included.

        Returns:
        Penetration
      • setPenetration

        public void setPenetration​(Penetration penetration)
        Sets the overlap penetration (collision data).
        Parameters:
        penetration - the Penetration; can be null