Interface PhysicsEngine

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      double acceleration​(double previousSpeed, double currentSpeed, double dt)
      Replies the new acceleration according to a previous speed and a current speed, and given time.
      double motionNewtonEuler1Law​(double speed, double dt)
      Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).
      double motionNewtonEuler1Law1D​(double velocity, double minSpeed, double maxSpeed, double dt)
      Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).
      void motionNewtonEuler1Law1D5​(Vector1D<?,​?,​?> velocity, double minSpeed, double maxSpeed, double dt, Vector1D<?,​?,​?> result)
      Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).
      void motionNewtonEuler1Law1D5​(Vector2D<?,​?> velocity, double minSpeed, double maxSpeed, double dt, Vector2D<?,​?> result)
      Deprecated, for removal: This API element is subject to removal in a future version.
      void motionNewtonEuler1Law2D​(Vector2D<?,​?> velocity, double minSpeed, double maxSpeed, double dt, Vector2D<?,​?> result)
      Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).
      void motionNewtonEuler1Law2D5​(Vector3D<?,​?> velocity, double minSpeed, double maxSpeed, double dt, Vector3D<?,​?> result)
      Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).
      void motionNewtonEuler1Law3D​(Vector3D<?,​?> velocity, double minSpeed, double maxSpeed, double dt, Vector3D<?,​?> result)
      Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).
      double motionNewtonLaw​(double speed, double acceleration, double dt)
      Compute and replies a motion according to high school physics Newton's equations for motion.
      double motionNewtonLaw1D​(double velocity, double minSpeed, double maxSpeed, double acceleration, double minAcceleration, double maxAcceleration, double dt)
      Compute and replies a motion according to high school physics Newton's equations for motion.
      void motionNewtonLaw1D5​(Vector1D<?,​?,​?> velocity, double minSpeed, double maxSpeed, Vector1D<?,​?,​?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector1D<?,​?,​?> result)
      Compute and replies a motion according to high school physics Newton's equations for motion.
      void motionNewtonLaw1D5​(Vector2D<?,​?> velocity, double minSpeed, double maxSpeed, Vector2D<?,​?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector2D<?,​?> result)
      Deprecated, for removal: This API element is subject to removal in a future version.
      void motionNewtonLaw2D​(Vector2D<?,​?> velocity, double minSpeed, double maxSpeed, Vector2D<?,​?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector2D<?,​?> result)
      Compute and replies a motion according to high school physics Newton's equations for motion.
      void motionNewtonLaw2D5​(Vector3D<?,​?> velocity, double minSpeed, double maxSpeed, Vector3D<?,​?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector3D<?,​?> result)
      Compute and replies a motion according to high school physics Newton's equations for motion.
      void motionNewtonLaw3D​(Vector3D<?,​?> velocity, double minSpeed, double maxSpeed, Vector3D<?,​?> acceleration, double minAcceleration, double maxAcceleration, double dt, Vector3D<?,​?> result)
      Compute and replies a motion according to high school physics Newton's equations for motion.
      double speed​(double movement, double dt)
      Replies the new speed according to a previous speed and a mouvement during a given time.
    • Method Detail

      • motionNewtonLaw

        @Pure
        double motionNewtonLaw​(double speed,
                               double acceleration,
                               double dt)
        Compute and replies a motion according to high school physics Newton's equations for motion.

        From Equation 2 of the SUVAT form:
        movement = speed * dt + 0.5 * acceleration * dt * dt

        Parameters:
        speed - is the current speed of the object.
        acceleration - is the current acceleration of the object.
        dt - is the time
        Returns:
        a motion
      • motionNewtonLaw1D

        @Pure
        double motionNewtonLaw1D​(double velocity,
                                 double minSpeed,
                                 double maxSpeed,
                                 double acceleration,
                                 double minAcceleration,
                                 double maxAcceleration,
                                 double dt)
        Compute and replies a motion according to high school physics Newton's equations for motion.

        This function allows to clamp acceleration and velocity.

        From Equation 2 of the SUVAT form:
        clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
        new_velocity = velocity + 0.5 * clamped_acceleration * dt
        clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
        motion = clamped_velocity * dt

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        acceleration - is the current acceleration of the object.
        minAcceleration - is the minimal acceleration allowed.
        maxAcceleration - is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.
        dt - is the time.
        Returns:
        the motion
        See Also:
        "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
      • motionNewtonLaw1D5

        @Deprecated(since="16.0",
                    forRemoval=true)
        @Pure
        void motionNewtonLaw1D5​(Vector2D<?,​?> velocity,
                                double minSpeed,
                                double maxSpeed,
                                Vector2D<?,​?> acceleration,
                                double minAcceleration,
                                double maxAcceleration,
                                double dt,
                                Vector2D<?,​?> result)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Compute and replies a motion according to high school physics Newton's equations for motion.

        This function allows to clamp acceleration and velocity.

        From Equation 2 of the SUVAT form:
        clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
        new_velocity = velocity + 0.5 * clamped_acceleration * dt
        clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
        motion = clamped_velocity * dt

        Parameters:
        velocity - is the current velocity of the object. Norm of vector is speed in m/s for example.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        acceleration - is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.
        minAcceleration - is the minimal acceleration allowed.
        maxAcceleration - is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.
        dt - is the time.
        result - the motion.
        See Also:
        "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
      • motionNewtonLaw1D5

        @Pure
        void motionNewtonLaw1D5​(Vector1D<?,​?,​?> velocity,
                                double minSpeed,
                                double maxSpeed,
                                Vector1D<?,​?,​?> acceleration,
                                double minAcceleration,
                                double maxAcceleration,
                                double dt,
                                Vector1D<?,​?,​?> result)
        Compute and replies a motion according to high school physics Newton's equations for motion.

        This function allows to clamp acceleration and velocity.

        From Equation 2 of the SUVAT form:
        clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
        new_velocity = velocity + 0.5 * clamped_acceleration * dt
        clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
        motion = clamped_velocity * dt

        Caution: The resulting vector has the same segment as the provided vector.

        Parameters:
        velocity - is the current velocity of the object. Norm of vector is speed in m/s for example.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        acceleration - is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.
        minAcceleration - is the minimal acceleration allowed.
        maxAcceleration - is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.
        dt - is the time.
        result - the motion.
        Since:
        16.0
        See Also:
        "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
      • motionNewtonLaw2D

        @Pure
        void motionNewtonLaw2D​(Vector2D<?,​?> velocity,
                               double minSpeed,
                               double maxSpeed,
                               Vector2D<?,​?> acceleration,
                               double minAcceleration,
                               double maxAcceleration,
                               double dt,
                               Vector2D<?,​?> result)
        Compute and replies a motion according to high school physics Newton's equations for motion.

        This function allows to clamp acceleration and velocity.

        From Equation 2 of the SUVAT form:
        clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
        new_velocity = velocity + 0.5 * clamped_acceleration * dt
        clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
        motion = clamped_velocity * dt

        Parameters:
        velocity - is the current velocity of the object. Norm of vector is speed in m/s for example.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        acceleration - is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.
        minAcceleration - is the minimal acceleration allowed.
        maxAcceleration - is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.
        dt - is the time.
        result - the motion.
        See Also:
        "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
      • motionNewtonLaw2D5

        @Pure
        void motionNewtonLaw2D5​(Vector3D<?,​?> velocity,
                                double minSpeed,
                                double maxSpeed,
                                Vector3D<?,​?> acceleration,
                                double minAcceleration,
                                double maxAcceleration,
                                double dt,
                                Vector3D<?,​?> result)
        Compute and replies a motion according to high school physics Newton's equations for motion.

        This function allows to clamp acceleration and velocity.

        From Equation 2 of the SUVAT form:
        clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
        new_velocity = velocity + 0.5 * clamped_acceleration * dt
        clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
        motion = clamped_velocity * dt

        Parameters:
        velocity - is the current velocity of the object. Norm of vector is speed in m/s for example.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        acceleration - is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.
        minAcceleration - is the minimal acceleration allowed.
        maxAcceleration - is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.
        dt - is the time.
        result - the motion.
        See Also:
        "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
      • motionNewtonLaw3D

        @Pure
        void motionNewtonLaw3D​(Vector3D<?,​?> velocity,
                               double minSpeed,
                               double maxSpeed,
                               Vector3D<?,​?> acceleration,
                               double minAcceleration,
                               double maxAcceleration,
                               double dt,
                               Vector3D<?,​?> result)
        Compute and replies a motion according to high school physics Newton's equations for motion.

        This function allows to clamp acceleration and velocity.

        From Equation 2 of the SUVAT form:
        clamped_acceleration = clamp(acceleration, minAcceleration, maxAcceleration)
        new_velocity = velocity + 0.5 * clamped_acceleration * dt
        clamped_velocity = clamp(new_velocity, minSpeed, maxSpeed)
        motion = clamped_velocity * dt

        Parameters:
        velocity - is the current velocity of the object. Norm of vector is speed in m/s for example.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        acceleration - is the current acceleration of the object. Norm of vector is acceleration amount in m/s2 for example.
        minAcceleration - is the minimal acceleration allowed.
        maxAcceleration - is the maximal acceleration allowed. Length of this vector is the acceleration amount. Direction of this vector becomes movement direction.
        dt - is the time.
        result - the motion.
        See Also:
        "http://en.wikibooks.org/wiki/High_School_Physics/Velocity"
      • motionNewtonEuler1Law

        @Pure
        double motionNewtonEuler1Law​(double speed,
                                     double dt)
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = speed * dt

        Parameters:
        speed - is the current speed of the object.
        dt - is the time
        Returns:
        a motion
      • motionNewtonEuler1Law1D

        @Pure
        double motionNewtonEuler1Law1D​(double velocity,
                                       double minSpeed,
                                       double maxSpeed,
                                       double dt)
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = clamp(velocity) * dt

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed.
        maxSpeed - is the maximal speed allowed.
        dt - is the time
        Returns:
        a motion
      • motionNewtonEuler1Law1D5

        @Pure
        @Deprecated(since="16.0",
                    forRemoval=true)
        void motionNewtonEuler1Law1D5​(Vector2D<?,​?> velocity,
                                      double minSpeed,
                                      double maxSpeed,
                                      double dt,
                                      Vector2D<?,​?> result)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = clamp(velocity) * dt

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed (clamped to 0 if negative).
        maxSpeed - is the maximal speed allowed.
        dt - is the time
        result - a motion
      • motionNewtonEuler1Law1D5

        @Pure
        void motionNewtonEuler1Law1D5​(Vector1D<?,​?,​?> velocity,
                                      double minSpeed,
                                      double maxSpeed,
                                      double dt,
                                      Vector1D<?,​?,​?> result)
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = clamp(velocity) * dt

        Caution: The resulting vector has the same segment as the provided vector.

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed (clamped to 0 if negative).
        maxSpeed - is the maximal speed allowed.
        dt - is the time
        result - a motion
        Since:
        16.0
      • motionNewtonEuler1Law2D

        @Pure
        void motionNewtonEuler1Law2D​(Vector2D<?,​?> velocity,
                                     double minSpeed,
                                     double maxSpeed,
                                     double dt,
                                     Vector2D<?,​?> result)
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = clamp(velocity) * dt

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed (clamped to 0 if negative).
        maxSpeed - is the maximal speed allowed.
        dt - is the time
        result - a motion
      • motionNewtonEuler1Law2D5

        @Pure
        void motionNewtonEuler1Law2D5​(Vector3D<?,​?> velocity,
                                      double minSpeed,
                                      double maxSpeed,
                                      double dt,
                                      Vector3D<?,​?> result)
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = clamp(velocity) * dt

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed (clamped to 0 if negative).
        maxSpeed - is the maximal speed allowed.
        dt - is the time
        result - a motion
      • motionNewtonEuler1Law3D

        @Pure
        void motionNewtonEuler1Law3D​(Vector3D<?,​?> velocity,
                                     double minSpeed,
                                     double maxSpeed,
                                     double dt,
                                     Vector3D<?,​?> result)
        Compute and replies a motion according to Newton-Euler-1 equations for motion (where acceleration is not significant).

        From the first-order Newton-Euler method: movement = clamp(velocity) * dt

        Parameters:
        velocity - is the current velocity of the object.
        minSpeed - is the minimal speed allowed (clamped to 0 if negative).
        maxSpeed - is the maximal speed allowed.
        dt - is the time
        result - a motion
      • speed

        @Pure
        double speed​(double movement,
                     double dt)
        Replies the new speed according to a previous speed and a mouvement during a given time.

        From the first-order Newton-Euler method: speed = movement / dt

        Parameters:
        movement - is the movement distance.
        dt - is the time
        Returns:
        a new speed
        Since:
        4.1
      • acceleration

        @Pure
        double acceleration​(double previousSpeed,
                            double currentSpeed,
                            double dt)
        Replies the new acceleration according to a previous speed and a current speed, and given time.

        From the second-order Newton-Euler method: (currentSpeed - previousSpeed) / dt

        Parameters:
        previousSpeed - is the previous speed of the object.
        currentSpeed - is the current speed of the object.
        dt - is the time
        Returns:
        a new acceleration