librtl

sobject.h

This is the verbatim text of the sobject.h include file.
#ifndef sobject_h
#define sobject_h

#include <jgl/linearalgebra.h>
#include <jgl/boundingbox.h>
#include "flags.h"
#include "ray.h"
#include "material.h"
#include "collect_alloc.h"

class rtl_object;


class rtl_subobject : public dyn_collectable
{
public:

    

    virtual jFlt intersect( const rtl_ray& ray, bool = false );
    


    virtual jNorm3 normal() = 0;


    virtual bool volintersect( const jBBox& b ) const
        { return bnd.intersect(b); }
    

    const jBBox& bounds() const { return bnd; }


    virtual rtl_material* material() { return &rtl_material::Default; }


    const rtl_flags& flags() const { return f; }


    rtl_flags& flags() { return f; }


    virtual const rtl_subobject* subobject() const { return this; }
    

    virtual const rtl_object* group() const { return 0; }


    virtual void setBounds( const jBBox& _b ) { bnd = _b; }


    static const jULng NegateNormal;


    static const jULng Bounded;

protected:

    rtl_subobject();

    jBBox bnd;
    
    rtl_flags f;

    jUInt raysig;
    jFlt t;
};

#endif


JSP / librtl v0.2 mtigges@cpsc.ucalgary.ca