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 void
clear()
Clear the worldabstract void
convertChunk
(javax.vecmath.Vector3f pos1, javax.vecmath.Vector3f pos2) convert region physicsabstract RigidBlock
createBox
(org.bukkit.Location location, org.bukkit.block.data.BlockData blockData, float mass, float xScale, float yScale, float zScale) Create a boxabstract RigidBlock
createSphere
(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float radius, float mass) Create a sphereabstract RigidBlock
Get the block with the given idabstract List
<RigidBlock> Get the blocksabstract int
Get Max substepsabstract float
Get the time spanabstract UUID
Get the unique id of the worldabstract String
Get the world nameabstract boolean
isFrozen()
is frozenabstract boolean
Verify if the world can runvoid
linkRigidBlock
(RigidBlock rigidBlock, RigidBlock rigidBlock1) Link two rigid blocksabstract void
removeBlock
(RigidBlock block) Remove a blockabstract void
setFreeze
(boolean freeze) set freezeabstract void
setMaxSubSteps
(int maxSubSteps) Set Max substepsabstract void
setTimespan
(float timespan) Set the time spanabstract void
Step 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
-