- Object
-
- AbstractCollisionWorld<T,BodyFixture,V>
-
- AbstractPhysicsWorld<T,WorldCollisionData<T>>
-
- World<T>
-
- Type Parameters:
T
- thePhysicsBody
type
- All Implemented Interfaces:
DataContainer
,Shiftable
,CollisionWorld<T,BodyFixture,WorldCollisionData<T>>
,PhysicsWorld<T,WorldCollisionData<T>>
public class World<T extends PhysicsBody> extends AbstractPhysicsWorld<T,WorldCollisionData<T>>
Full implementation of both theCollisionWorld
andPhysicsWorld
interfaces.NOTE: This class uses the
AbstractCollisionBody.setOwner(Object)
andAbstractCollisionBody.setFixtureModificationHandler(org.dyn4j.collision.FixtureModificationHandler)
methods to handle certain scenarios like fixture removal on a body or bodies added to more than one world. Likewise, theJoint.setOwner(Object)
method is used to handle joints being added to the world. Callers should NOT use these methods.- Since:
- 4.0.0
- Version:
- 4.1.0
- Author:
- William Bittle
-
-
Field Summary
-
Fields inherited from class AbstractPhysicsWorld
ccdBroadphase, ccdCollisionData, constraintGraph, contactCollisions, contactConstraintSolver, contactListeners, contactListenersUnmodifiable, destructionListeners, destructionListenersUnmodifiable, gravity, joints, jointsUnmodifiable, settings, stepListeners, stepListenersUnmodifiable, time, timeOfImpactListeners, timeOfImpactListenersUnmodifiable, timeOfImpactSolver, timeStep, updateRequired, valueMixer
-
Fields inherited from class AbstractCollisionWorld
bodies, bodiesUnmodifiable, bounds, boundsListeners, boundsListenersUnmodifiable, broadphaseDetector, broadphaseFilter, collisionData, collisionListeners, collisionListenersUnmodifiable, manifoldSolver, narrowphaseDetector, narrowphasePostProcessor, raycastDetector, timeOfImpactDetector, userData
-
Fields inherited from interface CollisionWorld
DEFAULT_INITIAL_BODY_CAPACITY
-
Fields inherited from interface PhysicsWorld
DEFAULT_INITIAL_JOINT_CAPACITY, EARTH_GRAVITY, ZERO_GRAVITY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WorldCollisionData<T>
createCollisionData(CollisionPair<CollisionItem<T,BodyFixture>> pair)
Creates a newCollisionData
instance for the given pair.-
Methods inherited from class AbstractPhysicsWorld
addBody, addContactListener, addDestructionListener, addJoint, addStepListener, addTimeOfImpactListener, clear, containsJoint, destroyContacts, destroyJoints, getAccumulatedTime, getCoefficientMixer, getContactConstraintSolver, getContactListeners, getContacts, getContinuousCollisionDetectionBroadphaseDetector, getDestructionListeners, getGravity, getInContactBodies, getJoinedBodies, getJoint, getJointCount, getJointIterator, getJoints, getJoints, getSettings, getStepListeners, getTimeOfImpactListeners, getTimeOfImpactSolver, getTimeStep, getValueMixer, handleAllFixturesRemoved, handleFixtureRemoved, isEmpty, isInContact, isJoined, isJointCollisionAllowed, isUpdateRequired, processCollisions, removeAllBodies, removeAllBodies, removeAllBodiesAndJoints, removeAllBodiesAndJoints, removeAllContactListeners, removeAllDestructionListeners, removeAllJoints, removeAllJoints, removeAllListeners, removeAllStepListeners, removeAllTimeOfImpactListeners, removeBody, removeBody, removeBody, removeBody, removeContactListener, removeDestructionListener, removeJoint, removeJoint, removeStepListener, removeTimeOfImpactListener, setAccumulatedTime, setCoefficientMixer, setContactConstraintSolver, setContinuousCollisionDetectionBroadphaseDetector, setGravity, setGravity, setSettings, setTimeOfImpactSolver, setUpdateRequired, setValueMixer, shift, solveTOI, solveTOI, step, step, step, update, update, update, update, updatev
-
Methods inherited from class AbstractCollisionWorld
addBoundsListener, addCollisionListener, containsBody, convexCast, convexCastClosest, convexCastClosest, convexCastIterator, detect, detect, detect, detect, detect, detectIterator, detectIterator, detectIterator, detectIterator, getBodies, getBody, getBodyCount, getBodyIterator, getBounds, getBoundsListeners, getBroadphaseCollisionDataFilter, getBroadphaseDetector, getCollisionData, getCollisionDataIterator, getCollisionListeners, getManifoldSolver, getNarrowphaseDetector, getNarrowphasePostProcessor, getRaycastDetector, getTimeOfImpactDetector, getUserData, handleFixtureAdded, raycast, raycast, raycastClosest, raycastClosest, raycastIterator, raycastIterator, removeAllBoundsListeners, removeAllCollisionListeners, removeBoundsListener, removeCollisionListener, setBounds, setBroadphaseCollisionDataFilter, setBroadphaseDetector, setManifoldSolver, setNarrowphaseDetector, setNarrowphasePostProcessor, setRaycastDetector, setTimeOfImpactDetector, setUserData
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface CollisionWorld
addBoundsListener, addCollisionListener, containsBody, convexCast, convexCastClosest, convexCastClosest, convexCastIterator, detect, detect, detect, detect, detectIterator, detectIterator, detectIterator, detectIterator, getBodies, getBody, getBodyCount, getBodyIterator, getBounds, getBoundsListeners, getBroadphaseCollisionDataFilter, getBroadphaseDetector, getCollisionData, getCollisionDataIterator, getCollisionListeners, getManifoldSolver, getNarrowphaseDetector, getNarrowphasePostProcessor, getRaycastDetector, getTimeOfImpactDetector, raycast, raycast, raycastClosest, raycastClosest, raycastIterator, raycastIterator, removeAllBoundsListeners, removeAllCollisionListeners, removeBoundsListener, removeCollisionListener, setBounds, setBroadphaseCollisionDataFilter, setBroadphaseDetector, setManifoldSolver, setNarrowphaseDetector, setNarrowphasePostProcessor, setRaycastDetector, setTimeOfImpactDetector
-
Methods inherited from interface DataContainer
getUserData, setUserData
-
-
-
-
Method Detail
-
createCollisionData
protected WorldCollisionData<T> createCollisionData(CollisionPair<CollisionItem<T,BodyFixture>> pair)
Description copied from class:AbstractCollisionWorld
Creates a newCollisionData
instance for the given pair.- Specified by:
createCollisionData
in classAbstractCollisionWorld<T extends PhysicsBody,BodyFixture,WorldCollisionData<T extends PhysicsBody>>
- Parameters:
pair
- the pair- Returns:
- V
-
-