H3D::Cylinder Class Reference
[X3D node classes.]

The Cylinder node specifies a capped cylinder centred at (0,0,0) in the local coordinate system and with a central axis oriented along the local Y-axis. More...

#include <H3D/Cylinder.h>

Inheritance diagram for H3D::Cylinder:

Inheritance graph

List of all members.

Classes

class  SFBound
 SFBound is specialized update itself from the radius and heigh field of the Cylinder node. More...

Public Member Functions

 Cylinder (Inst< SFNode > _metadata=0, Inst< SFBound > _bound=0, Inst< SFBool > _bottom=0, Inst< SFFloat > _height=0, Inst< SFFloat > _radius=0, Inst< SFBool > _side=0, Inst< SFBool > _solid=0, Inst< SFBool > _top=0)
 Constructor.
virtual void render ()
 Renders the Cylinder with OpenGL.
virtual void traverseSG (TraverseInfo &ti)
 Traverse the scenegraph. Adds a HapticCylinder if haptics is enabled.
virtual int nrTriangles ()
 The number of triangles rendered by this geometry.

Public Attributes

auto_ptr< SFBoolbottom
 Specifies if the bottom of the Cylinder should be rendered or not.
auto_ptr< SFFloatheight
 The height of the Cylinder in meters.
auto_ptr< SFFloatradius
 The radius of the Cylinder.
auto_ptr< SFBoolside
 Specifies if the sides of the Cylinder should be rendered or not.
auto_ptr< SFBoolsolid
 The solid field determines whether the cylinder is visible when viewed from the inside.
auto_ptr< SFBooltop
 Specifies if the top of the cylinder should be rendered or not.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

The Cylinder node specifies a capped cylinder centred at (0,0,0) in the local coordinate system and with a central axis oriented along the local Y-axis.

By default, the cylinder is sized at "-1" to "+1" in all three dimensions. The radius field specifies the radius of the cylinder and the height field specifies the height of the cylinder along the central axis. Both radius and height shall be greater than zero.

The cylinder has three parts: the side, the top (Y = +height/2) and the bottom (Y = height/2). Each part has an associated SFBool field that indicates whether the part exists (TRUE) or does not exist (FALSE). Parts which do not exist are not rendered and not eligible for intersection tests (EXAMPLE collision detection or sensor activation).

When a texture is applied to a cylinder, it is applied differently to the sides, top, and bottom. On the sides, the texture wraps counterclockwise (from above) starting at the back of the cylinder. The texture has a vertical seam at the back, intersecting the X=0 plane. For the top and bottom caps, a circle is cut out of the unit texture squares centred at (0, +-height/2, 0) with dimensions 2 X radius by 2 X radius. The top texture appears right side up when the top of the cylinder is tilted toward the +Z-axis, and the bottom texture appears right side up when the top of the cylinder is tilted toward the Z-axis. TextureTransform affects the texture coordinates of the Cylinder node.

The solid field determines whether the cylinder is visible when viewed from the inside. If solid is false both sides of the cylinder will be rendered.

Internal routes:
Cylinder.dot

Member Data Documentation

Specifies if the bottom of the Cylinder should be rendered or not.

Access type: inputOutput
Default value: TRUE

Cylinder_bottom.dot

Referenced by Cylinder(), and render().

The height of the Cylinder in meters.

Access type: inputOutput
Default value: 2
Valid range: >0

Cylinder_height.dot

Referenced by Cylinder(), and render().

The radius of the Cylinder.

Access type: inputOutput
Default value: 1
Valid range: >0

Cylinder_radius.dot

Referenced by Cylinder(), and render().

Specifies if the sides of the Cylinder should be rendered or not.

Access type: inputOutput
Default value: TRUE

Cylinder_side.dot

Referenced by Cylinder(), and render().

The solid field determines whether the cylinder is visible when viewed from the inside.

If solid is false both sides of the sphere will be rendered.

Access type: inputOutput
Default value: TRUE

Cylinder_top.dot

Referenced by Cylinder(), and traverseSG().

Specifies if the top of the cylinder should be rendered or not.

Access type: inputOutput
Default value: TRUE

Cylinder_top.dot

Referenced by Cylinder(), and render().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:29:42 2008 for H3D API by  doxygen 1.5.7