- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- reset
- addUsdRepresentation
- createUsdRepresentation
- createShapesUsdRepresentation
- createMarkupsUsdRepresentation
- createUsdRepresentation
- createAgentsUsdRepresentation
- createUsdRepresentation
- disableBasisMirroring
- generateAndRegisterUsdRepresentation
- generateOmniFrame
- getCache
- getUsdRepresentation
- getParameters
- getUsdRepresentation
- getUsdRepresentation
- setGlobalCoordinateTransform
- setConnectionParameters
- setConnectionParameters
- java.lang.Object
- com.anylogic.engine.omniverse_connector.UsdContext
public class UsdContext extends Object
The UsdContext object is the main interface for interacting with and managing USD data within your code,
providing integration between various elements of your scene and their corresponding USD representations
Modifier and Type | Class | Description |
---|---|---|
static final record | UsdContext.UsdItem |
Binding for OM element to USD prim
|
Modifier and Type | Field | Description |
---|---|---|
static long | currentVersion |
Constructor | Description |
---|---|
UsdContext() |
Modifier and Type | Method | Description |
---|---|---|
<T extends UsdRepresentation<?>> | addUsdRepresentation |
Add manually created UsdRepresentation to use during model run
|
PopulationUsdRepresentation | createAgentsUsdRepresentation |
Create a connection between an agents and a USD prim.
|
<T extends AbstractPositionalMarkup> | createMarkupsUsdRepresentation |
Create a connection between provided model elements and a USD prims.
|
<T extends Shape> | createShapesUsdRepresentation |
Create a connection between provided shapes collection and a USD prims.
|
<T extends Shape> | createUsdRepresentation |
Create USD representation to bind replicated shape elements to USD prim
|
<E, | createUsdRepresentation |
Create a connection between a model element and a USD prim.
|
<T extends UsdElement> | createUsdRepresentation |
Create a connection between provided model elements and a USD prims.
|
UsdContext | disableBasisMirroring() |
Applies Y-axis mirroring to the USD scene.
|
InstancingUsdRepresentation<?> | generateAndRegisterUsdRepresentation | |
OmniFrame | generateOmniFrame | |
UsdObjectCache | getCache() | |
OmniverseSyncParameters | getParameters() | |
<T extends Agent> | getUsdRepresentation |
Get UsdRepresentation instance that was generated for Agent USD model configured in graphical editor
|
InstancingUsdRepresentation<?> | getUsdRepresentation |
Get UsdRepresentation instance that was generated for Agent element that has USD path or USD model configured in graphical editor
|
UsdRepresentation<?> | getUsdRepresentation |
Get UsdRepresentation for provided model element
|
void | reset() | |
UsdContext | setConnectionParameters |
Configures the parameters used to connect to the Omniverse scene.
|
UsdContext | setConnectionParameters |
Configures the parameters used to connect to the Omniverse scene.
|
UsdContext | setGlobalCoordinateTransform |
Sets the default position transformation function that will be applied to the positions of the model elements before applying to the connected USD prims.
|
public static volatile long currentVersion
public UsdContext()
@AnyLogicInternalAPI public void reset()
public <T extends UsdRepresentation<?>> T addUsdRepresentation(T usdRepresentation)
Add manually created UsdRepresentation to use during model run
- Parameters:
usdRepresentation
-
public <T extends Shape> UsdRepresentation<T> createUsdRepresentation(ReplicatedShape<T> elements, String scenePath)
Create USD representation to bind replicated shape elements to USD prim
- Parameters:
elements
- model elementscenePath
- USD scene file path- Returns:
- USD representation
public <T extends Shape> UsdRepresentation<T> createShapesUsdRepresentation(Iterable<T> elements, String scenePath)
Create a connection between provided shapes collection and a USD prims.
- Parameters:
elements
- Collection of shapesscenePath
- USD scene file path- Returns:
- Created and added to context UsdRepresentation object for provided shapes collection
public <T extends AbstractPositionalMarkup> UsdRepresentation<T> createMarkupsUsdRepresentation(Iterable<T> elements, String scenePath)
Create a connection between provided model elements and a USD prims.
- Parameters:
elements
- Collection of model elementsscenePath
- USD scene file path- Returns:
- Created and added to context UsdRepresentation object for provided elements collection
public <T extends UsdElement> UsdRepresentation<T> createUsdRepresentation(Iterable<T> elements, String scenePath)
Create a connection between provided model elements and a USD prims.
- Parameters:
elements
- Collection of model elementsscenePath
- USD scene file path- Returns:
- Created and added to context UsdRepresentation object for provided elements collection
public PopulationUsdRepresentation createAgentsUsdRepresentation(Iterable<? extends Agent> elements, String scenePath)
Create a connection between an agents and a USD prim.
- Parameters:
elements
- agentsscenePath
- USD scene file path- Returns:
- Created and added to context UsdRepresentation object for provided agents collection
public <E,T extends UsdRepresentation<E>> T createUsdRepresentation(E element, String primPath)
Create a connection between a model element and a USD prim.
- Type Parameters:
E
- An element of the model (an agent, a shape, and so on).T
-- Parameters:
element
- The model elementprimPath
- A path to the prim within the USD scene.- Returns:
- Created and added to context UsdRepresentation object for provided model element
public UsdContext disableBasisMirroring()
Applies Y-axis mirroring to the USD scene.
Returns the reconfigured UsdContext object.
- Returns:
@AnyLogicInternalAPI public InstancingUsdRepresentation<?> generateAndRegisterUsdRepresentation(Agent rootAgent, UsdContext.UsdItem item, int cacheSize, boolean instanceable, Consumer<UsdRepresentation<?>> init)
@AnyLogicInternalAPI public OmniFrame generateOmniFrame(boolean fullFrame)
public UsdObjectCache getCache()
public UsdRepresentation<?> getUsdRepresentation(Object obj)
Get UsdRepresentation for provided model element
- Parameters:
obj
- modele element- Returns:
- configured representation or null if it was not configured
@AnyLogicInternalAPI public OmniverseSyncParameters getParameters()
public InstancingUsdRepresentation<?> getUsdRepresentation(Class cl, String elementName)
Get UsdRepresentation instance that was generated for Agent element that has USD path or USD model configured in graphical editor
- Parameters:
cl
- Agent classelementName
- element name- Returns:
- configured representation or null if it was not configured
public <T extends Agent> PopulationUsdRepresentation<T> getUsdRepresentation(Class<T> cl)
Get UsdRepresentation instance that was generated for Agent USD model configured in graphical editor
- Type Parameters:
T
- agent type- Parameters:
cl
- - Agent class- Returns:
- configured generator or null if it was not configured
public UsdContext setGlobalCoordinateTransform(Consumer<PositionAndScale> transformation)
Sets the default position transformation function that will be applied to the positions of the model elements before applying to the connected USD prims.
- Parameters:
transformation
- The transformation function- Returns:
- Returns the reconfigured UsdContext object.
public UsdContext setConnectionParameters(String scenePath, String password, boolean startLocalConnector, boolean openScene, boolean useAutoGeneratedObjects, UsdRepresentation<?>... usdRepresentations)
Configures the parameters used to connect to the Omniverse scene.
- Parameters:
scenePath
- The path to the USD scene on the Omniverse Nucleus server.password
- The password to use to connect to the server in case Omniverse is hosted on a different computer.startLocalConnector
- Run AnyLogic Omniverse Connector at model startup (in case you need to run it separately or on a different computer).openScene
- try to run Omniverse Launcher to open scene provided by scene path at model startupuseAutoGeneratedObjects
- try use autogenerated USD files for model 3D ObjectsusdRepresentations
- The collection of UsdRepresentation objects that connect the model elements to USD prims.- Returns:
- Returns the reconfigured UsdContext object.
public UsdContext setConnectionParameters(String scenePath, String password, UsdRepresentation<?>... usdRepresentations)
Configures the parameters used to connect to the Omniverse scene.
- Parameters:
scenePath
- The path to the USD scene on the Omniverse Nucleus server.password
- The password to use to connect to the server in case Omniverse is hosted on a different computer.generators
- The collection of UsdRepresentation objects that connect the model elements to USD prims.- Returns:
- Returns the reconfigured UsdContext object.