public abstract class Space3D extends AbstractEnvironmentSpace
Modifier and Type | Field and Description |
---|---|
static String |
BORDER_RELAXED
Border relaxed mode.
|
static String |
BORDER_STRICT
Border strict mode.
|
static String |
BORDER_TORUS
Border torus behavior.
|
static String |
PROPERTY_BORDER
The constant for the border property.
|
static String |
PROPERTY_POSITION
The constant for the position property.
|
Modifier and Type | Method and Description |
---|---|
IVector3 |
adjustPosition(IVector3 pos)
Calculate a position according to the space borders.
|
IVector1 |
calculateDistance(IVector1 dx,
IVector1 dy,
IVector1 dz)
Calculate the distance in the space.
|
IVector3 |
getAreaSize()
Returns the size of the simulated area.
|
String |
getBorderMode()
Get the border mode.
|
IVector1 |
getDistance(IVector1 pos1,
IVector1 pos2,
boolean isx)
Get the distance between two coordinates (x or y).
|
IVector1 |
getDistance(IVector3 pos1,
IVector3 pos2)
Get the distance between three positions.
|
ISpaceObject |
getNearestObject(IVector3 position,
IVector1 maxdist,
String type)
Returns the nearest object to the given position within a
maximum distance from the position.
|
Set |
getNearObjects(IVector3 position,
IVector1 maxdist)
Retrieve all objects in the distance for a position
|
Set |
getNearObjects(IVector3 position,
IVector1 maxdist,
IFilter filter)
Retrieve all objects in the distance for a position
|
Set |
getNearObjects(IVector3 position,
IVector1 maxdist,
String type)
Retrieve all objects in the distance for a position
|
IVector3 |
getRandomPosition(IVector3 distance)
Retrieves a random position within the simulation area with a minimum
distance from the edge.
|
Object[] |
getSpaceObjects()
Get all space objects.
|
void |
initSpaceObject(ISpaceObject ret)
Init an object in this space.
|
void |
setAreaSize(IVector3 areasize)
Set the area size.
|
void |
setPosition(Object id,
IVector3 pos)
Set the position of an object.
|
addAvatarMappings, addDataConsumer, addDataProvider, addDataView, addDataViewMapping, addEnvironmentListener, addInitialAvatar, addObjectTaskType, addPerceptGenerator, addPerceptProcessor, addPerceptType, addSpaceAction, addSpaceObjectType, addSpaceProcessType, addTaskListener, cancelSpaceAction, componentAdded, componentRemoved, createObjectTask, createPercept, createSpaceObject, createSpaceObjectZombie, createSpaceProcess, destroySpaceObject, getAvatar, getAvatar, getAvatars, getClassLoader, getComponentActionList, getComponents, getDataConsumer, getDataConsumers, getDataProvider, getDataView, getDataViews, getExternalAccess, getFetcher, getOwner, getPerceptList, getPerceptType, getProcesses, getProperty, getSpaceAction, getSpaceObject, getSpaceObject0, getSpaceObjectsByType, getSpaceObjectsCollection, getSpaceProcess, getSpaceProcessNames, getViews, init, initSpace, performSpaceAction, performSpaceAction, removeAvatarMappings, removeDataView, removeEnvironmentListener, removeObjectTask, removeObjectTaskType, removePerceptGenerator, removePerceptProcessor, removePerceptType, removeSpaceAction, removeSpaceObjectType, removeSpaceProcess, removeSpaceProcessType, removeTaskListener, setFetcher, setInitData, setOwner, terminate, waitForTask
addPropertyChangeListener, getMonitor, getPropertyNames, hasProperty, removePropertyChangeListener, setProperty
getMetaData, getMetaDatas
getProperties, setProperties, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPropertyNames, hasProperty, setProperty
public static final String PROPERTY_POSITION
public static final String PROPERTY_BORDER
public static final String BORDER_STRICT
public static final String BORDER_RELAXED
public static final String BORDER_TORUS
public IVector3 getAreaSize()
public void setAreaSize(IVector3 areasize)
areasize
- The area size.public String getBorderMode()
public void initSpaceObject(ISpaceObject ret)
initSpaceObject
in class AbstractEnvironmentSpace
public void setPosition(Object id, IVector3 pos)
id
- The object id.pos
- The object position.public IVector1 getDistance(IVector3 pos1, IVector3 pos2)
pos1
- The first position.pos2
- The second position.pos3
- The third position.public IVector1 getDistance(IVector1 pos1, IVector1 pos2, boolean isx)
pos1
- The first position.pos2
- The second position.public IVector1 calculateDistance(IVector1 dx, IVector1 dy, IVector1 dz)
dx
- The distance in x.dy
- The distance in y.dz
- The distance in z.public IVector3 adjustPosition(IVector3 pos)
public IVector3 getRandomPosition(IVector3 distance)
distance
- minimum distance from the edge, null or zero for no distancepublic ISpaceObject getNearestObject(IVector3 position, IVector1 maxdist, String type)
position
- position the object should be nearest tomaxdist
- maximum distance from the position, use null for unlimited distancepublic Set getNearObjects(IVector3 position, IVector1 maxdist)
position
- distance
- public Set getNearObjects(IVector3 position, IVector1 maxdist, String type)
position
- distance
- public Set getNearObjects(IVector3 position, IVector1 maxdist, IFilter filter)
position
- distance
- public Object[] getSpaceObjects()
Copyright © 2013. All Rights Reserved.