Tissue Forge C 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfCBody.h File Reference
#include <tf_port_c.h>
#include <tfC_io.h>
Include dependency graph for tfCBody.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tfVertexSolverBodyTypeSpec
 Body type definition in Tissue Forge C. More...
 
struct  tfVertexSolverBodyHandleHandle
 Handle to a models::vertex::BodyHandle instance. More...
 
struct  tfVertexSolverBodyTypeHandle
 Handle to a models::vertex::BodyType instance. More...
 

Functions

struct tfVertexSolverBodyTypeSpec tfVertexSolverBodyTypeSpec_init ()
 Get a default definition.
 
HRESULT tfVertexSolverBodyHandle_init (struct tfVertexSolverBodyHandleHandle *handle, int id)
 Initialize an instance.
 
HRESULT tfVertexSolverBodyHandle_fromString (struct tfVertexSolverBodyHandleHandle *handle, const char *s)
 Create an instance from a JSON string representation.
 
HRESULT tfVertexSolverBodyHandle_destroy (struct tfVertexSolverBodyHandleHandle *handle)
 Destroy an instance.
 
HRESULT tfVertexSolverBodyHandle_getId (struct tfVertexSolverBodyHandleHandle *handle, int *objId)
 Get the object id.
 
HRESULT tfVertexSolverBodyHandle_definedByVertex (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, bool *result)
 Test whether a body is defined by a vertex.
 
HRESULT tfVertexSolverBodyHandle_definedBySurface (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *s, bool *result)
 Test whether a body is defined by a surface.
 
HRESULT tfVertexSolverBodyHandle_objType (struct tfVertexSolverBodyHandleHandle *handle, unsigned int *label)
 Get the mesh object type.
 
HRESULT tfVertexSolverBodyHandle_destroyBody (struct tfVertexSolverBodyHandleHandle *handle)
 Destroy the body.
 
HRESULT tfVertexSolverBodyHandle_destroyBodies (struct tfVertexSolverBodyHandleHandle **handles, unsigned int numObjs)
 Destroy instances.
 
HRESULT tfVertexSolverBodyHandle_destroyBodyC (struct tfVertexSolverBodyHandleHandle *handle)
 Destroy the body.
 
HRESULT tfVertexSolverBodyHandle_validate (struct tfVertexSolverBodyHandleHandle *handle, bool *result)
 Validate the body.
 
HRESULT tfVertexSolverBodyHandle_positionChanged (struct tfVertexSolverBodyHandleHandle *handle)
 Update internal data due to a change in position.
 
HRESULT tfVertexSolverBodyHandle_str (struct tfVertexSolverBodyHandleHandle *handle, char **str, unsigned int *numChars)
 Get a summary string.
 
HRESULT tfVertexSolverBodyHandle_toString (struct tfVertexSolverBodyHandleHandle *handle, char **str, unsigned int *numChars)
 Get a JSON string representation.
 
HRESULT tfVertexSolverBodyHandle_add (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *s)
 Add a surface.
 
HRESULT tfVertexSolverBodyHandle_remove (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *s)
 Remove a surface.
 
HRESULT tfVertexSolverBodyHandle_replace (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *toInsert, struct tfVertexSolverSurfaceHandleHandle *toRemove)
 Replace a surface a surface.
 
HRESULT tfVertexSolverBodyHandle_getType (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyTypeHandle *btype)
 Get the body type.
 
HRESULT tfVertexSolverBodyHandle_become (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyTypeHandle *btype)
 Become a different type.
 
HRESULT tfVertexSolverBodyHandle_getSurfaces (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle **objs, int *numObjs)
 Get the surfaces that define the body.
 
HRESULT tfVertexSolverBodyHandle_getVertices (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverVertexHandleHandle **objs, int *numObjs)
 Get the vertices that define the body.
 
HRESULT tfVertexSolverBodyHandle_findVertex (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *dir, struct tfVertexSolverVertexHandleHandle *v)
 Find a vertex that defines this body.
 
HRESULT tfVertexSolverBodyHandle_findSurface (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *dir, struct tfVertexSolverSurfaceHandleHandle *s)
 Find a surface that defines this body.
 
HRESULT tfVertexSolverBodyHandle_connectedBodies (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyHandleHandle **objs, int *numObjs)
 Get the connected bodies.
 
HRESULT tfVertexSolverBodyHandle_adjacentBodies (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyHandleHandle **objs, int *numObjs)
 Get the adjacent bodies.
 
HRESULT tfVertexSolverBodyHandle_neighborSurfaces (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverSurfaceHandleHandle *s, struct tfVertexSolverSurfaceHandleHandle **objs, int *numObjs)
 Get the neighboring surfaces of a surface on this body.
 
HRESULT tfVertexSolverBodyHandle_getDensity (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *result)
 Get the mass density.
 
HRESULT tfVertexSolverBodyHandle_setDensity (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t density)
 Set the mass density.
 
HRESULT tfVertexSolverBodyHandle_getCentroid (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t **result)
 Get the centroid.
 
HRESULT tfVertexSolverBodyHandle_getVelocity (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t **result)
 Get the velocity, calculated as the velocity of the centroid.
 
HRESULT tfVertexSolverBodyHandle_getArea (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *result)
 Get the surface area.
 
HRESULT tfVertexSolverBodyHandle_getVolume (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *result)
 Get the volume.
 
HRESULT tfVertexSolverBodyHandle_getMass (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *result)
 Get the mass.
 
HRESULT tfVertexSolverBodyHandle_getVertexArea (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, tfFloatP_t *result)
 Get the surface area contribution of a vertex to this body.
 
HRESULT tfVertexSolverBodyHandle_getVertexVolume (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, tfFloatP_t *result)
 Get the volume contribution of a vertex to this body.
 
HRESULT tfVertexSolverBodyHandle_getVertexMass (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverVertexHandleHandle *v, tfFloatP_t *result)
 Get the mass contribution of a vertex to this body.
 
HRESULT tfVertexSolverBodyHandle_findInterface (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *b, struct tfVertexSolverSurfaceHandleHandle **objs, int *numObjs)
 Get the surfaces that define the interface between this body and another body.
 
HRESULT tfVertexSolverBodyHandle_contactArea (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *other, tfFloatP_t *result)
 Get the contacting surface area of this body with another body.
 
HRESULT tfVertexSolverBodyHandle_sharedVertices (struct tfVertexSolverBodyHandleHandle *handle, struct tfVertexSolverBodyHandleHandle *other, struct tfVertexSolverVertexHandleHandle **objs, int *numObjs)
 Get the vertices that define both this body and another body.
 
HRESULT tfVertexSolverBodyHandle_isOutside (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *pos, bool *result)
 Test whether a point is outside. Test is performed using the nearest surface.
 
HRESULT tfVertexSolverBodyHandle_split (struct tfVertexSolverBodyHandleHandle *handle, tfFloatP_t *cp_pos, tfFloatP_t *cp_norm, struct tfVertexSolverSurfaceTypeHandle *stype, struct tfVertexSolverBodyHandleHandle *newObj)
 Split into two bodies. The split is defined by a cut plane.
 
HRESULT tfVertexSolverBodyType_init (struct tfVertexSolverBodyTypeHandle *handle)
 Initialize a new instance.
 
HRESULT tfVertexSolverBodyType_initD (struct tfVertexSolverBodyTypeHandle *handle, struct tfVertexSolverBodyTypeSpec bdef)
 Initialize an instance from a definition.
 
HRESULT tfVertexSolverBodyType_fromString (struct tfVertexSolverBodyTypeHandle *handle, const char *s)
 Create an instance from a JSON string representation.
 
HRESULT tfVertexSolverBodyType_objType (struct tfVertexSolverBodyTypeHandle *handle, unsigned int *label)
 Get the mesh object type.
 
HRESULT tfVertexSolverBodyType_str (struct tfVertexSolverBodyTypeHandle *handle, char **str, unsigned int *numChars)
 Get a summary string.
 
HRESULT tfVertexSolverBodyType_toString (struct tfVertexSolverBodyTypeHandle *handle, char **str, unsigned int *numChars)
 Get a JSON string representation.
 
HRESULT tfVertexSolverBodyType_registerType (struct tfVertexSolverBodyTypeHandle *handle)
 Registers a type with the engine.
 
HRESULT tfVertexSolverBodyType_isRegistered (struct tfVertexSolverBodyTypeHandle *handle, bool *result)
 Tests whether this type is registered.
 
HRESULT tfVertexSolverBodyType_getInstances (struct tfVertexSolverBodyTypeHandle *handle, struct tfVertexSolverBodyHandleHandle **objs, int *numObjs)
 Get a list of instances that belong to this type.
 
HRESULT tfVertexSolverBodyType_getInstanceIds (struct tfVertexSolverBodyTypeHandle *handle, int **ids, int *numObjs)
 Get a list of instances ids that belong to this type.
 
HRESULT tfVertexSolverBodyType_getName (struct tfVertexSolverBodyTypeHandle *handle, char **str, unsigned int *numChars)
 Name of this body type.
 
HRESULT tfVertexSolverBodyType_setName (struct tfVertexSolverBodyTypeHandle *handle, const char *name)
 Set the name of this body type.
 
HRESULT tfVertexSolverBodyType_getDensity (struct tfVertexSolverBodyTypeHandle *handle, tfFloatP_t *result)
 Get the mass density.
 
HRESULT tfVertexSolverBodyType_setDensity (struct tfVertexSolverBodyTypeHandle *handle, tfFloatP_t density)
 Set the mass density.
 
HRESULT tfVertexSolverBodyType_createBodyS (struct tfVertexSolverBodyTypeHandle *handle, struct tfVertexSolverSurfaceHandleHandle **surfaces, unsigned int numSurfaces, struct tfVertexSolverBodyHandleHandle *newObj)
 Construct a body of this type from a set of surfaces.
 
HRESULT tfVertexSolverBodyType_createBodyIO (struct tfVertexSolverBodyTypeHandle *handle, struct tfIoThreeDFMeshDataHandle *ioMesh, struct tfVertexSolverSurfaceTypeHandle *stype, struct tfVertexSolverBodyHandleHandle *newObj)
 Construct a body of this type from a mesh.
 
HRESULT tfVertexSolverBodyType_extend (struct tfVertexSolverBodyTypeHandle *handle, struct tfVertexSolverSurfaceHandleHandle *base, tfFloatP_t *pos, struct tfVertexSolverBodyHandleHandle *newObj)
 Create a body from a surface in the mesh and a position.
 
HRESULT tfVertexSolverBodyType_extrude (struct tfVertexSolverBodyTypeHandle *handle, struct tfVertexSolverSurfaceHandleHandle *base, tfFloatP_t normLen, struct tfVertexSolverBodyHandleHandle *newObj)
 Create a body from a surface in a mesh by extruding along the outward-facing normal of the surface.
 
HRESULT tfVertexSolverCreateBodyBySurfaces (struct tfVertexSolverSurfaceHandleHandle **surfaces, unsigned int numSurfaces, struct tfVertexSolverBodyHandleHandle *newObj)
 Construct a body from a set of surfaces.
 
HRESULT tfVertexSolverCreateBodyByIOData (struct tfIoThreeDFMeshDataHandle *ioMesh, struct tfVertexSolverBodyHandleHandle *newObj)
 Construct a body from a mesh.
 
HRESULT tfVertexSolverFindBodyTypeFromName (const char *name, struct tfVertexSolverBodyTypeHandle *btype)
 Get a registered type by name.
 
HRESULT tfVertexSolverBindBodyTypeAdhesion (struct tfVertexSolverBodyTypeHandle **btypes, struct tfVertexSolverBodyTypeSpec *bdefs, unsigned int numTypes)
 Bind adhesion for all types with matching specification.
 

Function Documentation

◆ tfVertexSolverBindBodyTypeAdhesion()

HRESULT tfVertexSolverBindBodyTypeAdhesion ( struct tfVertexSolverBodyTypeHandle ** btypes,
struct tfVertexSolverBodyTypeSpec * bdefs,
unsigned int numTypes )

Bind adhesion for all types with matching specification.

Parameters
btypesbody types to bind
bdefsbody type definitions
numTypesnumber of types

◆ tfVertexSolverBodyHandle_add()

HRESULT tfVertexSolverBodyHandle_add ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * s )

Add a surface.

Parameters
handlepopulated handle
ssurface to add

◆ tfVertexSolverBodyHandle_adjacentBodies()

HRESULT tfVertexSolverBodyHandle_adjacentBodies ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyHandleHandle ** objs,
int * numObjs )

Get the adjacent bodies.

A body is adjacent if it shares a surface.

Parameters
handlepopulated handle
objsadjacent bodies
numObjsnumber of adjacent bodies

◆ tfVertexSolverBodyHandle_become()

HRESULT tfVertexSolverBodyHandle_become ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyTypeHandle * btype )

Become a different type.

Parameters
handlepopulated handle
btypetype to become

◆ tfVertexSolverBodyHandle_connectedBodies()

HRESULT tfVertexSolverBodyHandle_connectedBodies ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyHandleHandle ** objs,
int * numObjs )

Get the connected bodies.

A body is connected if it shares a surface.

Parameters
handlepopulated handle
objsconnected bodies
numObjsnumber of connected bodies

◆ tfVertexSolverBodyHandle_contactArea()

HRESULT tfVertexSolverBodyHandle_contactArea ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyHandleHandle * other,
tfFloatP_t * result )

Get the contacting surface area of this body with another body.

Parameters
handlepopulated handle
otheranother body
resultcontacting surface area

◆ tfVertexSolverBodyHandle_definedBySurface()

HRESULT tfVertexSolverBodyHandle_definedBySurface ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * s,
bool * result )

Test whether a body is defined by a surface.

Parameters
handlepopulated handle
ssurface
resultresult of the test

◆ tfVertexSolverBodyHandle_definedByVertex()

HRESULT tfVertexSolverBodyHandle_definedByVertex ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverVertexHandleHandle * v,
bool * result )

Test whether a body is defined by a vertex.

Parameters
handlepopulated handle
vvertex
resultresult of the test

◆ tfVertexSolverBodyHandle_destroy()

HRESULT tfVertexSolverBodyHandle_destroy ( struct tfVertexSolverBodyHandleHandle * handle)

Destroy an instance.

Parameters
handlepopulated handle

◆ tfVertexSolverBodyHandle_destroyBodies()

HRESULT tfVertexSolverBodyHandle_destroyBodies ( struct tfVertexSolverBodyHandleHandle ** handles,
unsigned int numObjs )

Destroy instances.

Parameters
handlespopulated handles
numObjsnumber of objects to destroy

◆ tfVertexSolverBodyHandle_destroyBody()

HRESULT tfVertexSolverBodyHandle_destroyBody ( struct tfVertexSolverBodyHandleHandle * handle)

Destroy the body.

Parameters
handlepopulated handle

◆ tfVertexSolverBodyHandle_destroyBodyC()

HRESULT tfVertexSolverBodyHandle_destroyBodyC ( struct tfVertexSolverBodyHandleHandle * handle)

Destroy the body.

Any resulting surfaces without a body are also destroyed.

Parameters
handlepopulated handle

◆ tfVertexSolverBodyHandle_findInterface()

HRESULT tfVertexSolverBodyHandle_findInterface ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyHandleHandle * b,
struct tfVertexSolverSurfaceHandleHandle ** objs,
int * numObjs )

Get the surfaces that define the interface between this body and another body.

Parameters
handlepopulated handle
ba body
objsinterface surfaces
numObjsnumber of interface surfaces

◆ tfVertexSolverBodyHandle_findSurface()

HRESULT tfVertexSolverBodyHandle_findSurface ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * dir,
struct tfVertexSolverSurfaceHandleHandle * s )

Find a surface that defines this body.

Parameters
handlepopulated handle
dirdirection to look with respect to the centroid
ssurface

◆ tfVertexSolverBodyHandle_findVertex()

HRESULT tfVertexSolverBodyHandle_findVertex ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * dir,
struct tfVertexSolverVertexHandleHandle * v )

Find a vertex that defines this body.

Parameters
handlepopulated handle
dirdirection to look with respect to the centroid
vvertex

◆ tfVertexSolverBodyHandle_fromString()

HRESULT tfVertexSolverBodyHandle_fromString ( struct tfVertexSolverBodyHandleHandle * handle,
const char * s )

Create an instance from a JSON string representation.

Parameters
handlehandle to populate
sJSON string

◆ tfVertexSolverBodyHandle_getArea()

HRESULT tfVertexSolverBodyHandle_getArea ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * result )

Get the surface area.

Parameters
handlepopulated handle
resultsurface area

◆ tfVertexSolverBodyHandle_getCentroid()

HRESULT tfVertexSolverBodyHandle_getCentroid ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t ** result )

Get the centroid.

Parameters
handlepopulated handle
resultcentroid

◆ tfVertexSolverBodyHandle_getDensity()

HRESULT tfVertexSolverBodyHandle_getDensity ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * result )

Get the mass density.

Parameters
handlepopulated handle
resultmass density

◆ tfVertexSolverBodyHandle_getId()

HRESULT tfVertexSolverBodyHandle_getId ( struct tfVertexSolverBodyHandleHandle * handle,
int * objId )

Get the object id.

Parameters
handlepopulated handle
objIdobject id

◆ tfVertexSolverBodyHandle_getMass()

HRESULT tfVertexSolverBodyHandle_getMass ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * result )

Get the mass.

Parameters
handlepopulated handle
resultmass

◆ tfVertexSolverBodyHandle_getSurfaces()

HRESULT tfVertexSolverBodyHandle_getSurfaces ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverSurfaceHandleHandle ** objs,
int * numObjs )

Get the surfaces that define the body.

Parameters
handlepopulated handle
objssurfaces
numObjsnumber of surface

◆ tfVertexSolverBodyHandle_getType()

HRESULT tfVertexSolverBodyHandle_getType ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyTypeHandle * btype )

Get the body type.

Parameters
handlepopulated handle
btypebody type

◆ tfVertexSolverBodyHandle_getVelocity()

HRESULT tfVertexSolverBodyHandle_getVelocity ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t ** result )

Get the velocity, calculated as the velocity of the centroid.

Parameters
handlepopulated handle
resultvelocity

◆ tfVertexSolverBodyHandle_getVertexArea()

HRESULT tfVertexSolverBodyHandle_getVertexArea ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverVertexHandleHandle * v,
tfFloatP_t * result )

Get the surface area contribution of a vertex to this body.

Parameters
handlepopulated handle
va vertex
resultsurface area contribution

◆ tfVertexSolverBodyHandle_getVertexMass()

HRESULT tfVertexSolverBodyHandle_getVertexMass ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverVertexHandleHandle * v,
tfFloatP_t * result )

Get the mass contribution of a vertex to this body.

Parameters
handlepopulated handle
va vertex
resultmass contribution

◆ tfVertexSolverBodyHandle_getVertexVolume()

HRESULT tfVertexSolverBodyHandle_getVertexVolume ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverVertexHandleHandle * v,
tfFloatP_t * result )

Get the volume contribution of a vertex to this body.

Parameters
handlepopulated handle
va vertex
resultvolume contribution

◆ tfVertexSolverBodyHandle_getVertices()

HRESULT tfVertexSolverBodyHandle_getVertices ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverVertexHandleHandle ** objs,
int * numObjs )

Get the vertices that define the body.

Parameters
handlepopulated handle
objsvertices
numObjsnumber of vertices

◆ tfVertexSolverBodyHandle_getVolume()

HRESULT tfVertexSolverBodyHandle_getVolume ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * result )

Get the volume.

Parameters
handlepopulated handle
resultvolume

◆ tfVertexSolverBodyHandle_init()

HRESULT tfVertexSolverBodyHandle_init ( struct tfVertexSolverBodyHandleHandle * handle,
int id )

Initialize an instance.

Parameters
handlehandle to populate
idobject id

◆ tfVertexSolverBodyHandle_isOutside()

HRESULT tfVertexSolverBodyHandle_isOutside ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * pos,
bool * result )

Test whether a point is outside. Test is performed using the nearest surface.

Parameters
handlepopulated handle
posposition
resultresult of the test

◆ tfVertexSolverBodyHandle_neighborSurfaces()

HRESULT tfVertexSolverBodyHandle_neighborSurfaces ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * s,
struct tfVertexSolverSurfaceHandleHandle ** objs,
int * numObjs )

Get the neighboring surfaces of a surface on this body.

Two surfaces are a neighbor on this body if they define the body and share a vertex

Parameters
handlepopulated handle
sa surface
objsneighboring surfaces
numObjsnumber of neighboring surfaces

◆ tfVertexSolverBodyHandle_objType()

HRESULT tfVertexSolverBodyHandle_objType ( struct tfVertexSolverBodyHandleHandle * handle,
unsigned int * label )

Get the mesh object type.

Parameters
handlepopulated handle
labelobject type label

◆ tfVertexSolverBodyHandle_positionChanged()

HRESULT tfVertexSolverBodyHandle_positionChanged ( struct tfVertexSolverBodyHandleHandle * handle)

Update internal data due to a change in position.

Parameters
handlepopulated handle

◆ tfVertexSolverBodyHandle_remove()

HRESULT tfVertexSolverBodyHandle_remove ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * s )

Remove a surface.

Parameters
handlepopulated handle
ssurface to remove

◆ tfVertexSolverBodyHandle_replace()

HRESULT tfVertexSolverBodyHandle_replace ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * toInsert,
struct tfVertexSolverSurfaceHandleHandle * toRemove )

Replace a surface a surface.

Parameters
handlepopulated handle
toInsertsurface to insert
toRemovesurface to remove

◆ tfVertexSolverBodyHandle_setDensity()

HRESULT tfVertexSolverBodyHandle_setDensity ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t density )

Set the mass density.

Parameters
handlepopulated handle
densitymass density

◆ tfVertexSolverBodyHandle_sharedVertices()

HRESULT tfVertexSolverBodyHandle_sharedVertices ( struct tfVertexSolverBodyHandleHandle * handle,
struct tfVertexSolverBodyHandleHandle * other,
struct tfVertexSolverVertexHandleHandle ** objs,
int * numObjs )

Get the vertices that define both this body and another body.

Parameters
handlepopulated handle
othera body
objsshared vertices
numObjsnumber of shared vertices

◆ tfVertexSolverBodyHandle_split()

HRESULT tfVertexSolverBodyHandle_split ( struct tfVertexSolverBodyHandleHandle * handle,
tfFloatP_t * cp_pos,
tfFloatP_t * cp_norm,
struct tfVertexSolverSurfaceTypeHandle * stype,
struct tfVertexSolverBodyHandleHandle * newObj )

Split into two bodies. The split is defined by a cut plane.

Parameters
handlepopulated handle
cp_posposition on the cut plane
cp_normcut plane normal
stypetype of newly created surface. taken from connected surfaces if specified as 0
newObjnewly created object

◆ tfVertexSolverBodyHandle_str()

HRESULT tfVertexSolverBodyHandle_str ( struct tfVertexSolverBodyHandleHandle * handle,
char ** str,
unsigned int * numChars )

Get a summary string.

Parameters
handlepopulated handle
strsummary string
numCharsnumber of chars

◆ tfVertexSolverBodyHandle_toString()

HRESULT tfVertexSolverBodyHandle_toString ( struct tfVertexSolverBodyHandleHandle * handle,
char ** str,
unsigned int * numChars )

Get a JSON string representation.

Parameters
handlepopulated handle
strJSON string
numCharsnumber of chars

◆ tfVertexSolverBodyHandle_validate()

HRESULT tfVertexSolverBodyHandle_validate ( struct tfVertexSolverBodyHandleHandle * handle,
bool * result )

Validate the body.

Parameters
handlepopulated handle
resultresult of validation

◆ tfVertexSolverBodyType_createBodyIO()

HRESULT tfVertexSolverBodyType_createBodyIO ( struct tfVertexSolverBodyTypeHandle * handle,
struct tfIoThreeDFMeshDataHandle * ioMesh,
struct tfVertexSolverSurfaceTypeHandle * stype,
struct tfVertexSolverBodyHandleHandle * newObj )

Construct a body of this type from a mesh.

Parameters
handlepopulated handle
ioMeshmesh
stypetype of newly created surfaces
newObjnewly created object

◆ tfVertexSolverBodyType_createBodyS()

HRESULT tfVertexSolverBodyType_createBodyS ( struct tfVertexSolverBodyTypeHandle * handle,
struct tfVertexSolverSurfaceHandleHandle ** surfaces,
unsigned int numSurfaces,
struct tfVertexSolverBodyHandleHandle * newObj )

Construct a body of this type from a set of surfaces.

Parameters
handlepopulated handle
surfacesset of surfaces
numSurfacesnumber of surfaces
newObjnewly created object

◆ tfVertexSolverBodyType_extend()

HRESULT tfVertexSolverBodyType_extend ( struct tfVertexSolverBodyTypeHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * base,
tfFloatP_t * pos,
struct tfVertexSolverBodyHandleHandle * newObj )

Create a body from a surface in the mesh and a position.

Parameters
handlepopulated handle
basebase surface
posposition
newObjnewly created object

◆ tfVertexSolverBodyType_extrude()

HRESULT tfVertexSolverBodyType_extrude ( struct tfVertexSolverBodyTypeHandle * handle,
struct tfVertexSolverSurfaceHandleHandle * base,
tfFloatP_t normLen,
struct tfVertexSolverBodyHandleHandle * newObj )

Create a body from a surface in a mesh by extruding along the outward-facing normal of the surface.

Parameters
handlepopulated handle
basebase surface
normLenlength along normal direction by which to extrude
newObjnewly created object

◆ tfVertexSolverBodyType_fromString()

HRESULT tfVertexSolverBodyType_fromString ( struct tfVertexSolverBodyTypeHandle * handle,
const char * s )

Create an instance from a JSON string representation.

Parameters
handlehandle to populate
sJSON string

◆ tfVertexSolverBodyType_getDensity()

HRESULT tfVertexSolverBodyType_getDensity ( struct tfVertexSolverBodyTypeHandle * handle,
tfFloatP_t * result )

Get the mass density.

Parameters
handlepopulated handle
resultmass density

◆ tfVertexSolverBodyType_getInstanceIds()

HRESULT tfVertexSolverBodyType_getInstanceIds ( struct tfVertexSolverBodyTypeHandle * handle,
int ** ids,
int * numObjs )

Get a list of instances ids that belong to this type.

Parameters
handlepopulated handle
idslist of instances ids
numObjsnumber of instances ids

◆ tfVertexSolverBodyType_getInstances()

HRESULT tfVertexSolverBodyType_getInstances ( struct tfVertexSolverBodyTypeHandle * handle,
struct tfVertexSolverBodyHandleHandle ** objs,
int * numObjs )

Get a list of instances that belong to this type.

Parameters
handlepopulated handle
objslist of instances
numObjsnumber of instances

◆ tfVertexSolverBodyType_getName()

HRESULT tfVertexSolverBodyType_getName ( struct tfVertexSolverBodyTypeHandle * handle,
char ** str,
unsigned int * numChars )

Name of this body type.

Parameters
handlepopulated handle
strname
numCharsnumber of chars

◆ tfVertexSolverBodyType_init()

HRESULT tfVertexSolverBodyType_init ( struct tfVertexSolverBodyTypeHandle * handle)

Initialize a new instance.

Parameters
handlehandle to populate

◆ tfVertexSolverBodyType_initD()

HRESULT tfVertexSolverBodyType_initD ( struct tfVertexSolverBodyTypeHandle * handle,
struct tfVertexSolverBodyTypeSpec bdef )

Initialize an instance from a definition.

Parameters
handlehandle to populate
bdeftype definition

◆ tfVertexSolverBodyType_isRegistered()

HRESULT tfVertexSolverBodyType_isRegistered ( struct tfVertexSolverBodyTypeHandle * handle,
bool * result )

Tests whether this type is registered.

Parameters
resultresult of the test

◆ tfVertexSolverBodyType_objType()

HRESULT tfVertexSolverBodyType_objType ( struct tfVertexSolverBodyTypeHandle * handle,
unsigned int * label )

Get the mesh object type.

Parameters
handlepopulated handle
labelobject type label

◆ tfVertexSolverBodyType_registerType()

HRESULT tfVertexSolverBodyType_registerType ( struct tfVertexSolverBodyTypeHandle * handle)

Registers a type with the engine.

Note that this occurs automatically, unless noReg==true in constructor.

Parameters
handlepopulated handle

◆ tfVertexSolverBodyType_setDensity()

HRESULT tfVertexSolverBodyType_setDensity ( struct tfVertexSolverBodyTypeHandle * handle,
tfFloatP_t density )

Set the mass density.

Parameters
handlepopulated handle
densitymass density

◆ tfVertexSolverBodyType_setName()

HRESULT tfVertexSolverBodyType_setName ( struct tfVertexSolverBodyTypeHandle * handle,
const char * name )

Set the name of this body type.

Parameters
handlepopulated handle
namename

◆ tfVertexSolverBodyType_str()

HRESULT tfVertexSolverBodyType_str ( struct tfVertexSolverBodyTypeHandle * handle,
char ** str,
unsigned int * numChars )

Get a summary string.

Parameters
handlepopulated handle
strsummary string
numCharsnumber of chars

◆ tfVertexSolverBodyType_toString()

HRESULT tfVertexSolverBodyType_toString ( struct tfVertexSolverBodyTypeHandle * handle,
char ** str,
unsigned int * numChars )

Get a JSON string representation.

Parameters
handlepopulated handle
strJSON string
numCharsnumber of chars

◆ tfVertexSolverCreateBodyByIOData()

HRESULT tfVertexSolverCreateBodyByIOData ( struct tfIoThreeDFMeshDataHandle * ioMesh,
struct tfVertexSolverBodyHandleHandle * newObj )

Construct a body from a mesh.

Parameters
ioMeshmesh
newObjnewly created object

◆ tfVertexSolverCreateBodyBySurfaces()

HRESULT tfVertexSolverCreateBodyBySurfaces ( struct tfVertexSolverSurfaceHandleHandle ** surfaces,
unsigned int numSurfaces,
struct tfVertexSolverBodyHandleHandle * newObj )

Construct a body from a set of surfaces.

Parameters
surfacesset of surfaces
numSurfacesnumber of surfaces
newObjnewly created object

◆ tfVertexSolverFindBodyTypeFromName()

HRESULT tfVertexSolverFindBodyTypeFromName ( const char * name,
struct tfVertexSolverBodyTypeHandle * btype )

Get a registered type by name.

Parameters
nametype name
btypetype