#ifndef rtl_soft_h #define rtl_soft_h #ifdef CSOFT #include <csoft/csoft_all.h> #endif #ifdef JBT #include <jbt/jbt.h> #endif #include "groupobject.h" #ifdef CSOFT class csoft_object; class csoft_mapgroup; class rtl_softvoxel; class rtl_soft : public rtl_groupobj { public: rtl_soft( csoft_object*, bool kill = true ); ~rtl_soft(); csoft_object* object() { return obj; }; static jUInt SUBN; Type type() const { return objCSOFT; } protected: static const jInt Depth; static const jULng KillCsoftObj; jFlt lclintersect( const rtl_ray& ); jNorm3 lclnormal(const jVec3& p); csoft_object* obj; jFlt minin, maxout; class rtl_softvoxel : public rtl_groupmem { public: rtl_softvoxel( rtl_soft*, const jBBox& ); virtual jFlt intersect(const rtl_ray& ray, bool rehit = false); virtual jNorm3 normal() { return soft()->obj->get_normal(soft()->objectspace()); }; private: rtl_soft *soft() { return ((rtl_soft*)mobj); } }; friend class rtl_soft::rtl_softvoxel; }; class rtl_softmat : public rtl_material { public: rtl_softmat( rtl_soft* ); void surface( rtl_ray&, const jVec3&, jNorm3& ); protected: csoft_attribs A; jColour c; jFlt tr; bool first; jColour mkt; rtl_soft* sobj; }; #endif #ifdef JBT class rtl_jbt : public rtl_object { public: rtl_jbt( jbt_blobtree*, bool _kill = true ); ~rtl_jbt(); jbt_blobtree* object() { return bt; } Type type() const { return objJBT; } class material : public rtl_material { public: material( rtl_jbt* ); void surface( rtl_ray&, const jVec3&, jNorm3& ); private: rtl_jbt* jbt; }; protected: jFlt lclintersect( const rtl_ray& ); jNorm3 lclnormal( const jVec3& ); jVec2 uv( const jVec3& ); jbt_blobtree* bt; jFlt lg; bool kill; }; #endif #endif