Archon::X3D::GeometryNode Struct Reference

Server side representation of the equally named X3D node type. More...

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

Inheritance diagram for Archon::X3D::GeometryNode:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual int intersect (const Math::Ray3 &, double &dist) const =0
 Determine the distance along the ray from the ray origin to the surface of this geometric object.
virtual void getNormalAndTexCoord (Vector3 hitPoint, int where, const Shape *, Vector3 *hitNormal, Vector2 *hitTexCoord) const =0
 Map a surface point to a surface normal and a corresponding texture coordinate.
virtual void render (bool texture, const Shape *shape, const RenderConfig *)=0
 Render the geometric structure using OpenGL primitives.

Static Public Attributes

static const NodeTypetype = 0

Protected Member Functions

 GeometryNode ()

Detailed Description

Server side representation of the equally named X3D node type.

Definition at line 79 of file geometry.H.


Member Function Documentation

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

Map a surface point to a surface normal and a corresponding texture coordinate.

Parameters:
hitPoint A point on the surface of this geometry object. The point must be given in local coordinates of this geometry object.
hitNormal Must be set by this method to the normal of the surface at the hitPoint. It needs not be normalized. It must be given in local coordinates of this geometry object.
hitTexCoord Must be set by this method to the texture coordinates corresponding with the hitPoint.
May only be called with a scenegraph write lock.

Implemented in Archon::X3D::Torus, Archon::X3D::Box, Archon::X3D::Cone, Archon::X3D::Cylinder, Archon::X3D::IndexedLineSet, Archon::X3D::PointSet, Archon::X3D::Sphere, Archon::X3D::ElevationGrid, Archon::X3D::IndexedFaceSet, and Archon::X3D::Text.

virtual int Archon::X3D::GeometryNode::intersect const Math::Ray3 ,
double &  dist
const [pure virtual]
 

Determine the distance along the ray from the ray origin to the surface of this geometric object.

The distance is mesured in units of the ray direction vector length and is never negative.

Returns zero if the ray does not intersect the geometry. Otherwise non-zero, and the returned value will indicate which part of the geometry that was intersected.

When zero is returned the 'dist' parameter is left unchaged. Otherwise it is set to the distance in question.

For solid objects like spheres this method shall disregard any intersection with the surface where the ray passes out of the objct.

For solid and non-solid objects we shall regard the surface as part of the object. This means that if a ray originates on the surface of any object (dist=0) then this method shall disregard that intersection point. This in turn means that the reported distance always will be strictly positive (it can never be zero).

May only be called with a scenegraph write lock.

Implemented in Archon::X3D::Torus, Archon::X3D::Box, Archon::X3D::Cone, Archon::X3D::Cylinder, Archon::X3D::IndexedLineSet, Archon::X3D::PointSet, Archon::X3D::Sphere, Archon::X3D::ElevationGrid, Archon::X3D::IndexedFaceSet, and Archon::X3D::Text.

virtual void Archon::X3D::GeometryNode::render bool  texture,
const Shape shape,
const RenderConfig
[pure virtual]
 

Render the geometric structure using OpenGL primitives.

For each vertex set the normal, the color and the texture coordinate. The texture coordinate mey be skipped if the 'texture' parameter is false. The color may be skipped in which case the effective color is controlled by the material.

The following GL parameters may not be assumed to have any particular value and may be left changed: vertex normal, vertex color, texture coordinate, polygon front face, color material tracking, one/two sided light model, cull face enable.

Parameters:
texture If false the texture coordinates may be left unspecified.
shape The Shape node that contains this geometry node in the current thread of thraversal of the scene graph.
May only be called with a scenegraph write lock.

Implemented in Archon::X3D::Torus, Archon::X3D::Box, Archon::X3D::Cone, Archon::X3D::Cylinder, Archon::X3D::IndexedLineSet, Archon::X3D::PointSet, Archon::X3D::Sphere, Archon::X3D::ElevationGrid, Archon::X3D::IndexedFaceSet, and Archon::X3D::Text.


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