Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Shape Class Reference

Base class for other shapes. More...

#include <Shape.h>

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::AxesShape, G3D::BoxShape, G3D::CapsuleShape, G3D::CylinderShape, G3D::MeshShape, G3D::PlaneShape, G3D::PointShape, G3D::RayShape, and G3D::SphereShape.

List of all members.

Public Types

enum  Type {
  NONE = 0, MESH = 1, BOX, CYLINDER,
  SPHERE, RAY, CAPSULE, PLANE,
  AXES, POINT
}

Public Member Functions

virtual float area () const=0
virtual CoordinateFrameaxes ()
virtual AABox boundingAABox () const=0
virtual Sphere boundingSphere () const=0
virtual const Boxbox () const
virtual Boxbox ()
virtual const Capsulecapsule () const
virtual Capsulecapsule ()
virtual Vector3 center () const=0
virtual const Cylindercylinder () const
virtual Cylindercylinder ()
virtual void getRandomSurfacePoint (Vector3 &P, Vector3 &N=Vector3::dummy) const =0
virtual const Array< int > & indexArray () const
virtual const Planeplane () const
virtual Planeplane ()
virtual const Vector3point () const
virtual Vector3point ()
virtual Vector3 randomInteriorPoint () const=0
virtual const Rayray () const
virtual Rayray ()
void ReferenceCountedObject_zeroWeakPointers ()
virtual void render (class RenderDevice *rd, const CoordinateFrame &cframe, Color4 solidColor=Color4(.5,.5, 0,.5), Color4 wireColor=Color3::black())=0
virtual const Spheresphere () const
virtual Spheresphere ()
virtual Type type () const=0
virtual const Array< Vector3 > & vertexArray () const
virtual float volume () const=0
virtual ~Shape ()

Static Public Member Functions

static std::string typeToString (Type t)

Public Attributes

AtomicInt32 ReferenceCountedObject_refCount
_WeakPtrLinkedListReferenceCountedObject_weakPointer


Detailed Description

Base class for other shapes.

G3D primitives like Box and Cylinder have no base class so that their implementations are maximally efficient, and have no "render" method because they are lower-level than the rendering API.

The Shape classes provide a parallel set of classes to the G3D primitives that support more functionality.

Mesh shapes are intentionally immutable because they precompute data.

BETA API This API is subject to change in future releases.


Member Enumeration Documentation

Enumerator:
NONE 
MESH 
BOX 
CYLINDER 
SPHERE 
RAY 
CAPSULE 
PLANE 
AXES 
POINT 


Constructor & Destructor Documentation

virtual G3D::Shape::~Shape (  )  [inline, virtual]


Member Function Documentation

virtual float G3D::Shape::area (  )  const [pure virtual]

virtual CoordinateFrame& G3D::Shape::axes (  )  [inline, virtual]

Reimplemented in G3D::AxesShape.

virtual AABox G3D::Shape::boundingAABox (  )  const [pure virtual]

Bounding axis aligned box of this object.

Implemented in G3D::MeshShape, G3D::BoxShape, G3D::CylinderShape, G3D::SphereShape, G3D::CapsuleShape, G3D::PlaneShape, and G3D::PointShape.

virtual Sphere G3D::Shape::boundingSphere (  )  const [pure virtual]

virtual const Box& G3D::Shape::box (  )  const [inline, virtual]

Reimplemented in G3D::BoxShape.

virtual Box& G3D::Shape::box (  )  [inline, virtual]

Reimplemented in G3D::BoxShape.

virtual const Capsule& G3D::Shape::capsule (  )  const [inline, virtual]

Reimplemented in G3D::CapsuleShape.

virtual Capsule& G3D::Shape::capsule (  )  [inline, virtual]

Reimplemented in G3D::CapsuleShape.

virtual Vector3 G3D::Shape::center (  )  const [pure virtual]

virtual const Cylinder& G3D::Shape::cylinder (  )  const [inline, virtual]

Reimplemented in G3D::CylinderShape.

virtual Cylinder& G3D::Shape::cylinder (  )  [inline, virtual]

Reimplemented in G3D::CylinderShape.

virtual void G3D::Shape::getRandomSurfacePoint ( Vector3 P,
Vector3 N = Vector3::dummy 
) const [pure virtual]

A point selected uniformly at random with respect to the surface area of this object.

Not available on the Plane or Ray, which have infinite extent. The normal has unit length and points out of the surface.

Implemented in G3D::MeshShape, G3D::BoxShape, G3D::RayShape, G3D::AxesShape, G3D::CylinderShape, G3D::SphereShape, G3D::CapsuleShape, G3D::PlaneShape, and G3D::PointShape.

virtual const Array<int>& G3D::Shape::indexArray (  )  const [inline, virtual]

Reimplemented in G3D::MeshShape.

virtual const Plane& G3D::Shape::plane (  )  const [inline, virtual]

Reimplemented in G3D::PlaneShape.

virtual Plane& G3D::Shape::plane (  )  [inline, virtual]

Reimplemented in G3D::PlaneShape.

virtual const Vector3& G3D::Shape::point (  )  const [inline, virtual]

Reimplemented in G3D::PointShape.

virtual Vector3& G3D::Shape::point (  )  [inline, virtual]

Reimplemented in G3D::PointShape.

virtual Vector3 G3D::Shape::randomInteriorPoint (  )  const [pure virtual]

A point selected uniformly at random with respect to the volume of this object.

Not available on objects with infinite extent.

Implemented in G3D::MeshShape, G3D::BoxShape, G3D::RayShape, G3D::AxesShape, G3D::CylinderShape, G3D::SphereShape, G3D::CapsuleShape, G3D::PlaneShape, and G3D::PointShape.

virtual const Ray& G3D::Shape::ray (  )  const [inline, virtual]

Reimplemented in G3D::RayShape.

virtual Ray& G3D::Shape::ray (  )  [inline, virtual]

Reimplemented in G3D::RayShape.

void G3D::ReferenceCountedObject::ReferenceCountedObject_zeroWeakPointers (  )  [inline, inherited]

Automatically called immediately before the object is deleted.

This is not called from the destructor because it needs to be invoked before the subclass destructor.

virtual void G3D::Shape::render ( class RenderDevice rd,
const CoordinateFrame cframe,
Color4  solidColor = Color4(.5,.5, 0,.5),
Color4  wireColor = Color3::black() 
) [pure virtual]

virtual const Sphere& G3D::Shape::sphere (  )  const [inline, virtual]

Reimplemented in G3D::SphereShape.

virtual Sphere& G3D::Shape::sphere (  )  [inline, virtual]

Reimplemented in G3D::SphereShape.

virtual Type G3D::Shape::type (  )  const [pure virtual]

static std::string G3D::Shape::typeToString ( Type  t  )  [static]

virtual const Array<Vector3>& G3D::Shape::vertexArray (  )  const [inline, virtual]

Reimplemented in G3D::MeshShape.

virtual float G3D::Shape::volume (  )  const [pure virtual]


Member Data Documentation

The long name is to keep this from accidentally conflicting with a subclass's variable name.

Do not use or explicitly manipulate this value--its type may change in the future and is not part of the supported API.

Linked list of all weak pointers that reference this (some may be on the stack!).

Do not use or explicitly manipulate this value.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:47 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo