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
FieldsModifier and TypeFieldDescriptionprotected com.bulletphysics.collision.dispatch.CollisionConfigurationprotected com.bulletphysics.collision.dispatch.CollisionDispatcherprotected com.bulletphysics.dynamics.DiscreteDynamicsWorldprotected intprotected com.bulletphysics.dynamics.constraintsolver.SequentialImpulseConstraintSolverprotected floatFields inherited from class repast.simphony.space.continuous.AbstractContinuousSpace
accessor, adder, agentLocationMap, dimensions, locationStorage, size, translatorFields inherited from class repast.simphony.space.projection.DefaultProjection
listeners, name -
Constructor Summary
ConstructorsConstructorDescriptionDefaultPhysicsSpace(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 TypeMethodDescriptionbooleanfloat[]float[]getLinearVelocity(T object) intfloatcom.bulletphysics.linearmath.TransformgetTransformForObject(T object) protected voidinitPhysics(boolean scheduleStep) voidsetGravity(float x, float y, float z) voidsetLinearVelocity(T object, float x, float y, float z) voidsetMaxSubSteps(int maxSubSteps) voidsetStepSize(float stepSize) voidstep()Manually step the physics space dynamicsMethods inherited from class repast.simphony.space.continuous.DefaultContinuousSpace
createLocationStorageMethods 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, sizeMethods inherited from class repast.simphony.space.projection.DefaultProjection
addProjectionListener, fireProjectionEvent, getName, getProjectionListeners, removeProjectionListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
addObjectin interfacePhysicsSpace<T>
-
getTransformForObject
- Specified by:
getTransformForObjectin interfacePhysicsSpace<T>
-
step
public void step()Description copied from interface:PhysicsSpaceManually step the physics space dynamics- Specified by:
stepin interfacePhysicsSpace<T>
-
setLinearVelocity
- Specified by:
setLinearVelocityin interfacePhysicsSpace<T>
-
getLinearVelocity
- Specified by:
getLinearVelocityin interfacePhysicsSpace<T>
-
setGravity
public void setGravity(float x, float y, float z) - Specified by:
setGravityin interfacePhysicsSpace<T>
-
getGravity
public float[] getGravity()- Specified by:
getGravityin interfacePhysicsSpace<T>
-
getStepSize
public float getStepSize()- Specified by:
getStepSizein interfacePhysicsSpace<T>
-
setStepSize
public void setStepSize(float stepSize) - Specified by:
setStepSizein interfacePhysicsSpace<T>
-
getMaxSubSteps
public int getMaxSubSteps()- Specified by:
getMaxSubStepsin interfacePhysicsSpace<T>
-
setMaxSubSteps
public void setMaxSubSteps(int maxSubSteps) - Specified by:
setMaxSubStepsin interfacePhysicsSpace<T>
-