Package repast.simphony.space.physics
Class DefaultPhysicsSpace<T>
java.lang.Object
repast.simphony.space.projection.DefaultProjection<T>
repast.simphony.space.continuous.AbstractContinuousSpace<T,Map<NdPoint,Object>>
repast.simphony.space.continuous.DefaultContinuousSpace<T>
repast.simphony.space.physics.DefaultPhysicsSpace<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
ContinuousSpace<T>
,PhysicsSpace<T>
,Projection<T>
- Direct Known Subclasses:
ContextPhysics
A special 3-dimensional subclass of continuous space that determines the
positions of agents based on physics.
- Author:
- Eric Tatara
-
Nested Class Summary
Nested classes/interfaces inherited from class repast.simphony.space.continuous.AbstractContinuousSpace
AbstractContinuousSpace.PointHolder
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.bulletphysics.collision.dispatch.CollisionConfiguration
protected com.bulletphysics.collision.dispatch.CollisionDispatcher
protected com.bulletphysics.dynamics.DiscreteDynamicsWorld
protected int
protected com.bulletphysics.dynamics.constraintsolver.SequentialImpulseConstraintSolver
protected float
Fields inherited from class repast.simphony.space.continuous.AbstractContinuousSpace
accessor, adder, agentLocationMap, dimensions, locationStorage, size, translator
Fields inherited from class repast.simphony.space.projection.DefaultProjection
listeners, name
-
Constructor Summary
ConstructorDescriptionDefaultPhysicsSpace
(String name, ContinuousAdder<T> adder, PointTranslator translator, double[] size, double[] origin) Constructs this space with the specified name, adder, translator, size and origin.DefaultPhysicsSpace
(String name, ContinuousAdder<T> adder, PointTranslator translator, double xdim, double ydim, double zdim) Constructs this space with the specified name, adder, translator, and size. -
Method Summary
Modifier and TypeMethodDescriptionboolean
float[]
float[]
getLinearVelocity
(T object) int
float
com.bulletphysics.linearmath.Transform
getTransformForObject
(T object) protected void
initPhysics
(boolean scheduleStep) void
setGravity
(float x, float y, float z) void
setLinearVelocity
(T object, float x, float y, float z) void
setMaxSubSteps
(int maxSubSteps) void
setStepSize
(float stepSize) void
step()
Manually step the physics space dynamicsMethods inherited from class repast.simphony.space.continuous.DefaultContinuousSpace
createLocationStorage
Methods inherited from class repast.simphony.space.continuous.AbstractContinuousSpace
doMove, evaluate, getAdder, getDimensions, getDisplacement, getDistance, getDistanceSq, getLocation, getLocation, getObjectAt, getObjects, getObjectsAt, getPointTranslator, getRandomObjectAt, isPeriodic, moveByDisplacement, moveByVector, moveTo, remove, removeAll, setAdder, setPointTranslator, size
Methods inherited from class repast.simphony.space.projection.DefaultProjection
addProjectionListener, fireProjectionEvent, getName, getProjectionListeners, removeProjectionListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface repast.simphony.space.projection.Projection
addProjectionListener, evaluate, getName, getProjectionListeners, removeProjectionListener
-
Field Details
-
collisionConfiguration
protected com.bulletphysics.collision.dispatch.CollisionConfiguration collisionConfiguration -
dispatcher
protected com.bulletphysics.collision.dispatch.CollisionDispatcher dispatcher -
solver
protected com.bulletphysics.dynamics.constraintsolver.SequentialImpulseConstraintSolver solver -
dynamicsWorld
protected com.bulletphysics.dynamics.DiscreteDynamicsWorld dynamicsWorld -
bodyToObjectMap
-
objectToBodyMap
-
stepSize
protected float stepSize -
maxSubSteps
protected int maxSubSteps
-
-
Constructor Details
-
DefaultPhysicsSpace
public DefaultPhysicsSpace(String name, ContinuousAdder<T> adder, PointTranslator translator, double xdim, double ydim, double zdim) Constructs this space with the specified name, adder, translator, and size.- Parameters:
name
- the name of the spaceadder
- the adder used by the spacetranslator
- the point translatorxdim
- the size of the x dimensionydim
- the size of the y dimensionzdim
- the size of the z dimension
-
DefaultPhysicsSpace
public DefaultPhysicsSpace(String name, ContinuousAdder<T> adder, PointTranslator translator, double[] size, double[] origin) Constructs this space with the specified name, adder, translator, size and origin.- Parameters:
name
- the name of the spaceadder
- the adder used by the spacetranslator
- the point translatorsize
- the dimensions of the spaceorigin
- the origin of the space
-
-
Method Details
-
initPhysics
protected void initPhysics(boolean scheduleStep) -
addObject
- Specified by:
addObject
in interfacePhysicsSpace<T>
-
getTransformForObject
- Specified by:
getTransformForObject
in interfacePhysicsSpace<T>
-
step
public void step()Description copied from interface:PhysicsSpace
Manually step the physics space dynamics- Specified by:
step
in interfacePhysicsSpace<T>
-
setLinearVelocity
- Specified by:
setLinearVelocity
in interfacePhysicsSpace<T>
-
getLinearVelocity
- Specified by:
getLinearVelocity
in interfacePhysicsSpace<T>
-
setGravity
public void setGravity(float x, float y, float z) - Specified by:
setGravity
in interfacePhysicsSpace<T>
-
getGravity
public float[] getGravity()- Specified by:
getGravity
in interfacePhysicsSpace<T>
-
getStepSize
public float getStepSize()- Specified by:
getStepSize
in interfacePhysicsSpace<T>
-
setStepSize
public void setStepSize(float stepSize) - Specified by:
setStepSize
in interfacePhysicsSpace<T>
-
getMaxSubSteps
public int getMaxSubSteps()- Specified by:
getMaxSubSteps
in interfacePhysicsSpace<T>
-
setMaxSubSteps
public void setMaxSubSteps(int maxSubSteps) - Specified by:
setMaxSubSteps
in interfacePhysicsSpace<T>
-