Package fr.phylisiumstudio.logic
Class WorldPhysics
java.lang.Object
fr.phylisiumstudio.logic.WorldPhysics
- Direct Known Subclasses:
BulletWorldPhysics
Interface for the physics world
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclear()Clear the worldabstract voidconvertChunk(javax.vecmath.Vector3f pos1, javax.vecmath.Vector3f pos2) convert region physicsabstract RigidBlockcreateBox(org.bukkit.Location location, org.bukkit.block.data.BlockData blockData, float mass, float xScale, float yScale, float zScale) Create a boxabstract RigidBlockcreateSphere(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float radius, float mass) Create a sphereabstract RigidBlockGet the block with the given idabstract List<RigidBlock> Get the blocksabstract intGet Max substepsabstract floatGet the time spanabstract UUIDGet the unique id of the worldabstract StringGet the world nameabstract booleanisFrozen()is frozenabstract booleanVerify if the world can runvoidlinkRigidBlock(RigidBlock rigidBlock, RigidBlock rigidBlock1) Link two rigid blocksabstract voidremoveBlock(RigidBlock block) Remove a blockabstract voidsetFreeze(boolean freeze) set freezeabstract voidsetMaxSubSteps(int maxSubSteps) Set Max substepsabstract voidsetTimespan(float timespan) Set the time spanabstract voidStep the simulation
-
Constructor Details
-
WorldPhysics
public WorldPhysics()
-
-
Method Details
-
stepSimulation
public abstract void stepSimulation()Step the simulation -
getUniqueId
Get the unique id of the world- Returns:
- the unique id
-
getWorldName
Get the world name- Returns:
- the world name
-
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 usemass- the mass of the blockxScale- the x scaleyScale- the y scalezScale- 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 radiusmass- the mass- Returns:
- the sphere
-
removeBlock
Remove a block- Parameters:
block- the block to remove
-
clear
public abstract void clear()Clear the world -
getBlock
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 positionpos2- 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
Link two rigid blocks- Parameters:
rigidBlock- the first blockrigidBlock1- the second block
-