ontology.physics

## Class ContinuousPhysics

- java.lang.Object
- - ontology.physics.GridPhysics
  - - ontology.physics.ContinuousPhysics

- All Implemented Interfaces:
    Physics
  Direct Known Subclasses:
    GravityPhysics, NoFrictionPhysics

      public class ContinuousPhysics
      extends GridPhysics

  Created with IntelliJ IDEA. User: Diego Date: 17/10/13 Time: 11:37 This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `double` | `friction` Friction applicable in this physics system.
    `double` | `gravity` Gravity of the physics

    - ### Fields inherited from class ontology.physics.GridPhysics

      `gridsize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContinuousPhysics()` Default constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activeMovement(VGDLSprite sprite, Vector2d action, double speed)`
    `double` | `distance(java.awt.Rectangle r1, java.awt.Rectangle r2)` Euclidean distance between two rectangles.
    `void` | `passiveMovement(VGDLSprite sprite)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### gravity

          public double gravity

      Gravity of the physics

    - #### friction

          public double friction

      Friction applicable in this physics system.

  - ### Constructor Detail

    - #### ContinuousPhysics

          public ContinuousPhysics()

      Default constructor.

  - ### Method Detail

    - #### passiveMovement

          public void passiveMovement(VGDLSprite sprite)

      Specified by:
        `passiveMovement` in interface `Physics`
      Overrides:
        `passiveMovement` in class `GridPhysics`

    - #### activeMovement

          public void activeMovement(VGDLSprite sprite,
                            Vector2d action,
                            double speed)

      Specified by:
        `activeMovement` in interface `Physics`
      Overrides:
        `activeMovement` in class `GridPhysics`

    - #### distance

          public double distance(java.awt.Rectangle r1,
                        java.awt.Rectangle r2)

      Euclidean distance between two rectangles.
      Specified by:
        `distance` in interface `Physics`
      Overrides:
        `distance` in class `GridPhysics`
      Parameters:
        `r1` - rectangle 1
        `r2` - rectangle 2
      Returns:
        Euclidean distance between the top-left corner of the rectangles.