librtl

rtl_object Class Reference

Standard base class for complex geometric objects. More...

#include <object.h>

Inherits rtl_subobject.

Inherited by rtl_box, rtl_csg, rtl_groupobj, rtl_jbt, rtl_plane, rtl_quadric, rtl_superellipsoid and rtl_torus.

List of all members.

Public Members

Static Public Members

Protected Members


Detailed Description

Standard base class for complex geometric objects.

This class provides the functionality for all objects that rays can intersect. Each object inheriting this class must implement:

<kbd>lclintersect</kbd>
<kbd>lclnormal</kbd>
Additionally they should implement:
<kbd>uv</kbd>

Examples:
Polyhedrons.

Member Enumeration Type Documentation

enum rtl_object::Type

Enumeration values:


Member Function Documentation

rtl_object::~rtl_object()

inline jFlt rtl_object::intersect( const rtl_ray&, bool = false )

Intersects a ray with this object. This function transforms the ray into object space and calls lclintersect.

Reimplemented from rtl_subobject.

Reimplemented in rtl_polyhedron and rtl_groupobj.

inline jNorm3 rtl_object::normal()

Returns the normal at the position of the last successfull intersection calculation.

Reimplemented from rtl_subobject.

virtual rtl_material* rtl_object::material() [virtual]

Returns the material for this object.

Reimplemented from rtl_subobject.

Reimplemented in rtl_polyhedron.

virtual void rtl_object::setMaterial( rtl_material* ) [virtual]

Set the material for this object. This function should be overridden if an object is a container for other objects and the material should be passed down an hierarchy.

Reimplemented in rtl_polyhedron, rtl_cylinder and rtl_cone.

const jMat4& rtl_object::T() const

Return the transformation matrix for this object. This matrix transforms an object from object space to world space.

const jMat4& rtl_object::iT() const

Return the inverse of the transformation matrix This matrix transforms an object from world space to object space.

virtual const jVec3& rtl_object::rootobjectspace() const [virtual]

Return the point in object space of the last successful intersection calculation. This function will return the object space location in the CSG tree if the object is one, if the object is not a CSG tree then the return is identical to objectspace().

void rtl_object::setBounds( const jBBox& )

Set the bounding box for this object (in object space). This function should not be called after an object has been added to a rtl_world object.

Reimplemented from rtl_subobject.

jUInt rtl_object::index() const

Returns a unique id for the object in the scene that it is in.

void rtl_object::scale( const jVec3& )

Scales this object by the given vector, should not be called after the object has been added to a rtl_world.

void rtl_object::translate( const jVec3& )

Translates this object by the given vector, should not be called after the object has been added to a rtl_world.

void rtl_object::rotate( jUInt, jFlt )

Rotates this object about the given axis by the given degrees, should not be called after the object has been added to a rtl_world.

virtual jVec2 rtl_object::uv( const jVec3& ) [virtual]

Computes a 2D parameterization of the surface for the given position. This function should be overridden or texturing will not be appropriate.

Reimplemented in rtl_torus, rtl_sphere, rtl_polyhedron, rtl_plane, rtl_jbt, rtl_floor, rtl_cylinder, rtl_csg and rtl_cone.

bool rtl_object::volintersect( const jBBox& B ) const

Returns true if this object intersects with the given bounding box.

Reimplemented from rtl_subobject.

Reimplemented in rtl_polyhedron.

virtual const jVec3& rtl_object::objectspace() const [virtual]

Return the point in object space of the last successful intersection calculation. This function will return the object space location of the primitive struck if the object is a CSG tree.

Reimplemented in rtl_csg.

virtual void rtl_object::transformation( const jMat4& ) [virtual]

Sets the transformation for the object. This function should only be called by class rtl_world when the object is added to the scene. It also sets the bounding box for the scene and so forth.

virtual Type rtl_object::type() const [virtual]

Reimplemented in rtl_torus, rtl_superellipsoid, rtl_sphere, rtl_soft, rtl_polyhedron, rtl_jbt, rtl_floor, rtl_cylinder, rtl_csg, rtl_cone and rtl_box.

rtl_object::rtl_object() [protected]

virtual rtl_object* rtl_object::laststruck() [protected, virtual]

Reimplemented in rtl_csg.

virtual jFlt rtl_object::lclintersect( const rtl_ray& ) = 0 [protected, pure virtual]

Reimplemented in rtl_torus, rtl_superellipsoid, rtl_soft, rtl_quadric, rtl_plane, rtl_jbt, rtl_infcone, rtl_groupobj, rtl_floor, rtl_csg and rtl_box.

virtual jNorm3 rtl_object::lclnormal( const jVec3& ) = 0 [protected, pure virtual]

Reimplemented in rtl_torus, rtl_superellipsoid, rtl_sphere, rtl_soft, rtl_plane, rtl_jbt, rtl_infcylinder, rtl_infcone, rtl_groupobj, rtl_csg and rtl_box.

virtual void rtl_object::objectspace( const jVec3& _osi ) [protected, virtual]

Reimplemented in rtl_csg.

virtual jFlt rtl_object::rehit() [protected, virtual]

Reimplemented in rtl_quadric, rtl_csg and rtl_box.


Member Data Documentation

const jULng rtl_object::Entrance [static]

const jULng rtl_object::Rehittable [static]

const jULng rtl_object::ShadowCaster [static]

jVec3 rtl_object::osi [protected]

jMat4 rtl_object::mT [protected]

jMat4 rtl_object::miT [protected]

rtl_material* rtl_object::mat [protected]

Reimplemented in rtl_groupobj.

rtl_ray rtl_object::tray [protected]

jFlt rtl_object::t [protected]

Reimplemented from rtl_subobject.

jUInt rtl_object::objidx [protected]


The documentation for this class was generated from the following file:
JSP / librtl v0.2 mtigges@cpsc.ucalgary.ca