SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::Context Class Referenceabstract

Main entry point for SuperDex Physics simulation. More...

#include <mochi_context.h>

Public Member Functions

virtual void BindThisThread ()=0
 Bind the calling thread to this Context.
virtual void ClearFileCache ()=0
 Release all shapes that are being preserved by the file cache (if any).
virtual void ClearFileFromCache (std::string_view filePath)=0
 Release all cached entries for a given shape file.
virtual AsyncSceneCreateAsyncScene (std::string_view name, Error &error)=0
 Create a new AsyncScene.
virtual AsyncSceneCreateAsyncScenePaused (std::string_view name, Error &error)=0
 Create a new AsyncScene that will initially be in the paused state.
virtual ShapeHandle CreateMeshShape (MeshData const &mesh, Error &error)=0
 Create a shape using in-memory mesh data, so that it can be used to create actors.
virtual ShapeHandle CreateMeshShape (MeshDataView const &mesh, Error &error)=0
 Create a shape using in-memory mesh data, so that it can be used to create actors.
virtual ShapeHandle CreateModelShape (ModelData const &model, Error &error)=0
 Create a shape using in-memory model data, so that it can be used to create actors.
virtual ShapeHandle CreateModelShape (ModelDataView const &model, Error &error)=0
 Create a shape using in-memory model data, so that it can be used to create actors.
virtual ShapeHandle CreatePlaneShape (Real3 const &normal, real distance, Error &error)=0
 Create an implicit plane with infinite extents.
virtual SceneCreateScene (std::string_view name)=0
 Create a new Scene.
virtual ShapeHandle CreateSphereShape (Real3 const &center, real radius, Error &error)=0
 Create an implicit sphere shape.
virtual ShapeHandle CreateTetMeshShape (Span< real const > coordinates, Span< int const > connectivity, Error &error)=0
 Create a tetrahedral mesh shape using in-memory data.
virtual ShapeHandle CreateTriMeshShape (Span< real const > coordinates, Span< int const > connectivity, Error &error)=0
 Create a triangle mesh shape using in-memory data.
virtual void DestroyAsyncScene (AsyncScene *scene)=0
 Immediately stop and destroy an AsyncScene and all its actors and constraints.
virtual void DestroyScene (Scene *scene)=0
 Immediately destroy a scene and all its actors and constraints.
virtual void EnableFileCache (bool enable)=0
 Enable or disable the file cache.
virtual ArticulatedShapeInfo GetArticulatedShapeInfo (ShapeHandle shape, Error &error) const =0
 Get information about an articulated shape.
virtual DebugServer const & GetDebugServer () const =0
 Get a const reference to the debug server for this context.
virtual DebugServerGetDebugServer ()=0
 Get the debug server for this context.
virtual int GetNumShapes () const =0
 Get the number of shape handles that have been created/loaded and have not yet been released.
virtual int GetNumThreads () const =0
 Return the number of worker threads available to execute asynchronous tasks.
virtual Scene const * GetScene (SceneHandle handle) const =0
 Get a const pointer to a scene by its handle.
virtual SceneGetScene (SceneHandle handle)=0
 Get a pointer to a scene by its handle.
virtual Aabb GetShapeAabb (ShapeHandle shape, Error &error) const =0
 Get an axis-aligned bounding box (AABB) that contains the shape, in its local coordinate frame.
virtual MeshDataView GetShapeMesh (ShapeHandle shape, Error &error) const =0
 Get a view of the shape's main mesh data.
virtual MeshDataView GetShapeSurfaceMesh (ShapeHandle shape, Error &error) const =0
 Get a view of the shape's surface mesh data.
virtual MeshDataView GetShapeVisualMesh (ShapeHandle shape, Error &error) const =0
 Get a view of the shape's visual mesh data, including skinning data if available.
virtual bool IsFileCacheEnabled () const =0
 Return true if the file cache feature is enabled.
virtual bool IsSingleThreaded () const =0
 Return true if running in single-threaded mode.
virtual bool IsValidAsyncScene (AsyncScene const *scene) const =0
 Check if an AsyncScene is valid (not destroyed), and belongs to this Context.
virtual bool IsValidScene (Scene const *scene) const =0
 Check if a scene is valid (not destroyed), and belongs to this Context.
ShapeHandle LoadShapeFromBytes (Span< char const > fileData, Error &error)
 Load a shape from a file of supported format, where the file has already been loaded into memory.
virtual ShapeHandle LoadShapeFromBytes (Span< char const > fileData, MeshFileType format, Error &error)=0
 Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint.
ShapeHandle LoadShapeFromBytes (Span< char const > fileData, MeshFileType format, Real3 const &bakeScale, Error &error)
 Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint, and baking in some scale.
virtual ShapeHandle LoadShapeFromBytes (Span< char const > fileData, MeshFileType format, Real3 const &bakeScale, TransformRT const &bakeTransform, Error &error)=0
 Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint, and baking in some scale, rotation, and translation.
ShapeHandle LoadShapeFromBytes (Span< char const > fileData, MeshFileType format, TransformRT const &bakeTransform, Error &error)
 Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint, and baking in rotation and translation.
ShapeHandle LoadShapeFromBytes (Span< char const > fileData, Real3 const &bakeScale, Error &error)
 Load a shape from a file of supported format, where the file has already been loaded into memory, and baking in some scale.
ShapeHandle LoadShapeFromBytes (Span< char const > fileData, Real3 const &bakeScale, TransformRT const &bakeTransform, Error &error)
 Load a shape from a file of supported format, where the file has already been loaded into memory, and baking in some scale, rotation, and translation.
ShapeHandle LoadShapeFromBytes (Span< char const > fileData, TransformRT const &bakeTransform, Error &error)
 Load a shape from a file of supported format, where the file has already been loaded into memory, and baking in rotation and translation.
virtual ShapeHandle LoadShapeFromFile (std::string_view filePath, Error &error)=0
 Load a shape from a file of supported format.
ShapeHandle LoadShapeFromFile (std::string_view filePath, Real3 const &bakeScale, Error &error)
 Load a shape from a file of supported format, and bake in some scale.
virtual ShapeHandle LoadShapeFromFile (std::string_view filePath, Real3 const &bakeScale, TransformRT const &bakeTransform, Error &error)=0
 Load a shape from a file of supported format, and bake in some scale, rotation, and translation.
ShapeHandle LoadShapeFromFile (std::string_view filePath, TransformRT const &bakeTransform, Error &error)
 Load a shape from a file of supported format, and bake in rotation and translation.
virtual void ReleaseShape (ShapeHandle shape)=0
 Release a shape handle.
virtual void SetIsSingleThreaded (bool isSingleThreaded)=0
 Enable or disable single-threaded mode.
virtual void UnbindThisThread ()=0
 Unbind the calling thread from this Context.

Static Public Member Functions

static void EnableLogChannel (LogChannel channel, bool enable)
 Enable or disable log messages on the specified channel.
static OnAssertFn GetAssertionFailureCallback ()
 Get the function currently being used to report assertion failures.
static LogFn GetLogCallback ()
 Get the function currently being used to output logging.
static bool IsLogChannelEnabled (LogChannel channel)
 Return true if messages on the specified log channel are enabled.
static void SetAssertionFailureCallback (OnAssertFn callback)
 Optionally provide a callback function to customize the way in which assertion failures are reported.
static void SetLogCallback (LogFn callback)
 Optionally provide a callback function to redirect SuperDex Physics logging.

Protected Member Functions

virtual ~Context ()=default

Static Protected Member Functions

static void EnableLogChannelInternal (LogChannel channel, bool enable)
static void SetLogCallbackInternal (LogFn callback)

Detailed Description

Main entry point for SuperDex Physics simulation.

A Context owns all global state for SuperDex Physics: scenes, shapes, threading, and shared resources. Create exactly one per process with CreateContext, and destroy it with DestroyContext. Shapes are reference-counted and can be shared between actors.

Definition at line 47 of file mochi_context.h.

Constructor & Destructor Documentation

◆ ~Context()

virtual superdex::Context::~Context ( )
protectedvirtualdefault

Member Function Documentation

◆ BindThisThread()

virtual void superdex::Context::BindThisThread ( )
pure virtual

Bind the calling thread to this Context.

Required before using any Context, Scene, Actor, or another part of the SuperDex Physics API from a thread that did not create the Context. The thread that called CreateContext is bound automatically. Each call must be matched by a call to UnbindThisThread before the thread exits. The binding is reference-counted, so redundant calls from the same thread are safe as long as they are balanced.

Note
Call on any thread.
See also
UnbindThisThread, CreateContext

◆ ClearFileCache()

virtual void superdex::Context::ClearFileCache ( )
pure virtual

Release all shapes that are being preserved by the file cache (if any).

Use this to free up memory, or to force subsequent file requests to be loaded from disk, in case those files had been modified.

Note
Call on any thread.
See also
IsFileCacheEnabled, ClearFileFromCache

◆ ClearFileFromCache()

virtual void superdex::Context::ClearFileFromCache ( std::string_view filePath)
pure virtual

Release all cached entries for a given shape file.

Use this to free up memory, or to force the next file request to be loaded from disk, in case the file had been modified. All entries for filePath are removed, including every variant produced by different bake scale/transform combinations.

Parameters
[in]filePathPath to a file that may have been loaded. The match is case-sensitive and must equal the path used at load time exactly.
Note
Call on any thread.
See also
IsFileCacheEnabled, ClearFileCache

◆ CreateAsyncScene()

virtual AsyncScene * superdex::Context::CreateAsyncScene ( std::string_view name,
Error & error )
nodiscardpure virtual

Create a new AsyncScene.

The returned AsyncScene owns a synchronous Scene and automatically steps it using a long-lived simulation task executed by the SuperDex Physics worker pool. This type of scene is often used for real-time interactive simulations where the physics rate is independent of the render rate.

Parameters
[in]nameName of the scene to create (for debugging).
[in,out]errorError status. Check Error::IsOK for success.
Returns
Pointer to the new AsyncScene, or nullptr on error. Call DestroyAsyncScene when done with it.
Note
Must be called from a thread outside the SuperDex Physics worker pool.
Requires at least one worker thread to be available at call time. Fails if the Context was initialized with zero worker threads (see CreateContext), if single-threaded mode is currently enabled (see SetIsSingleThreaded), or if this call is made from one of the SuperDex Physics worker threads.
Do not call SetIsSingleThreaded from any thread while this function is executing. Single-threaded mode must remain disabled until this function returns.
The single-threaded-mode restriction applies only during this creation call. After the AsyncScene is created, single-threaded mode may be enabled.
See also
DestroyAsyncScene, IsValidAsyncScene, CreateAsyncScenePaused

◆ CreateAsyncScenePaused()

virtual AsyncScene * superdex::Context::CreateAsyncScenePaused ( std::string_view name,
Error & error )
nodiscardpure virtual

Create a new AsyncScene that will initially be in the paused state.

The returned AsyncScene owns a synchronous Scene and steps it using a long-lived simulation task executed by the SuperDex Physics worker pool. The scene starts paused but processes queued commands. It does not step the scene until unpaused.

Parameters
[in]nameName of the scene to create (for debugging).
[in,out]errorError status. Check Error::IsOK for success.
Returns
Pointer to the new AsyncScene, or nullptr on error. Call DestroyAsyncScene when done with it.
Note
Must be called from a thread outside the SuperDex Physics worker pool.
Requires at least one worker thread to be available at call time. Fails if the Context was initialized with zero worker threads (see CreateContext), if single-threaded mode is currently enabled (see SetIsSingleThreaded), or if this call is made from one of the SuperDex Physics worker threads.
Do not call SetIsSingleThreaded from any thread while this function is executing. Single-threaded mode must remain disabled until this function returns.
The single-threaded-mode restriction applies only during this creation call. After the AsyncScene is created, single-threaded mode may be enabled.
See also
CreateAsyncScene, DestroyAsyncScene, IsValidAsyncScene, AsyncScene::Pause, AsyncScene::IsPaused

◆ CreateMeshShape() [1/2]

virtual ShapeHandle superdex::Context::CreateMeshShape ( MeshData const & mesh,
Error & error )
nodiscardpure virtual

Create a shape using in-memory mesh data, so that it can be used to create actors.

Parameters
[in]meshThe mesh data, which SuperDex Physics copies.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
Can be a tetrahedral mesh, a triangular mesh, or a polyline mesh, depending on the value of MeshData::nodesPerElement.
See also
ShapeHandle, ReleaseShape

◆ CreateMeshShape() [2/2]

virtual ShapeHandle superdex::Context::CreateMeshShape ( MeshDataView const & mesh,
Error & error )
nodiscardpure virtual

Create a shape using in-memory mesh data, so that it can be used to create actors.

Parameters
[in]meshA non-owning view of the mesh data, which SuperDex Physics copies.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
Can be a tetrahedral mesh, a triangular mesh, or a polyline mesh, depending on the value of MeshDataView::nodesPerElement.
See also
ShapeHandle, ReleaseShape

◆ CreateModelShape() [1/2]

virtual ShapeHandle superdex::Context::CreateModelShape ( ModelData const & model,
Error & error )
nodiscardpure virtual

Create a shape using in-memory model data, so that it can be used to create actors.

Parameters
[in]modelThe model data, which SuperDex Physics copies.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
Can be a mesh or an implicit shape, depending on the contents.
See also
ShapeHandle, ReleaseShape

◆ CreateModelShape() [2/2]

virtual ShapeHandle superdex::Context::CreateModelShape ( ModelDataView const & model,
Error & error )
nodiscardpure virtual

Create a shape using in-memory model data, so that it can be used to create actors.

Parameters
[in]modelA non-owning view of the model data, which SuperDex Physics copies.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
Can be a mesh or an implicit shape, depending on the contents.
See also
ShapeHandle, ReleaseShape

◆ CreatePlaneShape()

virtual ShapeHandle superdex::Context::CreatePlaneShape ( Real3 const & normal,
real distance,
Error & error )
nodiscardpure virtual

Create an implicit plane with infinite extents.

Parameters
[in]normalNormal vector of the plane, in the shape's local frame. Need not be unit length; it is normalized internally.
[in]distanceSigned offset [m] from the origin to the plane, measured along the (normalized) normal. The plane equation is dot(normalize(normal), x) = distance.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create rigid actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
See also
ShapeHandle, ReleaseShape

◆ CreateScene()

virtual Scene * superdex::Context::CreateScene ( std::string_view name)
nodiscardpure virtual

Create a new Scene.

A scene is a collection of actors and constraints, which can be stepped to advance the simulation. Each scene is independent. Actors from one scene cannot affect another scene.

You can create a new scene on any thread, but that scene must only be accessed from one thread at a time. All reads and writes to the scene must be synchronous and well ordered. However, if you have multiple scenes, then it is safe to step them concurrently.

Parameters
[in]nameName of the new scene (for debugging).
Returns
Pointer to the new scene. Call DestroyScene when done with it.
Note
Call on any thread.
See also
DestroyScene

◆ CreateSphereShape()

virtual ShapeHandle superdex::Context::CreateSphereShape ( Real3 const & center,
real radius,
Error & error )
nodiscardpure virtual

Create an implicit sphere shape.

Parameters
[in]centerCenter of the sphere [m], in the shape's local frame.
[in]radiusRadius of the sphere [m]
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create rigid actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
See also
ShapeHandle, ReleaseShape

◆ CreateTetMeshShape()

virtual ShapeHandle superdex::Context::CreateTetMeshShape ( Span< real const > coordinates,
Span< int const > connectivity,
Error & error )
nodiscardpure virtual

Create a tetrahedral mesh shape using in-memory data.

Parameters
[in]coordinatesNode positions [m] (3 values per node)
[in]connectivityNode indices (4 values per tetrahedron).
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
"Vertex" is another word for "node" in this context.
See also
ShapeHandle, ReleaseShape

◆ CreateTriMeshShape()

virtual ShapeHandle superdex::Context::CreateTriMeshShape ( Span< real const > coordinates,
Span< int const > connectivity,
Error & error )
nodiscardpure virtual

Create a triangle mesh shape using in-memory data.

Parameters
[in]coordinatesNode positions [m] (3 values per node).
[in]connectivityNode indices (3 values per triangle).
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
"Vertex" is another word for "node" in this context.
See also
ShapeHandle, ReleaseShape

◆ DestroyAsyncScene()

virtual void superdex::Context::DestroyAsyncScene ( AsyncScene * scene)
pure virtual

Immediately stop and destroy an AsyncScene and all its actors and constraints.

Parameters
[in]ScenePointer to the scene to destroy
Note
No-op if scene is null or unknown to this Context.
Call on any thread, except from code executed by scene.
Any remaining scenes will be cleaned up automatically when the Context is destroyed.
Warning
Do not dereference pointers to the scene, actors, constraints, etc. after this call.
Do not call from code executed by scene, such as queued commands, pre/post-step callbacks, or AsyncStepParams::timeStepCallback. Destroying an AsyncScene is synchronous: if called from code already running on the target scene's simulation task, it can deadlock during destruction.
See also
CreateAsyncScene, IsValidAsyncScene

◆ DestroyScene()

virtual void superdex::Context::DestroyScene ( Scene * scene)
pure virtual

Immediately destroy a scene and all its actors and constraints.

Parameters
[in]ScenePointer to the scene to destroy.
Note
No-op if scene is null or unknown to this Context.
Call on any thread.
Any remaining scenes will be cleaned up automatically when the Context is destroyed.
Warning
Do not dereference pointers to the scene, actors, constraints, etc. after this call.
If scene is owned by an AsyncScene, the call is a no-op (a warning is logged). Call DestroyAsyncScene instead.
See also
CreateScene, DestroyAsyncScene

◆ EnableFileCache()

virtual void superdex::Context::EnableFileCache ( bool enable)
pure virtual

Enable or disable the file cache.

When enabled, shape memory will be preserved even after the ShapeHandle has been released. Subsequent requests for the same file (with the same baked-in scale and transform) will be fast because the data will already be loaded. This can be an important optimization, but beware that it could waste memory if it preserves shapes that are no longer needed.

Parameters
[in]enableTrue to enable, false to disable the feature.
Note
Call on any thread.
Disabling the cache (passing false) immediately releases all currently cached shapes, equivalent to calling ClearFileCache.
See also
IsFileCacheEnabled, ClearFileCache, ClearFileFromCache

◆ EnableLogChannel()

void superdex::Context::EnableLogChannel ( LogChannel channel,
bool enable )
inlinestatic

Enable or disable log messages on the specified channel.

When a channel is disabled, messages on that channel are discarded before reaching the logging callback (see SetLogCallback).

Parameters
[in]channelThe log channel to enable or disable.
[in]enableTrue to enable the channel, false to disable it.
Note
By default, all channels are enabled except for LogChannel::Verbose.
Call on any thread.
See also
IsLogChannelEnabled, SetLogCallback

Definition at line 77 of file mochi_context_inl.h.

◆ EnableLogChannelInternal()

void superdex::Context::EnableLogChannelInternal ( LogChannel channel,
bool enable )
staticprotected

◆ GetArticulatedShapeInfo()

virtual ArticulatedShapeInfo superdex::Context::GetArticulatedShapeInfo ( ShapeHandle shape,
Error & error ) const
nodiscardpure virtual

Get information about an articulated shape.

Parameters
[in]shapeHandle to an articulated shape.
[in,out]errorError status. Check Error::IsOK for success.
Returns
The ArticulatedShapeInfo for the specified shape.
Note
Only supported for articulated shapes. Sets error otherwise.
Can be called on any thread.
The returned information will be invalid after the shape handle has been released.
See also
ArticulatedShapeInfo, Actor::GetArticulatedShapeInfo

◆ GetAssertionFailureCallback()

OnAssertFn superdex::Context::GetAssertionFailureCallback ( )
staticnodiscard

Get the function currently being used to report assertion failures.

Returns
The current assertion failure callback function.
Note
Call on any thread.
See also
SetAssertionFailureCallback

◆ GetDebugServer() [1/2]

virtual DebugServer const & superdex::Context::GetDebugServer ( ) const
pure virtual

Get a const reference to the debug server for this context.

Returns
Const reference to the DebugServer.
See also
DebugServer

◆ GetDebugServer() [2/2]

virtual DebugServer & superdex::Context::GetDebugServer ( )
pure virtual

Get the debug server for this context.

Returns
Reference to the DebugServer, which accepts connections from external debug tools.
See also
DebugServer

◆ GetLogCallback()

LogFn superdex::Context::GetLogCallback ( )
staticnodiscard

Get the function currently being used to output logging.

Returns
The current logging callback function.
Note
Call on any thread.
See also
SetLogCallback

◆ GetNumShapes()

virtual int superdex::Context::GetNumShapes ( ) const
nodiscardpure virtual

Get the number of shape handles that have been created/loaded and have not yet been released.

Returns
The number of active shape handles.
Note
The file cache does not affect this value.
Call on any thread.
See also
IsFileCacheEnabled

◆ GetNumThreads()

virtual int superdex::Context::GetNumThreads ( ) const
nodiscardpure virtual

Return the number of worker threads available to execute asynchronous tasks.

Returns
The configured worker-thread count (see CreateContext), or zero if single-threaded mode is enabled (see SetIsSingleThreaded).
Note
Call on any thread.
See also
CreateContext, IsSingleThreaded

◆ GetScene() [1/2]

virtual Scene const * superdex::Context::GetScene ( SceneHandle handle) const
pure virtual

Get a const pointer to a scene by its handle.

Parameters
[in]handleHandle to the scene.
Returns
Const pointer to the scene, or nullptr if the handle is invalid in this context.
Note
Call on any thread.

◆ GetScene() [2/2]

virtual Scene * superdex::Context::GetScene ( SceneHandle handle)
pure virtual

Get a pointer to a scene by its handle.

Parameters
[in]handleHandle to the scene.
Returns
Pointer to the scene, or nullptr if the handle is invalid in this context.
Note
Call on any thread.

◆ GetShapeAabb()

virtual Aabb superdex::Context::GetShapeAabb ( ShapeHandle shape,
Error & error ) const
nodiscardpure virtual

Get an axis-aligned bounding box (AABB) that contains the shape, in its local coordinate frame.

Parameters
[in]shapeHandle to a valid shape.
[in,out]errorError status. Check Error::IsOK for success.
Returns
The axis-aligned bounding box of the shape in local coordinates.
Note
Call on any thread.
Sets an error for shapes that do not have a bounding volume (e.g., articulated shapes — query their link shapes individually instead).

◆ GetShapeMesh()

virtual MeshDataView superdex::Context::GetShapeMesh ( ShapeHandle shape,
Error & error ) const
nodiscardpure virtual

Get a view of the shape's main mesh data.

For tetrahedral mesh shapes, returns the volume mesh (4 nodes per element). For triangular mesh shapes, returns the surface mesh (3 nodes per element). For polyline shapes, returns the polyline mesh (2 nodes per element). For shapes without a main mesh, including implicit shapes such as spheres and planes, returns an empty view.

Parameters
[in]shapeHandle to a valid shape.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A non-owning view of the shape's main mesh data, or an empty view if the shape has no mesh.
Note
Can be called on any thread.
The returned view will be invalid after the shape handle has been released.
See also
MeshDataView, GetShapeSurfaceMesh, GetShapeVisualMesh, Actor::GetMesh

◆ GetShapeSurfaceMesh()

virtual MeshDataView superdex::Context::GetShapeSurfaceMesh ( ShapeHandle shape,
Error & error ) const
nodiscardpure virtual

Get a view of the shape's surface mesh data.

Returns a triangle mesh (3 nodes per element) representing the shape's surface. The coordinate array contains exactly the surface nodes referenced by the returned connectivity; nodes present in the underlying main mesh but not referenced by any surface triangle are omitted. Connectivity values are indices into this returned coordinate array. For shapes without a surface mesh, returns an empty view.

Parameters
[in]shapeHandle to a valid shape.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A non-owning view of the shape's surface mesh data, or an empty view if the shape has no surface mesh.
Note
For triangular mesh shapes, this may differ from GetShapeMesh if the main mesh contains unreferenced nodes. For tetrahedral mesh shapes, this is the boundary surface of the volume mesh, with non-boundary volume nodes omitted.
Can be called on any thread.
The returned view will be invalid after the shape handle has been released.
See also
MeshDataView, GetShapeMesh, GetShapeVisualMesh, Actor::GetSurfaceMesh

◆ GetShapeVisualMesh()

virtual MeshDataView superdex::Context::GetShapeVisualMesh ( ShapeHandle shape,
Error & error ) const
nodiscardpure virtual

Get a view of the shape's visual mesh data, including skinning data if available.

Returns a triangle mesh (3 nodes per element) intended for visual rendering. Coordinates and connectivity are returned in visual-mesh node-index space, including any visual mesh nodes not referenced by the visual connectivity. The mesh may include linear skinning data for deformation. For shapes without a visual mesh, returns an empty view.

Parameters
[in]shapeHandle to a valid shape.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A non-owning view of the shape's visual mesh data, or an empty view if the shape has no visual mesh.
Note
Can be called on any thread.
The returned view will be invalid after the shape handle has been released.
When linear visual-mesh skinning data is present, skinning indices refer to the node ordering returned by GetShapeMesh, not to the compact surface-node ordering returned by GetShapeSurfaceMesh. Rod visual mesh embeddings are nonlinear and are not exposed through this linear skinning field.
See also
MeshDataView, GetShapeMesh, GetShapeSurfaceMesh, Actor::GetVisualMesh

◆ IsFileCacheEnabled()

virtual bool superdex::Context::IsFileCacheEnabled ( ) const
nodiscardpure virtual

Return true if the file cache feature is enabled.

Returns
True if the file cache is enabled, false otherwise.
Note
Call on any thread.

◆ IsLogChannelEnabled()

bool superdex::Context::IsLogChannelEnabled ( LogChannel channel)
staticnodiscard

Return true if messages on the specified log channel are enabled.

Parameters
[in]channelThe log channel to query.
Returns
True if the channel is enabled, false otherwise.
Note
Call on any thread.
See also
EnableLogChannel

◆ IsSingleThreaded()

virtual bool superdex::Context::IsSingleThreaded ( ) const
nodiscardpure virtual

Return true if running in single-threaded mode.

Returns true when the Context was created with zero worker threads (see CreateContext) or when single-threaded mode has been explicitly enabled via SetIsSingleThreaded.

Returns
True if running in single-threaded mode.
Note
Call on any thread.
See also
SetIsSingleThreaded, CreateContext

◆ IsValidAsyncScene()

virtual bool superdex::Context::IsValidAsyncScene ( AsyncScene const * scene) const
nodiscardpure virtual

Check if an AsyncScene is valid (not destroyed), and belongs to this Context.

Parameters
[in]ScenePointer to the AsyncScene to check
Returns
True if the scene is valid and belongs to this Context.
Note
Call on any thread.
See also
CreateAsyncScene, DestroyAsyncScene

◆ IsValidScene()

virtual bool superdex::Context::IsValidScene ( Scene const * scene) const
nodiscardpure virtual

Check if a scene is valid (not destroyed), and belongs to this Context.

Parameters
[in]ScenePointer to the scene to check.
Returns
True if the scene is valid and belongs to this Context.
Note
Call on any thread.
See also
CreateScene, DestroyScene

◆ LoadShapeFromBytes() [1/8]

ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, where the file has already been loaded into memory.

Supported formats: JSON (.mochi.json) and HDF5 (.mochi.h5), auto-detected from header bytes. To load a surface mesh format (OBJ, PLY, OFF, STL) from memory, use the overload that takes an explicit MeshFileType.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

Definition at line 51 of file mochi_context_inl.h.

◆ LoadShapeFromBytes() [2/8]

virtual ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
MeshFileType format,
Error & error )
nodiscardpure virtual

Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]formatMesh file format hint. When MeshFileType::Legacy, auto-detects between HDF5 and JSON via header bytes. When a surface mesh format (MeshFileType::PLY, MeshFileType::OFF, MeshFileType::STL, MeshFileType::OBJ), dispatches directly to that reader.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

◆ LoadShapeFromBytes() [3/8]

ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
MeshFileType format,
Real3 const & bakeScale,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint, and baking in some scale.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]formatMesh file format hint. When MeshFileType::Legacy, auto-detects between HDF5 and JSON via header bytes. When a surface mesh format (MeshFileType::PLY, MeshFileType::OFF, MeshFileType::STL, MeshFileType::OBJ), dispatches directly to that reader.
[in]bakeScaleScale to bake into the shape or (1, 1, 1) for no change. Negative scale results in mirroring.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected.
Precomputed grid SDF data is preserved only when bakeScale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider later requires SDF data, SuperDex Physics regenerates it from the transformed mesh at runtime, which may be expensive.
If the loaded model has ModelData::elementFrameAxes, bakeScale transforms those axes as normal directions using the inverse-transpose of the scale transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

Definition at line 35 of file mochi_context_inl.h.

◆ LoadShapeFromBytes() [4/8]

virtual ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
MeshFileType format,
Real3 const & bakeScale,
TransformRT const & bakeTransform,
Error & error )
nodiscardpure virtual

Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint, and baking in some scale, rotation, and translation.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]formatMesh file format hint. When MeshFileType::Legacy, auto-detects between HDF5 and JSON via header bytes. When a surface mesh format (MeshFileType::PLY, MeshFileType::OFF, MeshFileType::STL, MeshFileType::OBJ), dispatches directly to that reader.
[in]bakeScaleScale to bake into the shape or (1, 1, 1) for no change. Negative scale results in mirroring.
[in]bakeTransformTransform to bake into the shape, or the identity transform for no change.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected.
Precomputed grid SDF data is preserved only when bakeScale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider later requires SDF data, SuperDex Physics regenerates it from the transformed mesh at runtime, which may be expensive.
If the loaded model has ModelData::elementFrameAxes, bakeScale and bakeTransform transform those axes as normal directions using the inverse-transpose of the scale-rotation transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

◆ LoadShapeFromBytes() [5/8]

ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
MeshFileType format,
TransformRT const & bakeTransform,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, where the file has already been loaded into memory, with an explicit mesh format hint, and baking in rotation and translation.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]formatMesh file format hint. When MeshFileType::Legacy, auto-detects between HDF5 and JSON via header bytes. When a surface mesh format (MeshFileType::PLY, MeshFileType::OFF, MeshFileType::STL, MeshFileType::OBJ), dispatches directly to that reader.
[in]bakeTransformTransform to bake into the shape, or the identity transform for no change.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
If the loaded model has ModelData::elementFrameAxes, bakeTransform transforms those axes as normal directions using the inverse-transpose of the rotation transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

Definition at line 43 of file mochi_context_inl.h.

◆ LoadShapeFromBytes() [6/8]

ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
Real3 const & bakeScale,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, where the file has already been loaded into memory, and baking in some scale.

Supported formats: JSON (.mochi.json) and HDF5 (.mochi.h5), auto-detected from header bytes. To load a surface mesh format (OBJ, PLY, OFF, STL) from memory, use the overload that takes an explicit MeshFileType.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]bakeScaleScale to bake into the shape or (1, 1, 1) for no change. Negative scale results in mirroring.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected.
Precomputed grid SDF data is preserved only when bakeScale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider later requires SDF data, SuperDex Physics regenerates it from the transformed mesh at runtime, which may be expensive.
If the loaded model has ModelData::elementFrameAxes, bakeScale transforms those axes as normal directions using the inverse-transpose of the scale transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

Definition at line 56 of file mochi_context_inl.h.

◆ LoadShapeFromBytes() [7/8]

ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
Real3 const & bakeScale,
TransformRT const & bakeTransform,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, where the file has already been loaded into memory, and baking in some scale, rotation, and translation.

Supported formats: JSON (.mochi.json) and HDF5 (.mochi.h5), auto-detected from header bytes. To load a surface mesh format (OBJ, PLY, OFF, STL) from memory, use the overload that takes an explicit MeshFileType.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]bakeScaleScale to bake into the shape or (1, 1, 1) for no change. Negative scale results in mirroring.
[in]bakeTransformTransform to bake into the shape, or the identity transform for no change.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected.
Precomputed grid SDF data is preserved only when bakeScale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider later requires SDF data, SuperDex Physics regenerates it from the transformed mesh at runtime, which may be expensive.
If the loaded model has ModelData::elementFrameAxes, bakeScale and bakeTransform transform those axes as normal directions using the inverse-transpose of the scale-rotation transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

Definition at line 69 of file mochi_context_inl.h.

◆ LoadShapeFromBytes() [8/8]

ShapeHandle superdex::Context::LoadShapeFromBytes ( Span< char const > fileData,
TransformRT const & bakeTransform,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, where the file has already been loaded into memory, and baking in rotation and translation.

Supported formats: JSON (.mochi.json) and HDF5 (.mochi.h5), auto-detected from header bytes. To load a surface mesh format (OBJ, PLY, OFF, STL) from memory, use the overload that takes an explicit MeshFileType.

Parameters
[in]fileDataFile contents as an in-memory byte array.
[in]bakeTransformTransform to bake into the shape, or the identity transform for no change.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
If the loaded model has ModelData::elementFrameAxes, bakeTransform transforms those axes as normal directions using the inverse-transpose of the rotation transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromFile

Definition at line 61 of file mochi_context_inl.h.

◆ LoadShapeFromFile() [1/4]

virtual ShapeHandle superdex::Context::LoadShapeFromFile ( std::string_view filePath,
Error & error )
nodiscardpure virtual

Load a shape from a file of supported format.

Supported formats: JSON (.mochi.json), HDF5 (.mochi.h5), OBJ (.obj), OFF (.off), PLY (.ply), and STL (.stl).

Parameters
[in]filePathFile path to load (case sensitive on some filesystems).
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromBytes

◆ LoadShapeFromFile() [2/4]

ShapeHandle superdex::Context::LoadShapeFromFile ( std::string_view filePath,
Real3 const & bakeScale,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, and bake in some scale.

Supported formats: JSON (.mochi.json), HDF5 (.mochi.h5), OBJ (.obj), OFF (.off), PLY (.ply), and STL (.stl).

Parameters
[in]filePathFile path to load (case sensitive on some filesystems).
[in]bakeScaleScale to bake into the shape or (1, 1, 1) for no change. Negative scale results in mirroring.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected.
Precomputed grid SDF data is preserved only when bakeScale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider later requires SDF data, SuperDex Physics regenerates it from the transformed mesh at runtime, which may be expensive.
If the loaded model has ModelData::elementFrameAxes, bakeScale transforms those axes as normal directions using the inverse-transpose of the scale transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromBytes

Definition at line 24 of file mochi_context_inl.h.

◆ LoadShapeFromFile() [3/4]

virtual ShapeHandle superdex::Context::LoadShapeFromFile ( std::string_view filePath,
Real3 const & bakeScale,
TransformRT const & bakeTransform,
Error & error )
nodiscardpure virtual

Load a shape from a file of supported format, and bake in some scale, rotation, and translation.

Supported formats: JSON (.mochi.json), HDF5 (.mochi.h5), OBJ (.obj), OFF (.off), PLY (.ply), and STL (.stl).

Parameters
[in]filePathFile path to load (case sensitive on some filesystems).
[in]bakeScaleScale to bake into the shape or (1, 1, 1) for no change. Negative scale results in mirroring.
[in]bakeTransformTransform to bake into the shape, or the identity transform for no change.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
Some shape data cannot bake arbitrary non-uniform scale. Unsupported scale values are rejected.
Precomputed grid SDF data is preserved only when bakeScale is uniform by absolute value. Non-uniform scale by absolute value discards the precomputed SDF. If an SDF collider later requires SDF data, SuperDex Physics regenerates it from the transformed mesh at runtime, which may be expensive.
If the loaded model has ModelData::elementFrameAxes, bakeScale and bakeTransform transform those axes as normal directions using the inverse-transpose of the scale-rotation transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromBytes

◆ LoadShapeFromFile() [4/4]

ShapeHandle superdex::Context::LoadShapeFromFile ( std::string_view filePath,
TransformRT const & bakeTransform,
Error & error )
inlinenodiscard

Load a shape from a file of supported format, and bake in rotation and translation.

Supported formats: JSON (.mochi.json), HDF5 (.mochi.h5), OBJ (.obj), OFF (.off), PLY (.ply), and STL (.stl).

Parameters
[in]filePathFile path to load (case sensitive on some filesystems).
[in]bakeTransformTransform to bake into the shape, or the identity transform for no change.
[in,out]errorError status. Check Error::IsOK for success.
Returns
A ShapeHandle that can be used to create actors.
Note
The shape remains in memory while referenced by any handle or actor. In the C API, you must release the shape explicitly by calling Context::ReleaseShape. In C++ and Python, this is optional, since ShapeHandle cleanup is automatic.
If the loaded model has ModelData::elementFrameAxes, bakeTransform transforms those axes as normal directions using the inverse-transpose of the rotation transform, then normalize them.
Call on any thread.
See also
ShapeHandle, ReleaseShape, LoadShapeFromBytes

Definition at line 28 of file mochi_context_inl.h.

◆ ReleaseShape()

virtual void superdex::Context::ReleaseShape ( ShapeHandle shape)
pure virtual

Release a shape handle.

In the C API, this must be called for every ShapeHandle when you are done with it. In C++ and Python, this is optional because ShapeHandle releases its reference automatically when destroyed. The shape memory is freed when it is no longer referenced by any handle, actor, or file cache entry.

Parameters
[in]shapeHandle to the shape to release.
Note
Call on any thread.
If the shape handle is invalid or already released, then it will be ignored.
See also
ShapeHandle, IsFileCacheEnabled

◆ SetAssertionFailureCallback()

void superdex::Context::SetAssertionFailureCallback ( OnAssertFn callback)
inlinestatic

Optionally provide a callback function to customize the way in which assertion failures are reported.

An assertion failure indicates a serious problem with the internal code or runtime environment. When this occurs, the default function will log a block of error text, then stop at a breakpoint (fatal if no debugger is attached).

Parameters
[in]callbackFunction to call in the event of an assertion failure, or nullptr to restore the default function.
Note
Call on any thread.
Warning
Your callback function may be called on any thread.
See also
GetAssertionFailureCallback

Definition at line 95 of file mochi_context_inl.h.

◆ SetIsSingleThreaded()

virtual void superdex::Context::SetIsSingleThreaded ( bool isSingleThreaded)
pure virtual

Enable or disable single-threaded mode.

In single-threaded mode, each new task will be executed on the calling thread, even if other threads are available. This may hurt performance, but it is useful for debugging and batch simulation.

Enabling single-threaded mode does not, however, terminate tasks that are already running asynchronously. Such tasks will run to completion. For example, if you have an AsyncScene, it will continue to step asynchronously, but each step will do its work on that one thread.

Parameters
[in]isSingleThreadedTrue to enable single-threaded mode. False to disable.
Note
Call on any thread.
See also
IsSingleThreaded

◆ SetLogCallback()

void superdex::Context::SetLogCallback ( LogFn callback)
inlinestatic

Optionally provide a callback function to redirect SuperDex Physics logging.

The default function outputs to stdout and to the debugger (if attached).

Parameters
[in]callbackFunction to handle logging, or nullptr to restore the default logging function.
Note
Call on any thread.
Warning
Your callback function may be called on any thread.
See also
GetLogCallback

Definition at line 86 of file mochi_context_inl.h.

◆ SetLogCallbackInternal()

void superdex::Context::SetLogCallbackInternal ( LogFn callback)
staticprotected

◆ UnbindThisThread()

virtual void superdex::Context::UnbindThisThread ( )
pure virtual

Unbind the calling thread from this Context.

Each call to BindThisThread must be matched by a call to UnbindThisThread before the thread exits. The binding is reference-counted, so the thread is only unbound when the number of unbind calls matches the number of bind calls.

Note
Call on any thread.
See also
BindThisThread

The documentation for this class was generated from the following files: