Package fr.phylisiumstudio.bullet
Class BulletWorldPhysics
java.lang.Object
fr.phylisiumstudio.logic.WorldPhysics
fr.phylisiumstudio.bullet.BulletWorldPhysics
A world physics implementation using bullet physics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the worldvoidconvertChunk(javax.vecmath.Vector3f pos1, javax.vecmath.Vector3f pos2) convert region physicscreateBox(org.bukkit.Location location, org.bukkit.block.data.BlockData blockData, float mass, float xScale, float yScale, float zScale) Create a boxcreateSphere(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float radius, float mass) Create a sphere@Nullable RigidBlockGet the block with the given idGet the blocksintGet Max substepsfloatGet the time freezeGet the unique id of the world (bukkit world)Get the world namebooleanisFrozen()is frozenbooleanVerify if the world can runvoidremoveBlock(RigidBlock block) Remove a blockvoidsetFreeze(boolean freeze) set freezevoidsetMaxSubSteps(int maxSubSteps) Set Max substepsvoidsetTimespan(float timespan) Set the time freezevoidStep the simulationMethods inherited from class fr.phylisiumstudio.logic.WorldPhysics
linkRigidBlock
-
Constructor Details
-
BulletWorldPhysics
public BulletWorldPhysics(org.bukkit.World bukkitWorld)
-
-
Method Details
-
stepSimulation
public void stepSimulation()Step the simulation- Specified by:
stepSimulationin classWorldPhysics
-
getUniqueId
Get the unique id of the world (bukkit world)- Specified by:
getUniqueIdin classWorldPhysics- Returns:
- the unique id
-
getWorldName
Get the world name- Specified by:
getWorldNamein classWorldPhysics- Returns:
- the world name
-
getBlocks
Get the blocks- Specified by:
getBlocksin classWorldPhysics- 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:
createBoxin classWorldPhysics- 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 RigidBlock createSphere(org.bukkit.Location location, org.bukkit.block.data.BlockData data, float radius, float mass) Create a sphere- Specified by:
createSpherein classWorldPhysics- Parameters:
location- the location (must be in the same world)radius- the radiusmass- the mass- Returns:
- the sphere
-
removeBlock
Remove a block- Specified by:
removeBlockin classWorldPhysics- Parameters:
block- the block to remove
-
clear
public void clear()Clear the world- Specified by:
clearin classWorldPhysics
-
getBlock
Get the block with the given id- Specified by:
getBlockin classWorldPhysics- Parameters:
id- the id- Returns:
- the block
-
convertChunk
public void convertChunk(javax.vecmath.Vector3f pos1, javax.vecmath.Vector3f pos2) Description copied from class:WorldPhysicsconvert region physics- Specified by:
convertChunkin classWorldPhysics- Parameters:
pos1- the first positionpos2- the second position
-
getTimespan
public float getTimespan()Get the time freeze- Specified by:
getTimespanin classWorldPhysics
-
setTimespan
public void setTimespan(float timespan) Set the time freeze- Specified by:
setTimespanin classWorldPhysics- Parameters:
timespan-
-
getMaxSubSteps
public int getMaxSubSteps()Get Max substeps- Specified by:
getMaxSubStepsin classWorldPhysics
-
setMaxSubSteps
public void setMaxSubSteps(int maxSubSteps) Set Max substeps- Specified by:
setMaxSubStepsin classWorldPhysics- Parameters:
maxSubSteps-
-
setFreeze
public void setFreeze(boolean freeze) set freeze- Specified by:
setFreezein classWorldPhysics- Parameters:
freeze- the freeze
-
isFrozen
public boolean isFrozen()is frozen- Specified by:
isFrozenin classWorldPhysics- Returns:
- is frozen
-
isRunning
public boolean isRunning()Verify if the world can run- Specified by:
isRunningin classWorldPhysics- Returns:
- if the world can run
-