Archon::X3D::Torus Struct Reference

A torus goemetry node. More...

#include <archon/x3d/server/aux.H>

Inheritance diagram for Archon::X3D::Torus:

Inheritance graph
[legend]
Collaboration diagram for Archon::X3D::Torus:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const NodeTypegetType () const
 Torus (BackRef< ExecutionContext > c)
double getMajorRadius () const
double getMinorRadius () const
int intersect (const Math::Ray3 &, double &dist) const
void getNormalAndTexCoord (Vector3 hitPoint, int where, const Shape *, Vector3 *hitNormal, Vector2 *hitTexCoord) const
void render (bool texture, const Shape *shape, const RenderConfig *)

Static Public Member Functions

static Ref< NodeBaseinstantiate (BackRef< ExecutionContext > c)

Static Public Attributes

static const NodeTypetype = 0

Friends

void initializeAuxComponent ()

Detailed Description

A torus goemetry node.

A torus is described by a major and a minor radius. The major radius describes a circle in the z-x-plane centered at the origin of the local coordinate system. Any point on the surface of the torus can then be describes by a vector drawn from some point on this circle. Each such vector must be perpendicular to the circle at that point and be as long as the minor radius. Thus, the torus is centered at the origin of the local coordinate system and has the y-axis as the axis of revolution. When textures are applied to a torus the texture x-coordinate is taken as the angle of the projection of the surface point onto the z-x-plane taking zero to be the direction of the negative z-axis and increasing counter-clockwise when seen from the positive y-axis. The texture y-coordinate is taken as the angle between the surface point and the center of the torus when seen from the point on the circle of revolution that is closest to the surface point. When seen from a point on the circle of revolution in the direction of revolution the texture y-coordinate increses clockwise.

Definition at line 58 of file aux.H.


Member Function Documentation

void Archon::X3D::Torus::getNormalAndTexCoord Vector3  hitPoint,
int  where,
const Shape ,
Vector3 hitNormal,
Vector2 hitTexCoord
const [virtual]
 

Todo:
Do texture coordinate determinatin

Implements Archon::X3D::GeometryNode.

Definition at line 63 of file aux.C.

References Archon::Math::BasicVector< T, N >::set().


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 22:58:34 2006 for Archon by  doxygen 1.4.4