Vortex Studio SDK Classes Documentation
Vx::VxCylinder Class Reference

Cylinder collision geometry with an axis along the local Z axis, and centered at the local origin. More...

#include <Vx/VxCylinder.h>

Inheritance diagram for Vx::VxCylinder:

## Public Member Functions

Default constructor. More...

virtual ~VxCylinder ()
Destructor.

virtual VxCylinderclone () const
Clones the geometry.

virtual const char * getClassName () const
Returns the class name.

bool getCullContactAtFlatEdge () const
Returns true if contacts are allowed on an edge between two triangle with same normal (within getMaxEdgeCosForEdgeContact())

double getHeight () const
Gets the height of the cylinder.

double getMaxEdgeCosForEdgeContact ()
Returns the threshold for considering two adjacent triangle normals as parallel.

Gets the radius of the cylinder.

void setCullContactAtFlatEdge (bool b)
If true, contacts are not allowed on an edge between two triangles with the same normal (within the getMaxEdgeCosForEdgeContact() threshold)

virtual void setDimensions (const Vx::VxVector3 &dim)
Sets the size dimensions for the geometry. More...

void setHeight (double height)
Sets the height of the cylinder.

void setMaxEdgeCosForEdgeContact (double val)
Sets the threshold for considering two adjacent triangle normals as parallel.

Sets the radius of the cylinder.

Public Member Functions inherited from Vx::VxGeometry
VXCORE_SYMBOL VxGeometry ()
Default constructor.

virtual VXCORE_SYMBOL ~VxGeometry ()
Destructor.

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...

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 ()

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...

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

Cylinder collision geometry with an axis along the local Z axis, and centered at the local origin.

## Constructor & Destructor Documentation

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

Default constructor.

Returns a new cylinder with the specified dimensions.

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

## Member Function Documentation

 void Vx::VxCylinder::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] points Array of points to consider for computation [in,out] inOutTM Gives the initial transformation and holds the computed transformation when the function returns. [in] lockedAxes No restriction on rotation by default (VxGeometry::kNoAxis). See eSmallestEnclosingLockedAxes for other options for locking axes [in] isPositionLocked True 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::VxCylinder::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] inPoints Array of points to consider for computation [in] numPoints Number of points in inPoints array [in,out] inOutTM Gives the initial transformation and holds the computed transformation when the function returns. [in] lockedAxes No restriction on rotation by default (VxGeometry::kNoAxis). See eSmallestEnclosingLockedAxes for other options for locking axes [in] isPositionLocked True 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.

 virtual void Vx::VxCylinder::setDimensions ( const Vx::VxVector3 & )
inlinevirtual

Sets the size dimensions for the geometry.

This method is only valid for primitives, and what you specify as input depends on the type of primitive:

• For spheres, only the first value of the specified dimension is used as the radius.
• For boxes, the three values of the specified dimension are the x,y,z lengths of the size of the box in box local coordinates.
• For cylinders, the first value is the cylinder radius and the second value is the cylinder height. The cylinder has its axis along z (m, 0.01~1000)
• For terrains, the first two values are used to define the number of subdivisions along x and y that the terrain is divided into for optimizing collision detection time.

Reimplemented from Vx::VxGeometry.