Vortex Studio SDK Classes Documentation
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Vx::VxCollisionGeometry Class Reference

Defines a volume and shape in space that the Dynamics can use to compute collision for a rigid body. More...

#include <Vx/VxCollisionGeometry.h>

+ Inheritance diagram for Vx::VxCollisionGeometry:

Classes

class  FluidInteractionData
 This class encapsulates all fluid interaction data. More...
 

Public Types

typedef int CallbackHandle
 Callback Handle.
 
enum  TemporaryDisabledStatus { kNotTemporaryDisabled = 0, kTemporaryDisabledShortTerm, kTemporaryDisabledLongTerm }
 Allows the user to tune different levels of the disabled status for collision geometries. More...
 

Public Member Functions

 VxCollisionGeometry (VxGeometry *inGeometry)
 Default constructor.
 
 VxCollisionGeometry (VxGeometry *geometry, VxMaterial *material)
 Constructor with geometry and material. More...
 
 VxCollisionGeometry (VxGeometry *geometry, VxMaterial *material, const VxTransform &transform)
 Constructor with geometry, material and transform. More...
 
virtual ~VxCollisionGeometry ()
 Destructor. More...
 
void addFilterBox (const VxOBB &filterBox)
 Adds a filter box to this collision geometry. More...
 
bool addFluidInteractionForce (const VxFluidState *fluidState)
 Adds the fluid interaction force corresponding to a fluid level and density as specified in the input fluidState parameter.
 
bool assignResponseID (ResponseType id)
 Assigns the given response ID to this collision geometry. More...
 
virtual VxCollisionGeometryclone (bool iAlsoCloneGeometry=false) const
 Creates and returns a new VxCollisionGeometry. More...
 
virtual bool computeMassPropertiesFromMass (const double inMass, VxReal3 outCOM, VxReal33 outInertiaTensor, double *outVolume=0) const
 
void computeSmallestEnclosing (const VxArray< VxVector3 > &points, VxGeometry::eSmallestEnclosingLockedAxes lockedAxes=VxGeometry::kNoAxis, bool isPositionLocked=false)
 Resizes the underlying geometry and sets new position and orientation such that the given set of points is covered while minimizing the geometry volume. More...
 
void computeSmallestEnclosing (const VxVector3 *inPoints, size_t numPoints, VxGeometry::eSmallestEnclosingLockedAxes lockedAxes=VxGeometry::kNoAxis, bool isPositionLocked=false)
 Resizes the underlying geometry and sets new position and orientation such that the given set of points is covered while minimizing the geometry volume. More...
 
VxCollisionGeometryStatecreateState () const
 Creates a state that can be later restored. More...
 
void enableCollision (bool value)
 True to enable collision; false to remove this geometry from the collision detection. More...
 
virtual void enableFastMoving (bool value)
 Sets the fast moving flag. More...
 
void enableFluidInteraction (bool value)
 Sets the fluid interaction enabled flag. More...
 
void enableMass (bool value)
 Sets the mass enabled flag. More...
 
void getAABBRef (const Vx::VxTransform &iTMRef, Vx::VxVector3 *minCorner, Vx::VxVector3 *maxCorner, double time) const
 Computes and returns the aabb in reference frame given by iTMRef. More...
 
ResponseType getAssignedResponseID (size_t index) const
 Gets the response ID in this collision geometry with the given index. More...
 
size_t getAssignedResponseIDCount () const
 Gets the number of response IDs assigned to this collision geometry. More...
 
VxMath::BoundingBox getBoundingBox () const
 Gets the axis-aligned bounding box of the collision geometry in world space.
 
VxMath::BoundingSphere getBoundingSphere () const
 Gets the bounding sphere of the collision geometry.
 
virtual const char * getClassName () const
 Returns the class name.
 
const VxSequentialIDgetCollisionGeometryID () const
 Get collision geometry ID. More...
 
virtual void getCOM (VxReal3 com)
 
double getContactTolerance () const
 Gets the contact tolerance used during collision detection for this collision geometry. More...
 
virtual VxVector3 getExtremePoint (const VxVector3 &direction) const
 Returns the extreme point in the specified direction on the collision geometry in world space. More...
 
const VxArray< VxOBB > & getFilterBoxes () const
 Returns the filter boxes registered on this cg. More...
 
const VxArray< VxOBB > & getFilterBoxesAbsolute () const
 Returns filter boxes registered on this cg in world space.
 
FluidInteractionDatagetFluidInteractionData () const
 Returns a pointer to the interaction data.
 
VxFluidInteractionForceFn getFluidInteractionForceFn () const
 Gets the fluid interaction force function previously set with setFluidInteractionForceFn().
 
virtual VxGeometrygetGeometry () const
 Gets the geometry of this collision geometry.
 
VxIntersectFiltergetIntersectFilter () const
 Returns the intersect filter , if any.
 
virtual VxMaterialgetMaterial () const
 Returns the material or NULL (corresponding to the default material)
 
virtual VxMaterialgetMaterial (int iTag) const
 Reads the mapped material from the material map if present in the geometry; otherwise, returns the material of the collision geometry. More...
 
VxCompositeCollisionGeometrygetParent () const
 Gets the composite this collision geometry is in. More...
 
VxPartgetPart () const
 Gets the part this collision geometry is in. More...
 
VxPartgetPartRecursive () const
 Look for the part recursively in its parents, and return it if it has one, otherwise return null. More...
 
int getRequestID () const
 Returns the default request ID if the geometry has been added to a part.
 
TemporaryDisabledStatus getTemporaryDisabledStatus () const
 Returns the temporary disabled status .
 
const VxTransformgetTransformAbsolute () const
 Gets the absolute transform. More...
 
const VxTransformgetTransformRelative () const
 Gets the relative transform. More...
 
VxUniversegetUniverse () const
 Gets the universe this collision geometry is in. More...
 
VincModel * getVincModel () const
 
bool isCollisionEnabled () const
 Returns true if this geometry participates in collision detection.
 
virtual bool isFastMovingEnabled () const
 Check if the fast moving flag is enabled.
 
bool isFluidInteractionEnabled () const
 Gets the fluid interaction enabled flag .
 
bool isHole () const
 
bool isMassEnabled () const
 Check the value of mass enabled flag. More...
 
bool isResponseIDAssigned (ResponseType id) const
 Checks if the given response ID is assigned to this collision geometry. More...
 
virtual bool isStatic () const
 Gets the static flag. More...
 
CallbackHandle registerDestructionCallback (const std::function< void()> &fn)
 Register a callback function that will be executed when this instance is destroyed. More...
 
void removeFilterBox (const VxOBB &filterBox)
 Removes a registered filter box on this collision geometry.
 
void removeResponseID (ResponseType id)
 Removes the given response ID from this collision geometry. More...
 
bool replaceAllResponseIDs (ResponseType newID)
 Replaces all currently assigned response IDs by the new response ID (newID). More...
 
bool replaceResponseID (ResponseType oldID, ResponseType newID)
 Replaces the old response ID (oldID) by the new response ID (newID). More...
 
bool restoreState (VxCollisionGeometryState *state)
 Restores a previously created state. More...
 
void setCollisionGeometryID (const VxSequentialID &ID)
 Set collision geometry ID. More...
 
void setContactTolerance (double value)
 Sets the contact tolerance used during collision detection for this collision geometry. More...
 
virtual bool setDefaultFluidInteractionForceFn ()
 Sets the default fluid interaction force function for the current geometry in the collision geometry. More...
 
virtual void setFluidInteractionData (const VxReal3 buoyancyCenter, const VxReal3 drag, double buoyancyForceScale=1, double magnus=0)
 Sets specific fluid interaction properties. More...
 
virtual void setFluidInteractionData (const FluidInteractionData &data)
 Sets specific fluid interaction properties from the existing property.
 
void setFluidInteractionForceFn (VxFluidInteractionForceFn fn)
 Sets the fluid interaction force function. More...
 
virtual void setGeometry (VxGeometry *geometry)
 Sets the geometry for this collision geometry. More...
 
void setIntersectFilter (VxIntersectFilter *f)
 Sets an intersect filter for this collision geometry. More...
 
virtual void setMaterial (VxMaterial *iMaterial)
 Sets the material associated to the geometry. More...
 
bool setRequestID (int id, bool updateExistingPairs=true)
 Sets the requestID of the collision geometry. More...
 
virtual void setStatic (bool value)
 Sets the static flag. More...
 
void setTemporaryDisabledStatus (TemporaryDisabledStatus status)
 Sets the temporary disabled status. More...
 
void setTransformAbsolute (const VxTransform &absoluteTransform)
 Sets the absolute transform . More...
 
void setTransformRelative (const VxTransform &transform)
 Sets the relative transform . More...
 
void unregisterDestructionCallback (CallbackHandle handle)
 Unregister the callback with the specified handle.
 
virtual void updateAbsoluteTransform ()
 Updates the collision geometry's absolute transform. More...
 
- Public Member Functions inherited from Vx::VxBaseUserData
VXCORE_SYMBOL VxBaseUserData ()
 Default constructor.
 
virtual VXCORE_SYMBOL ~VxBaseUserData ()
 Destructor.
 
void * getUserDataPtr () const
 Get pointer to generic user data.
 
void setUserDataPtr (void *dataPtr)
 Set pointer to generic user data. More...
 
VXCORE_SYMBOL const
VxUserDataContainer
userData () const
 Accessor for user data (const version)
 
VXCORE_SYMBOL VxUserDataContaineruserData ()
 Accessor for user data.
 
- Public Member Functions inherited from Vx::VxBase
void addSubscriber (Event event, Subscriber *subscriber)
 
void addSubscriber (Subscriber *subscriber)
 
unsigned int getCreationIndex () const
 Access the creation index of the instance.
 
const char * getName () const
 Retrieves the name. More...
 
bool hasName () const
 
bool isSubscribed (Event event, Subscriber *subscriber) const
 
bool isSubscribed (Subscriber *subscriber) const
 
void removeSubscriber (Event event, Subscriber *subscriber)
 
void removeSubscriber (Subscriber *subscriber)
 
void setCombinedName (const char *base, const char *name, size_t i=0)
 Utility to set the name to a concatenate string = base_name_i.
 
virtual void setName (const char *name)
 Sets the name.
 

Static Public Member Functions

static void enableAutoFastMoving (bool value)
 Enable/disable the auto fast moving.
 
static bool getAutomaticGeometryOwnerListMaintenance ()
 Returns true if the automatic VxCollisionGeometry registration as VxGeometry owner is enabled. More...
 
static size_t getFastMovingMaxIterations ()
 Gets maximum number of iterations used during collision processing of fast moving collision geometries. More...
 
static double getFastMovingMaxLinearAcceleration ()
 Gets linear acceleration limit used for fast moving collision geometries. More...
 
static double getFastMovingMaxLinearVelocity ()
 Gets linear velocity limit used for fast moving collision geometries. More...
 
static bool isAutoFastMovingEnabled ()
 Returns true if auto fast moving is enabled. More...
 
static void setAutomaticGeometryOwnerListMaintenance (bool b)
 Enables/disables the VxCollisionGeometry registration as VxGeometry owner. More...
 
static void setFastMovingMaxIterations (size_t value)
 Sets maximum number of iterations used during collision processing of fast moving collision geometries. More...
 
static void setFastMovingMaxLinearAcceleration (double value)
 Sets linear acceleration limit used for fast moving collision geometries. More...
 
static void setFastMovingMaxLinearVelocity (double value)
 Sets linear velocity limit used for fast moving collision geometries. More...
 

Protected Member Functions

virtual VxCollisionGeometryStatecreateStateImpl () const
 Creates a state that can be later restored. More...
 
virtual void restoreStateImpl (VxCollisionGeometryState *state)
 Restores a previously created state. More...
 
virtual void updateReferenceFrame ()
 

Friends

class VxCompositeCollisionGeometry
 
class VxGeometry
 
class VxPart
 
class VxUniverse
 

Additional Inherited Members

- Static Protected Member Functions inherited from Vx::VxBase
static void resetVxBaseCounter ()
 

Detailed Description

Defines a volume and shape in space that the Dynamics can use to compute collision for a rigid body.

The shape and volume are defined by creating a primitive geometry using one of the Vx::VxGeometry subclasses.

It also holds the specific collision response properties associated with the shape.

It provides utility functions that enable the user to:

  • Assign material properties to the contained geometry
  • Compute the mass properties of the geometry
  • Modify the position and orientation of the geometry relative to the part

Geometries can be shared between collision geometries and are reference-counted.

See Also
VxGeometry
The list of geometry types available in Vortex
Vortex SDK for more information about using collision geometries in the SDK.

Member Enumeration Documentation

Allows the user to tune different levels of the disabled status for collision geometries.

Note
The disabled status takes effect only if getCollisionEnable() is true
Enumerator
kNotTemporaryDisabled 

Collision is not temporarily disabled.

kTemporaryDisabledShortTerm 

The Geometry position is still maintained but no collisions are computed for it.

kTemporaryDisabledLongTerm 

The Geometry position is not maintained and no collisions are computed for it.

Constructor & Destructor Documentation

Vx::VxCollisionGeometry::VxCollisionGeometry ( VxGeometry geometry,
VxMaterial material 
)

Constructor with geometry and material.

The geometry is reference-counted. Does not take ownership of the material.

Vx::VxCollisionGeometry::VxCollisionGeometry ( VxGeometry geometry,
VxMaterial material,
const VxTransform transform 
)

Constructor with geometry, material and transform.

The geometry is reference-counted. Does not take ownership of the material.

virtual Vx::VxCollisionGeometry::~VxCollisionGeometry ( )
virtual

Destructor.

Also destroys the contained geometry if it's not referenced by another collision geometry; otherwise decrements its reference count.

Member Function Documentation

void Vx::VxCollisionGeometry::addFilterBox ( const VxOBB filterBox)

Adds a filter box to this collision geometry.

Inside this box, contacts with other collision geometries or intersections with line segments will not be created.

Note
Filter box is assumed to be in local space of collision geometry.
bool Vx::VxCollisionGeometry::assignResponseID ( ResponseType  id)

Assigns the given response ID to this collision geometry.

Note
By default, a collision geometry has one pre-assigned response ID after construction (VxUniverse::kResponseRigidBody).

The response IDs in a collision geometry define the actions (or responses) which should occur once the collision geometry collides with another collision geometry. The actions (or responses) which are performed are defined by response models . Each response model which is registered in a universe has a unique, associated response ID , which can be associated to collision geometries using this function. When two collision geometries intersect, every pair of response IDs of the respective collision geometries, will lead to a different response. After construction a collision geometry has the response ID VxUniverse::kResponseRigidBody assigned, and will thus cause compliant contact response when colliding with a collision geometry which also has the ID VxUniverse::kResponseRigidBody.

Note
A collision geometry should at least have one response ID. Otherwise it will not have any effect in simulation.
Warning
The given response ID must be from a valid response model , or a built-in response ID (see, e.g., VxUniverse::kResponseRigidBody).
A collision geometry can not contain the same response ID twice. Likewise it can not contain the response IDs from both a response model and a clone of the same response model. Those response IDs will be detected and ignored automatically.
Returns
true on success
virtual VxCollisionGeometry* Vx::VxCollisionGeometry::clone ( bool  iAlsoCloneGeometry = false) const
virtual

Creates and returns a new VxCollisionGeometry.

If you specify true, the geometry is also cloned; otherwise it is shared.

Note
By default, it is a shallow copy (the internal VxGeometry is shared)

Reimplemented in Vx::VxCompositeCollisionGeometry.

void Vx::VxCollisionGeometry::computeSmallestEnclosing ( const VxArray< VxVector3 > &  points,
VxGeometry::eSmallestEnclosingLockedAxes  lockedAxes = VxGeometry::kNoAxis,
bool  isPositionLocked = false 
)

Resizes the underlying geometry and sets new position and orientation such that the given set of points is covered while minimizing the geometry volume.

Parameters
[in]pointsSet of points
[in]lockedAxesNo restriction on rotation=VxGeometry::kNoAxis. Rotation only around x-axis=VxGeometry::kXAxis, y-axis=VxGeometry::kYAxis or z-axis=VxGeometry::kZAxis. No rotation (fully locked)=VxGeometry::kAllAxes.
[in]isPositionLockedIf isPositionLocked is set the position in the inOutTM is not modified and the fit is done purely on size, modifying the orientation as permitted by lockedAxes.
void Vx::VxCollisionGeometry::computeSmallestEnclosing ( const VxVector3 inPoints,
size_t  numPoints,
VxGeometry::eSmallestEnclosingLockedAxes  lockedAxes = VxGeometry::kNoAxis,
bool  isPositionLocked = false 
)

Resizes the underlying geometry and sets new position and orientation such that the given set of points is covered while minimizing the geometry volume.

Parameters
[in]inPointsSet of points
[in]numPointsNumber of points in inPoints array
[in]lockedAxesNo restriction on rotation=VxGeometry::kNoAxis. Rotation only around x-axis=VxGeometry::kXAxis, y-axis=VxGeometry::kYAxis or z-axis=VxGeometry::kZAxis. No rotation (fully locked)=VxGeometry::kAllAxes.
[in]isPositionLockedIf isPositionLocked is set the position in the inOutTM is not modified and the fit is done purely on size, modifying the orientation as permitted by lockedAxes.
VxCollisionGeometryState* Vx::VxCollisionGeometry::createState ( ) const

Creates a state that can be later restored.

This first invokes createStateImpl() and then stores the data of the VxCollisionGeometryState base class.

Caller takes ownership of the state.

virtual VxCollisionGeometryState* Vx::VxCollisionGeometry::createStateImpl ( ) const
protectedvirtual

Creates a state that can be later restored.

Derived classes should re-implement this method to create custom states.

Default implementation returns a new VxCollisionGeometryState base class.

See Also
createState()

Reimplemented in Vx::VxCompositeCollisionGeometry.

void Vx::VxCollisionGeometry::enableCollision ( bool  value)

True to enable collision; false to remove this geometry from the collision detection.

This VxCollisionGeometry may be not removed from its part as it can be still in used for the mass property or for fluid interaction.

Warning
Calling enableCollision(false) then enableCollision(true) causes all previously disabled pairs involving this geometry to be lost. Use setTemporaryDisabledStatus() instead. If the collision geometry was added to a composite, this call acts as the equivalent of using setTemporaryDisabledStatus().
Note
The absolute transform of a disabled collision geometry is not computed automatically if it moves (e.g., because it is in a VxPart). Call updateAbsoluteTransform in this case.
virtual void Vx::VxCollisionGeometry::enableFastMoving ( bool  value)
virtual

Sets the fast moving flag.

By default, intersections between collision geometries are only computed at the beginning of the step, using the current position of collision geometries. Then, the dynamics is computed and the collision geometries are moved. This makes it possible for objects to pass through each other undetected if they are going fast enough. This is a typical discretization issue.

A fast-moving collision geometry will force Vortex to take the collision geometry's part velocity into account for the purpose of collision detection. This is achieved by considering an extruded volume from the position at the beginning of the step, and the projected position at the end of the step, based on the velocity.

Setting this flag will eliminate some discretization issues of fast-moving objects, hence the name.

However, the drawback is that the point of impact will still be set as if it occurred at the beginning the step. For more precision, see continuous collision detection.

See Also
VxFrame::setContinuousCollisionDetection()

Reimplemented in Vx::VxCompositeCollisionGeometry.

void Vx::VxCollisionGeometry::enableFluidInteraction ( bool  value)

Sets the fluid interaction enabled flag.

When TRUE, this collision geometry participates in the fluid interaction of its part.

void Vx::VxCollisionGeometry::enableMass ( bool  value)

Sets the mass enabled flag.

When TRUE, this collision geometry participates in the mass properties of its part.

void Vx::VxCollisionGeometry::getAABBRef ( const Vx::VxTransform iTMRef,
Vx::VxVector3 minCorner,
Vx::VxVector3 maxCorner,
double  time 
) const

Computes and returns the aabb in reference frame given by iTMRef.

The given time is used to enlarge the computed aabb by using the current speed of the geometry and the time (in sec).

ResponseType Vx::VxCollisionGeometry::getAssignedResponseID ( size_t  index) const

Gets the response ID in this collision geometry with the given index.

See Also
getAssignedResponseIDCount
size_t Vx::VxCollisionGeometry::getAssignedResponseIDCount ( ) const

Gets the number of response IDs assigned to this collision geometry.

See Also
getAssignedResponseID
assignResponseID
static bool Vx::VxCollisionGeometry::getAutomaticGeometryOwnerListMaintenance ( )
static

Returns true if the automatic VxCollisionGeometry registration as VxGeometry owner is enabled.

See Also
setAutomaticGeometryOwnerListMaintenance()
const VxSequentialID& Vx::VxCollisionGeometry::getCollisionGeometryID ( ) const
inline

Get collision geometry ID.

See Also
setCollisionGeometryID
double Vx::VxCollisionGeometry::getContactTolerance ( ) const

Gets the contact tolerance used during collision detection for this collision geometry.

The default value is given by VxUniverse::getDefaultContactTolerance().

virtual VxVector3 Vx::VxCollisionGeometry::getExtremePoint ( const VxVector3 direction) const
virtual

Returns the extreme point in the specified direction on the collision geometry in world space.

Parameters
[in]directionDirection of the sought extreme point in world space. Must be unit size.
Returns
Extreme point in given direction. This is the point which yields the maximum dot product with inDir.

Reimplemented in Vx::VxCompositeCollisionGeometry.

static size_t Vx::VxCollisionGeometry::getFastMovingMaxIterations ( )
inlinestatic

Gets maximum number of iterations used during collision processing of fast moving collision geometries.

Allows to limit the maximum processing time of fast moving objects. The smaller the value, the lower the maximum processing time, but the higher the chance that a collision might be missed in extreme cases.

static double Vx::VxCollisionGeometry::getFastMovingMaxLinearAcceleration ( )
inlinestatic

Gets linear acceleration limit used for fast moving collision geometries.

Collisions with objects moving faster than this value might be missed. Allows to limit the maximum processing time of fast moving objects. The smaller the value, the lower the maximum processing time, but the higher the chance that a collision might be missed in extreme cases.

Note
Limit is applied component-wise.
static double Vx::VxCollisionGeometry::getFastMovingMaxLinearVelocity ( )
inlinestatic

Gets linear velocity limit used for fast moving collision geometries.

Collisions with objects moving faster than this value might be missed. Allows to limit the maximum processing time of fast moving objects. The smaller the value, the lower the maximum processing time, but the higher the chance that a collision might be missed in extreme cases.

Note
Limit is applied component-wise.
const VxArray<VxOBB>& Vx::VxCollisionGeometry::getFilterBoxes ( ) const

Returns the filter boxes registered on this cg.

Note
Filter boxes are in local space of collision geometry.
virtual VxMaterial* Vx::VxCollisionGeometry::getMaterial ( int  iTag) const
virtual

Reads the mapped material from the material map if present in the geometry; otherwise, returns the material of the collision geometry.

See Also
getMaterial()

Reimplemented in Vx::VxCompositeCollisionGeometry.

VxCompositeCollisionGeometry* Vx::VxCollisionGeometry::getParent ( ) const

Gets the composite this collision geometry is in.

Note
A collision geometry cannot be both in a part and in a composite.

Caller does not take ownership of the composite.

VxPart* Vx::VxCollisionGeometry::getPart ( ) const

Gets the part this collision geometry is in.

Note
A collision geometry cannot be both in a part and in a composite.

Caller does not take ownership of the part.

VxPart* Vx::VxCollisionGeometry::getPartRecursive ( ) const

Look for the part recursively in its parents, and return it if it has one, otherwise return null.

Note
A collision geometry cannot be both in a part and in a composite.

Caller does not take ownership of the part.

const VxTransform& Vx::VxCollisionGeometry::getTransformAbsolute ( ) const

Gets the absolute transform.

Returns the absolute transform of this collision geometry at the beginning of the last step. Note that the current absolute transform might be different if the collision geometry is inside a dynamically controlled part. In order to obtain an up-to-date absolute transform, call updateAbsoluteTransform before.

const VxTransform& Vx::VxCollisionGeometry::getTransformRelative ( ) const

Gets the relative transform.

Each collision geometry has a transform value that is interpreted differently, depending on the object containing the collision geometry:

  • If the collision geometry has a parent composite collision geometry, this sets the offset of this collision geometry relative to its parent collision geometry.
  • If the collision geometry is in a part , this sets the offset of this collision geometry relative to the part it is in.
  • Otherwise, this sets the absolute position of the collision geometry.
Note
When the collision geometry changes containers, the transform value does not change; however, its interpretation does change.
VxUniverse* Vx::VxCollisionGeometry::getUniverse ( ) const

Gets the universe this collision geometry is in.

Caller does not take ownership of the universe.

static bool Vx::VxCollisionGeometry::isAutoFastMovingEnabled ( )
inlinestatic

Returns true if auto fast moving is enabled.

See Also
enableAutoFastMoving().
bool Vx::VxCollisionGeometry::isMassEnabled ( ) const

Check the value of mass enabled flag.

See Also
enableMass()
bool Vx::VxCollisionGeometry::isResponseIDAssigned ( ResponseType  id) const

Checks if the given response ID is assigned to this collision geometry.

Returns
true if response ID is assigned.
virtual bool Vx::VxCollisionGeometry::isStatic ( ) const
virtual

Gets the static flag.

If this collision geometry is not in any universe, this always returns FALSE.

CallbackHandle Vx::VxCollisionGeometry::registerDestructionCallback ( const std::function< void()> &  fn)

Register a callback function that will be executed when this instance is destroyed.

Returns a handle to unregister the callback, if needed.

void Vx::VxCollisionGeometry::removeResponseID ( ResponseType  id)

Removes the given response ID from this collision geometry.

The response ID will no longer be assigned to the collision geometry, and the corresponding responses will no longer occur.

See Also
assignResponseID
bool Vx::VxCollisionGeometry::replaceAllResponseIDs ( ResponseType  newID)

Replaces all currently assigned response IDs by the new response ID (newID).

The method does nothing if the new response ID is not valid.

Returns
true on success
bool Vx::VxCollisionGeometry::replaceResponseID ( ResponseType  oldID,
ResponseType  newID 
)

Replaces the old response ID (oldID) by the new response ID (newID).

Replacement will take effect only if the new response ID exists and is valid, otherwise, the old response ID is not removed.

Returns
true on success
bool Vx::VxCollisionGeometry::restoreState ( VxCollisionGeometryState state)

Restores a previously created state.

This first restores the data from VxCollisionGeometryState base class and then invokes restoreStateImpl() so that derived class can have custom states.

Does not take ownership of the state.

Returns
TRUE if the state was successfully restored.
virtual void Vx::VxCollisionGeometry::restoreStateImpl ( VxCollisionGeometryState state)
protectedvirtual

Restores a previously created state.

Derived classes should re-implement this method to restore custom states.

When invoked, the VxCollisionGeometryState base class data has already been restored.

Default implementation does nothing.

See Also
restoreState()

Reimplemented in Vx::VxCompositeCollisionGeometry.

static void Vx::VxCollisionGeometry::setAutomaticGeometryOwnerListMaintenance ( bool  b)
static

Enables/disables the VxCollisionGeometry registration as VxGeometry owner.

Note
This method should only be called before creating Vortex objects. Otherwise inconsistencies might arise.
void Vx::VxCollisionGeometry::setCollisionGeometryID ( const VxSequentialID ID)
inline

Set collision geometry ID.

Can be used to identify this collision geometry, e.g., during collision callbacks (

See Also
VxInternalIDIntersectSubscriber).
Note
Please note that some objects created by Vortex may have already an ID set. Overwriting them may cause unexpected behaviors.
void Vx::VxCollisionGeometry::setContactTolerance ( double  value)

Sets the contact tolerance used during collision detection for this collision geometry.

The default value is given by VxUniverse::getDefaultContactTolerance().

Note
A penetration smaller than the sum of the contact tolerance values of two intersecting collision geometries will not cause contact generation. Therefore, this value should be small compared to the simulated object's size.
virtual bool Vx::VxCollisionGeometry::setDefaultFluidInteractionForceFn ( )
virtual

Sets the default fluid interaction force function for the current geometry in the collision geometry.

Warning
If the geometry is replaced, the function needs to be called again to get the appropriate default function.

Reimplemented in Vx::VxCompositeCollisionGeometry.

static void Vx::VxCollisionGeometry::setFastMovingMaxIterations ( size_t  value)
inlinestatic

Sets maximum number of iterations used during collision processing of fast moving collision geometries.

See Also
getFastMovingMaxIterations
static void Vx::VxCollisionGeometry::setFastMovingMaxLinearAcceleration ( double  value)
inlinestatic

Sets linear acceleration limit used for fast moving collision geometries.

See Also
getFastMovingMaxLinearAcceleration
static void Vx::VxCollisionGeometry::setFastMovingMaxLinearVelocity ( double  value)
inlinestatic

Sets linear velocity limit used for fast moving collision geometries.

See Also
getFastMovingMaxLinearVelocity
virtual void Vx::VxCollisionGeometry::setFluidInteractionData ( const VxReal3  buoyancyCenter,
const VxReal3  drag,
double  buoyancyForceScale = 1,
double  magnus = 0 
)
virtual

Sets specific fluid interaction properties.

If not set, default values are used.

param[in] buoyancyCenter Currently only used if the geometry is completely submerged. param[in] drag Drag coefficient must be positive param[in] buoyancyForceScale Accounts for the difference of volume between the collision geometry and the real object. param[in] magnus Magnus coefficient must be positive (defaults to 0). Currently implemented for the sphere and the cylinder geometry only.

Reimplemented in Vx::VxCompositeCollisionGeometry.

void Vx::VxCollisionGeometry::setFluidInteractionForceFn ( VxFluidInteractionForceFn  fn)

Sets the fluid interaction force function.

The interaction of all fluids added to the universe is computed using this function.

Note
Default fluid interaction function can be set using setDefaultFluidInteractionForceFn()
virtual void Vx::VxCollisionGeometry::setGeometry ( VxGeometry geometry)
virtual

Sets the geometry for this collision geometry.

Note
The response ID of this collision geometry will be kept after this function call. The request ID , however, will be reset to the default (see VxGeometry::getDefaultRequestID), since it depends on the type of geometry.
Warning
The given geometry must not be NULL.
The request ID will be replaced by the default request ID for the given geometry. Call VxCollisionGeometry::setRequestID if another request ID is desired.

Reimplemented in Vx::VxCompositeCollisionGeometry.

void Vx::VxCollisionGeometry::setIntersectFilter ( VxIntersectFilter f)

Sets an intersect filter for this collision geometry.

An intersect filter allows interactive collision geometry pair disabling. It is especially useful for disabling pairs with collision geometries added to composite collision geometries, as the child collision geometries are not supported by VxUniverse::disablePairsWith calls or collision rules .

virtual void Vx::VxCollisionGeometry::setMaterial ( VxMaterial iMaterial)
virtual

Sets the material associated to the geometry.

Parameters
[in]iMaterialMust be either a valid VxMaterial , created by the VxMaterialTable or NULL (for the default material).

Reimplemented in Vx::VxCompositeCollisionGeometry.

bool Vx::VxCollisionGeometry::setRequestID ( int  id,
bool  updateExistingPairs = true 
)

Sets the requestID of the collision geometry.

This ID is typically used to define sets of collision geometries. Each set is specified by a different request ID set by the user, starting at 0.

Each pair of request IDs corresponds to a VxCollisionPairRequest in which different parameters used by the collision detection are stored. Use this method to set request IDs for those collision geometries.

The default request ID depends on the type of geometry inside this collision geometry. See VxGeometry::getDefaultRequestID for more information.

Note
If updateExistingPairs == true (default), the change takes immediate effect on existing overlaps with the AABB of this collision geometry in the collision detection. Otherwise, the change will take effect only on new overlaps.
See Also
VxCollisionPairRequest
VxGeometry::getDefaultRequestID
virtual void Vx::VxCollisionGeometry::setStatic ( bool  value)
virtual

Sets the static flag.

A static collision geometry cannot move. This is an assumption used by the broad phase of collision detection, yielding some performance gains.

The transform of a static collision geometry cannot be changed while it remains static. It will not be re-computed automatically like other collision geometries, even if you move it or call the updateAbsoluteTransform method. The only way change it's transform is to remove the static flag.

If this collision geometry is not in any universe, calling this method has no effect.

Reimplemented in Vx::VxCompositeCollisionGeometry.

void Vx::VxCollisionGeometry::setTemporaryDisabledStatus ( TemporaryDisabledStatus  status)

Sets the temporary disabled status.

When a geometry is temporarily disabled, the disabled pairs involving this geometry are still maintained. The VxCollisionGeometry::kTemporaryDisabledShortTerm option can be applied at no cost.

No collision involving this geometry is computed but the geometry position is still maintained so there is still a run-time cost for this geometry. The VxCollisionGeometry::kTemporaryDisabledLongTerm option is similar to calling setCollisionEnabled(false) except that the disabled pairs are still maintained. There is a cost to use this option but once set to kTemporaryDisabledLongTerm, there is no more run-time cost for this geometry.

void Vx::VxCollisionGeometry::setTransformAbsolute ( const VxTransform absoluteTransform)

Sets the absolute transform .

Sets the transform by computing the offset necessary to obtain the specified absolute transform from the transform of the object containing the collision geometry.

If there is no object containing the collision geometry, this sets the absolute transform directly, without any computation.

Note that this method will have no effect if the static flag is set.

See Also
setStatic
void Vx::VxCollisionGeometry::setTransformRelative ( const VxTransform transform)

Sets the relative transform .

Note that this method will have no effect if the static flag is set.

See Also
setStatic
virtual void Vx::VxCollisionGeometry::updateAbsoluteTransform ( )
virtual

Updates the collision geometry's absolute transform.

The collision geometry's absolute transform is computed at the beginning of each step. Therefore after the integration (at the end of the step) the absolute transform of the collision geometry is one step late.

Note that this method will have no effect if the static flag is set.

See Also
setStatic

Note: This could be required if the collision geometry is disabled (see setCollisionEnabled) and an up-to-date transform is needed. If a collision geometry is disabled, it is not used in the collision detection. So we do not update the absolute transform automatically in this case as a performance optimization.

See Also
getTransformAbsolute
enableCollision

Reimplemented in Vx::VxCompositeCollisionGeometry.