H3D API
2.4.1
|
The DeformableShape is an X3DShapeNode which makes it possible to deform the geometry of the shape when touching it with a haptics device. More...
#include <H3D/DeformableShape.h>
Classes | |
class | SFGeometryNode |
The SFGeometryNode is extended to only accept X3DComposedGeometryNode nodes. More... | |
Public Member Functions | |
DeformableShape (Inst< SFAppearanceNode > _appearance=0, Inst< SFGeometryNode > _geometry=0, Inst< SFHapticGeometry > _hapticGeometry=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< SFCoordinateNode > _origCoord=0, Inst< SFCoordinateNode > _restingCoord=0, Inst< SFCoordinateNode > _deformedCoor=0, Inst< SFCoordinateDeformer > _deformer=0) | |
Constructor. | |
virtual void | traverseSG (TraverseInfo &ti) |
Traverse the scenegraph. More... | |
![]() | |
X3DShapeNode (Inst< SFAppearanceNode > _appearance=0, Inst< SFGeometryNode > _geometry=0, Inst< SFHapticGeometry > _hapticGeometry=0, Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFVec3f > _bboxCenter=0, Inst< SFVec3f > _bboxSize=0, Inst< DisplayList > _displayList=0) | |
Constructor. | |
virtual void | initialize () |
Sets up the bound field using the bboxCenter and bboxSize fields. More... | |
virtual void | render () |
Render the shape using OpenGL. | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and the X3DGeometryNode in the field geometry. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on the node in the field geometry. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the geometry in the geometry field. More... | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
![]() | |
H3DBoundedObject (Inst< SFBound > _bound=0) | |
Constructor. | |
![]() | |
H3DDisplayListObject (Inst< DisplayList > _displayList=0) | |
Constructor. | |
Public Attributes | |
H3DUniquePtr< SFCoordinateNode > | origCoord |
The origCoord field contains the coordinates that the X3DComposedGeometryNode had when it was added to the X3DComposedGeometryNode. More... | |
H3DUniquePtr< SFCoordinateNode > | restingCoord |
The restingCoord fields contain the coordinates that the geometry will go back to when there are no contacts to the geometry any longer. More... | |
H3DUniquePtr< SFCoordinateNode > | deformedCoord |
The deformedCoord field contains the coordinates after deformation of current contacts of haptics devices. More... | |
H3DUniquePtr< SFCoordinateDeformer > | deformer |
The deformer field specifies an H3DCoordinateDeformerNode that determines how the coordinates should be deformed on contact If NULL, no deformation will be done. More... | |
![]() | |
H3DUniquePtr< SFAppearanceNode > | appearance |
The field containing the X3DAppearance node to be used when rendering the shape. More... | |
H3DUniquePtr< SFGeometryNode > | geometry |
Contains the X3DGeometryNode to be rendered. More... | |
H3DUniquePtr< SFHapticGeometry > | hapticGeometry |
If specified, contains a X3DGeometryNode to be rendered haptically. More... | |
H3DUniquePtr< SFShadowObjectNode > | shadowVolume |
If specified, contains a H3DShadowObjectNode to be used for shadows. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
![]() | |
H3DUniquePtr< SFVec3f > | bboxCenter |
Specifies a the center of an axis-aligned bounding box enclosing the node. More... | |
H3DUniquePtr< SFVec3f > | bboxSize |
Specifies a the size of an axis-aligned bounding box enclosing the node. More... | |
![]() | |
H3DUniquePtr< SFBound > | bound |
The field containing the bound object. More... | |
![]() | |
H3DUniquePtr< DisplayList > | displayList |
The DisplayList instance handling the OpenGL caching of this object. | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
static bool | disable_lighting_if_no_app = true |
Set to true if lighting should be disabled when no Appearance or Material node has been specified as per X3D spec. More... | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
enum | GeometryRenderMode { TRANSPARENT_ONLY , TRANSPARENT_FRONT , TRANSPARENT_BACK , SOLID , ALL } |
Tells which type of geometry should be rendered. More... | |
typedef DependentSFNode< X3DAppearanceNode, FieldRef< H3DDisplayListObject, H3DDisplayListObject::DisplayList, &H3DDisplayListObject::displayList >, true > | SFAppearanceNode |
SFAppearanceNode is dependent on the displayList field of its encapsulated X3DAppearanceNode node, i.e. More... | |
typedef TypedSFNode< X3DGeometryNode > | SFHapticGeometry |
SFHapticGeometry contains a X3DGeometryNode. | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
The DeformableShape is an X3DShapeNode which makes it possible to deform the geometry of the shape when touching it with a haptics device.
The deformer field specifies an H3DCoordinateDeformerNode that determines how the coordinates should be deformed on contact. If NULL, no deformation will be done.
The geometry field must contain an X3DComposedGeometryNode, and the coordinates in its coord field are the ones that will be deformed.
The origCoord field contains the coordinates that the X3DComposedGeometryNode had when it was added to the X3DComposedGeometryNode. These are the coordinates that was used before any deformation started.
The deformedCoord field contains the coordinates after deformation of current contacts of haptics devices. These are the coordinates that will be used for graphics rendering.
The restingCoord fields contain the coordinates that the geometry will go back to when there are no contacts to the geometry any longer. If the deformation is non-plastic, this will be the same as origCoord.
Examples:
|
virtual |
Traverse the scenegraph.
The deformation parameters are updated in the CoordinateDeformer in coordinateDeformer field.
ti | The TraverseInfo object containing information about the traversal. |
Reimplemented from H3D::X3DShapeNode.
References H3D::X3DGeometryNode::contactNormal, H3D::X3DGeometryNode::contactPoint, H3D::X3DComposedGeometryNode::coord, deformedCoord, deformer, H3D::H3DCoordinateDeformerNode::deformPoints(), H3D::X3DGeometryNode::force, H3D::X3DShapeNode::geometry, H3D::TraverseInfo::getAccInverseMatrix(), H3D::TraverseInfo::getHapticsDevices(), H3D::X3DShapeNode::hapticGeometry, H3D::X3DGeometryNode::isTouched, origCoord, H3D::Coordinate::point, restingCoord, and H3D::X3DShapeNode::traverseSG().
H3DUniquePtr< SFCoordinateNode > H3D::DeformableShape::deformedCoord |
The deformedCoord field contains the coordinates after deformation of current contacts of haptics devices.
These are the coordinates that will be used for graphics rendering.
Access type: outputOnly
Referenced by DeformableShape(), H3D::DeformableShape::SFGeometryNode::onAdd(), and traverseSG().
H3DUniquePtr< SFCoordinateDeformer > H3D::DeformableShape::deformer |
The deformer field specifies an H3DCoordinateDeformerNode that determines how the coordinates should be deformed on contact If NULL, no deformation will be done.
Access type: inputOutput
Referenced by traverseSG().
H3DUniquePtr< SFCoordinateNode > H3D::DeformableShape::origCoord |
The origCoord field contains the coordinates that the X3DComposedGeometryNode had when it was added to the X3DComposedGeometryNode.
These are the coordinates that was used before any deformation started.
Access type: outputOnly
Referenced by DeformableShape(), H3D::DeformableShape::SFGeometryNode::onAdd(), and traverseSG().
H3DUniquePtr< SFCoordinateNode > H3D::DeformableShape::restingCoord |
The restingCoord fields contain the coordinates that the geometry will go back to when there are no contacts to the geometry any longer.
If the deformation is non-plastic, this will be the same as origCoord.
Access type: outputOnly
Referenced by DeformableShape(), H3D::DeformableShape::SFGeometryNode::onAdd(), and traverseSG().