#ifndef _HAIR_VR_STATIC_tri_VOXEL_PRIMITIVE_H_ #define _HAIR_VR_STATIC_tri_VOXEL_PRIMITIVE_H_ // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 /********************************************************************** *< FILE: shaveVrayStaticTriVoxelPrim.h DESCRIPTION: Staic (non motion blurred) hair instanced hair voxel primitive CREATED BY: Vladimir Dubovoy HISTORY: created 12-05-2010 *> **********************************************************************/ #include "shaveVrayTriVoxelPrim.h" #include "hairprimitives.h" #include class shaveVrayStaticTriVoxelPrim : public shaveVrayTriVoxelPrim, public VR::StaticPrimitive { public: shaveVrayStaticTriVoxelPrim(IHairVoxel* voxel, VR::VRayCore *vray, shaveVrayInstanceI* inst); virtual ~shaveVrayStaticTriVoxelPrim(); /* | from StaicPrimitive */ // Return the bounding box of this primitive. void getBBox (VR::StaticBox &bbox); //Return true if the primitive is splittable. bool splittable (); //Return the bounding boxes of the primitive with respect to a given plane. void split (int dim, VR::real middle, VR::StaticBox &bLeft, VR::StaticBox &bRight); //Return true here int expandable(); //Expand the primitive into other sub-primitives. int expand (VR::DynamicRaycaster< VR::StaticBox > *raycaster, int threadIndex); //Collapse the primitive. int collapse (VR::DynamicRaycaster< VR::StaticBox > *raycaster, int threadIndex); /* | from GeometryGenerator */ void setIntersectionData(VR::RSRay &rsray, void *isData); #if defined VRAY30 void setIntersectionData(const VR::RayBunchParams& params, VR::PrimitiveIntersections& result, const RAY_IDX* idxs, size_t count); #endif #ifdef OWN_SHADEABLE_FOR_TRI VR::Shadeable* getShadeable() { return shade(); } #else VR::Shadeable* getShadeable() { return shdata(); } #endif VR::VRayShadeInstance* getExtShadeData() { return NULL; } VR::VRayShadeData* getExtTexMapping() { return shdata(); } VR::VRayVolume* getVolumeShader() { return NULL; } VR::VRaySurfaceProperties* getExtSurfaceProperties() { return NULL; } protected: //const member access inline const std::vector& normals() const {return m_normals;} inline const VR::Vector& normal(int i) const {return m_normals[i];} inline const VR::StaticTriangle& tri(int i) const {return m_tris[i];} inline VR::StaticTriangle* tris() const {return m_tris;} inline int firstid() const {return m_firstid;} //member access inline std::vector& _normals() {return m_normals;} inline VR::Vector& _normal(int i) {return m_normals[i];} inline VR::StaticTriangle& _tri(int i) {return m_tris[i];} inline VR::StaticTriangle*& _tris() {return m_tris;} inline int& _firstid() {return m_firstid;} private: int m_firstid; VR::StaticTriangle* m_tris; std::vector m_normals; }; #endif //end of_HAIR_VR_STATIC_tri_VOXEL_PRIMITIVE_H_