Module org.dyn4j

Class Body

    • Constructor Detail

      • Body

        public Body()
        Default constructor.
    • Method Detail

      • isOnIsland

        @Deprecated
        public boolean isOnIsland()
        Deprecated.
        Deprecated in 4.0.0. No longer needed.
        Returns true if this body is already on an island.
        Returns:
        boolean
      • setOnIsland

        @Deprecated
        public void setOnIsland​(boolean flag)
        Deprecated.
        Deprecated in 4.0.0. No longer needed.
        Sets whether this body is on an island.
        Parameters:
        flag - true if the body is on an island
      • isConnected

        @Deprecated
        public boolean isConnected​(Body body)
        Deprecated.
        Deprecated in 4.0.0. Use the isJoined method in PhysicsWorld instead.
        Returns true if the given Body is connected to this Body by a Joint.

        Returns false if the given body is null.

        Parameters:
        body - the suspect connected body
        Returns:
        boolean
      • isConnected

        @Deprecated
        public boolean isConnected​(Body body,
                                   boolean collisionAllowed)
        Deprecated.
        Deprecated in 4.0.0. Use the isJoined method in PhysicsWorld instead.
        Returns true if the given Body is connected to this Body, given the collision flag, via a Joint.

        If the given collision flag is true, this method will return true only if collision is allowed between the two joined Bodys.

        If the given collision flag is false, this method will return true only if collision is NOT allowed between the two joined Bodys.

        If the Bodys are connected by more than one joint, if any allows collision, then the bodies are considered connected AND allowing collision.

        Returns false if the given body is null.

        Parameters:
        body - the suspect connected body
        collisionAllowed - the collision allowed flag
        Returns:
        boolean
      • isInContact

        @Deprecated
        public boolean isInContact​(Body body)
        Deprecated.
        Deprecated in 4.0.0. Use the isInContact method in PhysicsWorld instead.
        Returns true if the given Body is in collision with this Body.

        Returns false if the given body is null.

        Parameters:
        body - the Body to test
        Returns:
        boolean true if the given Body is in collision with this Body
        Since:
        1.2.0
      • getJoinedBodies

        @Deprecated
        public List<Body> getJoinedBodies()
        Deprecated.
        Deprecated as of 4.0.0. Use the getJoinedBodies method in PhysicsWorld instead.
        Returns a list of Bodys connected by Joints.

        If a body is connected to another body with more than one joint, this method will return just one entry for the connected body.

        Returns:
        List<Body>
        Since:
        1.0.1
      • getJoints

        @Deprecated
        public List<Joint> getJoints()
        Deprecated.
        Deprecated as of 4.0.0. Use the getJoints method in PhysicsWorld instead.
        Returns a list of Joints that this Body is connected with.
        Returns:
        List<Joint>
        Since:
        1.0.1
      • getInContactBodies

        @Deprecated
        public List<Body> getInContactBodies​(boolean sensed)
        Deprecated.
        Deprecated as of 4.0.0. Use the getInContactBodies method in PhysicsWorld instead.
        Returns a list of Bodys that are in contact with this Body.

        Passing a value of true results in a list containing only the sensed contacts for this body. Passing a value of false results in a list containing only normal contacts.

        Calling this method from any of the CollisionListener methods may produce incorrect results.

        If this body has multiple contact constraints with another body (which can happen when either body has multiple fixtures), this method will only return one entry for the in contact body.

        Parameters:
        sensed - true for only sensed contacts; false for only normal contacts
        Returns:
        List<Body>
        Since:
        1.0.1
      • getContacts

        @Deprecated
        public List<ContactPoint> getContacts​(boolean sensed)
        Deprecated.
        Deprecated as of 4.0.0. Use the getContacts method in PhysicsWorld instead.
        Returns a list of ContactPoints

        Passing a value of true results in a list containing only the sensed contacts for this body. Passing a value of false results in a list containing only normal contacts.

        Calling this method from any of the CollisionListener methods may produce incorrect results.

        Modifying the ContactPoints returned is not advised. Use the ContactListener methods instead.

        Parameters:
        sensed - true for only sensed contacts; false for only normal contacts
        Returns:
        List<ContactPoint>
        Since:
        1.0.1