Class BulletWorldPhysics

java.lang.Object
fr.phylisiumstudio.logic.WorldPhysics
fr.phylisiumstudio.bullet.BulletWorldPhysics

public class BulletWorldPhysics extends WorldPhysics
A world physics implementation using bullet physics
  • Constructor Details

    • BulletWorldPhysics

      public BulletWorldPhysics(org.bukkit.World bukkitWorld)
  • Method Details

    • stepSimulation

      public void stepSimulation()
      Step the simulation
      Specified by:
      stepSimulation in class WorldPhysics
    • getUniqueId

      public UUID getUniqueId()
      Get the unique id of the world (bukkit world)
      Specified by:
      getUniqueId in class WorldPhysics
      Returns:
      the unique id
    • getWorldName

      public String getWorldName()
      Get the world name
      Specified by:
      getWorldName in class WorldPhysics
      Returns:
      the world name
    • getBlocks

      public List<RigidBlock> getBlocks()
      Get the blocks
      Specified by:
      getBlocks in class WorldPhysics
      Returns:
      the blocks
    • createBox

      public RigidBlock createBox(org.bukkit.Location location, org.bukkit.block.data.BlockData blockData, float mass, float xScale, float yScale, float zScale)
      Create a box
      Specified by:
      createBox in class WorldPhysics
      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 RigidBlock createSphere(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float radius, float mass)
      Create a sphere
      Specified by:
      createSphere in class WorldPhysics
      Parameters:
      location - the location (must be in the same world)
      radius - the radius
      mass - the mass
      Returns:
      the sphere
    • removeBlock

      public void removeBlock(RigidBlock block)
      Remove a block
      Specified by:
      removeBlock in class WorldPhysics
      Parameters:
      block - the block to remove
    • clear

      public void clear()
      Clear the world
      Specified by:
      clear in class WorldPhysics
    • getBlock

      @Nullable public @Nullable RigidBlock getBlock(UUID id)
      Get the block with the given id
      Specified by:
      getBlock in class WorldPhysics
      Parameters:
      id - the id
      Returns:
      the block
    • convertChunk

      public void convertChunk(javax.vecmath.Vector3f pos1, javax.vecmath.Vector3f pos2)
      Description copied from class: WorldPhysics
      convert region physics
      Specified by:
      convertChunk in class WorldPhysics
      Parameters:
      pos1 - the first position
      pos2 - the second position
    • getTimespan

      public float getTimespan()
      Get the time freeze
      Specified by:
      getTimespan in class WorldPhysics
    • setTimespan

      public void setTimespan(float timespan)
      Set the time freeze
      Specified by:
      setTimespan in class WorldPhysics
      Parameters:
      timespan -
    • getMaxSubSteps

      public int getMaxSubSteps()
      Get Max substeps
      Specified by:
      getMaxSubSteps in class WorldPhysics
    • setMaxSubSteps

      public void setMaxSubSteps(int maxSubSteps)
      Set Max substeps
      Specified by:
      setMaxSubSteps in class WorldPhysics
      Parameters:
      maxSubSteps -
    • setFreeze

      public void setFreeze(boolean freeze)
      set freeze
      Specified by:
      setFreeze in class WorldPhysics
      Parameters:
      freeze - the freeze
    • isFrozen

      public boolean isFrozen()
      is frozen
      Specified by:
      isFrozen in class WorldPhysics
      Returns:
      is frozen
    • isRunning

      public boolean isRunning()
      Verify if the world can run
      Specified by:
      isRunning in class WorldPhysics
      Returns:
      if the world can run