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

Capsule geometry used for collision. More...

#include <Vx/VxCapsule.h>

+ Inheritance diagram for Vx::VxCapsule:

Public Member Functions

 VxCapsule (double radius, double height)
 Default constructor with specified dimensions. More...
 
virtual ~VxCapsule ()
 Destructor.
 
virtual VxCapsuleclone () const
 Clones the geometry.
 
virtual const char * getClassName () const
 Returns the class name.
 
double getLength () const
 Gets the length of the cylindrical part of the capsule.
 
double getRadius () const
 Gets the radius of the Capsule.
 
virtual void setDimensions (const Vx::VxVector3 &dim)
 Sets the radius and the length of the capsule.
 
void setLength (double len)
 Sets the length of the cylindrical part of the capsule.
 
void setRadius (double radius)
 Sets the radius of the Capsule.
 
- Public Member Functions inherited from Vx::VxGeometry
VXCORE_SYMBOL VxGeometry ()
 Default constructor.
 
virtual VXCORE_SYMBOL ~VxGeometry ()
 Destructor.
 
VXCORE_SYMBOL void addOwner (Vx::VxCollisionGeometry *owner)
 Adds the collision geometry as owner .
 
virtual VXCORE_SYMBOL bool build ()
 Build this geometry. More...
 
VXCORE_SYMBOL const
MaterialPointerArray
createMaterialMap (int size, VxMaterial *iDefaultMaterial)
 Creates a new material map of the specified size and with the specified default material. More...
 
VXCORE_SYMBOL void getBoundingBox (const VxReal44 tm, VxReal3 minCorner, VxReal3 maxCorner) const
 Gets the axis aligned bounding box for the geometry in a specified coordinate system. More...
 
VXCORE_SYMBOL void getBoundingSphere (VxReal3 center, double *radius) const
 Gets the bounding sphere of the geometry in local space. More...
 
VXCORE_SYMBOL double getBoundingSphereRadius () const
 Returns the bounding sphere radius in local coordinates.
 
VXCORE_SYMBOL const VxVector3getCOM ()
 Gets the center of mass from this geometry's mass properties . More...
 
VXCORE_SYMBOL void getExtremePoint (const VxReal44 tm, const VxReal3 inDir, VxReal3 outPoint) const
 Returns the extreme point in the specified direction on the geometry. More...
 
const MaterialPointerArraygetMaterialMap () const
 Returns the material map Only use getMaterialMap() to inspect the materials used in the VxGeometry. More...
 
VXCORE_SYMBOL const VxArray
< VxCollisionGeometry * > & 
getOwners () const
 Returns a list of the VxCollisionGeometry objects that own this geometry. More...
 
VXCORE_SYMBOL double getVolume ()
 Gets the volume from this geometry's mass properties . More...
 
VXCORE_SYMBOL bool hasOwner (Vx::VxCollisionGeometry *owner) const
 Returns true if the specified collision geometry owns this geometry.
 
virtual VXCORE_SYMBOL bool isBuilt () const
 Returns true if geometry was successfully built.
 
VXCORE_SYMBOL bool isHole () const
 Returns true if the geometry type is one of the following: More...
 
VXCORE_SYMBOL void removeOwner (Vx::VxCollisionGeometry *owner)
 Removes the collision geometry as owner .
 
VXCORE_SYMBOL bool setMaterial (int index, VxMaterial *material)
 Assigns a material to the geometry feature with the given index. More...
 
VXCORE_SYMBOL void updateOwners ()
 Updates the owners of this geometry (see addOwner() and VxCollisionGeometry::setAutomaticGeometryOwner). 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
unsigned int getCreationIndex () const
 Access the creation index of the instance.
 
const char * getName () const
 Retrieves the name. More...
 
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.
 
- Public Member Functions inherited from Vx::VxRefCount
VxRefCountoperator= (const VxRefCount &rhs)=delete
 Assignment operator must not be used.
 
void ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
int referenceCount () const
 Return the number pointers currently referencing this object.
 
void unref () const
 Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More...
 
void unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Protected Member Functions

void computeSmallestEnclosing (const VxArray< VxVector3 > &inPoints, VxTransform *inOutTM, VxGeometry::eSmallestEnclosingLockedAxes lockedAxes=VxGeometry::kNoAxis, bool isPositionLocked=false)
 Resizes the geometry and computes the new global position and orientation (inOutTm), such that the given set of points is covered while minimizing the volume. More...
 
void computeSmallestEnclosing (const VxVector3 *inPoints, size_t numPoints, VxTransform *inOutTM, VxGeometry::eSmallestEnclosingLockedAxes lockedAxes=VxGeometry::kNoAxis, bool isPositionLocked=false)
 Resizes the geometry and computes the new global position and orientation (inOutTm), such that the given set of points is covered while minimizing the volume. More...
 

Additional Inherited Members

- Public Types inherited from Vx::VxGeometry
enum  eSmallestEnclosingLockedAxes {
  kNoAxis = -1, kXAxis, kYAxis, kZAxis,
  kAllAxes
}
 Enum for specifying locked axes. More...
 
- Static Public Member Functions inherited from Vx::VxGeometry
static VXCORE_SYMBOL int getDefaultRequestID (const VxGeometry *g)
 Returns the default request id for the given geometry. More...
 

Detailed Description

Capsule geometry used for collision.

Centered at the local origin. The axis is defined along the local Z axis

Constructor & Destructor Documentation

Vx::VxCapsule::VxCapsule ( double  radius,
double  height 
)

Default constructor with specified dimensions.

The capsule is centered at the local coordinate origin, with its axis along the z-axis.

The height is the length of the cylindrical part of the capsule. The overall length of a capsule is (2*radius + height)

Member Function Documentation

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

Resizes the geometry and computes the new global position and orientation (inOutTm), such that the given set of points is covered while minimizing the volume.

Parameters
[in]pointsArray of points to consider for computation
[in,out]inOutTMGives the initial transformation and holds the computed transformation when the function returns.
[in]lockedAxesNo restriction on rotation by default (VxGeometry::kNoAxis). See eSmallestEnclosingLockedAxes for other options for locking axes
[in]isPositionLockedTrue to calculate the fit purely on size, modifying the orientation as permitted by lockedAxes. The translation in inOutTM is not updated in this case.

Reimplemented from Vx::VxGeometry.

void Vx::VxCapsule::computeSmallestEnclosing ( const VxVector3 inPoints,
size_t  numPoints,
VxTransform inOutTM,
VxGeometry::eSmallestEnclosingLockedAxes  lockedAxes = VxGeometry::kNoAxis,
bool  isPositionLocked = false 
)
protectedvirtual

Resizes the geometry and computes the new global position and orientation (inOutTm), such that the given set of points is covered while minimizing the volume.

Parameters
[in]inPointsArray of points to consider for computation
[in]numPointsNumber of points in inPoints array
[in,out]inOutTMGives the initial transformation and holds the computed transformation when the function returns.
[in]lockedAxesNo restriction on rotation by default (VxGeometry::kNoAxis). See eSmallestEnclosingLockedAxes for other options for locking axes
[in]isPositionLockedTrue to calculate the fit purely on size, modifying the orientation as permitted by lockedAxes. The transform in inOutTM is not updated in this case.

Reimplemented from Vx::VxGeometry.