Class WorldPhysics

java.lang.Object
fr.phylisiumstudio.logic.WorldPhysics
Direct Known Subclasses:
BulletWorldPhysics

public abstract class WorldPhysics extends Object
Interface for the physics world
  • Constructor Details

    • WorldPhysics

      public WorldPhysics()
  • Method Details

    • stepSimulation

      public abstract void stepSimulation()
      Step the simulation
    • getUniqueId

      public abstract UUID getUniqueId()
      Get the unique id of the world
      Returns:
      the unique id
    • getWorldName

      public abstract String getWorldName()
      Get the world name
      Returns:
      the world name
    • getBlocks

      public abstract List<RigidBlock> getBlocks()
      Get the blocks
      Returns:
      the blocks
    • createBox

      public abstract RigidBlock createBox(org.bukkit.Location location, org.bukkit.block.data.BlockData blockData, float mass, float xScale, float yScale, float zScale)
      Create a box
      Parameters:
      location - the location (must be in the same world)
      blockData - the block data to use
      mass - the mass of the block
      xScale - the x scale
      yScale - the y scale
      zScale - the z scale
      Returns:
      the box
    • createSphere

      public abstract RigidBlock createSphere(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float radius, float mass)
      Create a sphere
      Parameters:
      location - the location (must be in the same world)
      radius - the radius
      mass - the mass
      Returns:
      the sphere
    • removeBlock

      public abstract void removeBlock(RigidBlock block)
      Remove a block
      Parameters:
      block - the block to remove
    • clear

      public abstract void clear()
      Clear the world
    • getBlock

      public abstract RigidBlock getBlock(UUID id)
      Get the block with the given id
      Parameters:
      id - the id
      Returns:
      the block
    • convertChunk

      public abstract void convertChunk(javax.vecmath.Vector3f pos1, javax.vecmath.Vector3f pos2)
      convert region physics
      Parameters:
      pos1 - the first position
      pos2 - the second position
    • getTimespan

      public abstract float getTimespan()
      Get the time span
    • setTimespan

      public abstract void setTimespan(float timespan)
      Set the time span
    • getMaxSubSteps

      public abstract int getMaxSubSteps()
      Get Max substeps
    • setMaxSubSteps

      public abstract void setMaxSubSteps(int maxSubSteps)
      Set Max substeps
    • setFreeze

      public abstract void setFreeze(boolean freeze)
      set freeze
      Parameters:
      freeze - the freeze
    • isFrozen

      public abstract boolean isFrozen()
      is frozen
      Returns:
      is frozen
    • isRunning

      public abstract boolean isRunning()
      Verify if the world can run
      Returns:
      if the world can run
    • linkRigidBlock

      public void linkRigidBlock(RigidBlock rigidBlock, RigidBlock rigidBlock1)
      Link two rigid blocks
      Parameters:
      rigidBlock - the first block
      rigidBlock1 - the second block