#ifndef _HAIR_VR_MOVING_tri_VOXEL_PRIMITIVE_H_ #define _HAIR_VR_MOVING_tri_VOXEL_PRIMITIVE_H_ // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 /********************************************************************** *< FILE: shaveVrayMovingTriVoxelPrim.h DESCRIPTION: Moving (motion blurred) hair instanced hair voxel primitive CREATED BY: Vladimir Dubovoy HISTORY: created 20-05-2010 *> **********************************************************************/ #include "shaveVrayTriVoxelPrim.h" #include "hairprimitives.h" #include class shaveVrayMovingTriVoxelPrim : public shaveVrayTriVoxelPrim, public VR::MovingPrimitive { public: shaveVrayMovingTriVoxelPrim(IHairVoxel* voxel, VR::VRayCore *vray, shaveVrayInstanceI* inst); virtual ~shaveVrayMovingTriVoxelPrim(); /* | from MovingPrimitive */ // Return the bounding box of this primitive. void getBBox (VR::MovingBox &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::MovingBox &bLeft, VR::MovingBox &bRight); //Return true here int expandable(); //Expand the primitive into other sub-primitives. int expand (VR::DynamicRaycaster< VR::MovingBox > *raycaster, int threadIndex); //Collapse the primitive. int collapse (VR::DynamicRaycaster< VR::MovingBox > *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 VR::MovingBox& bbox() const {return m_bbox;} inline const std::vector& normals() const {return m_normals;} inline const VR::Vector& normal(int i) const {return m_normals[i];} inline const VR::MovingTriangle& tri(int i) const {return m_tris[i];} inline VR::MovingTriangle* tris() const {return m_tris;} inline int firstid() const {return m_firstid;} //inline int numblur() const {return m_numblur;} //member access inline VR::MovingBox& _bbox() {return m_bbox;} inline std::vector& _normals() {return m_normals;} inline VR::Vector& _normal(int i) {return m_normals[i];} inline VR::MovingTriangle& _tri(int i) {return m_tris[i];} inline VR::MovingTriangle*& _tris() {return m_tris;} inline int& _firstid() {return m_firstid;} //inline int& _numblur() {return m_numblur;} private: VR::MovingBox m_bbox; int m_firstid; //int m_numblur; //it is just 2 VR::MovingTriangle* m_tris; std::vector m_normals; }; #endif //end of_HAIR_VR_MOVING_tri_VOXEL_PRIMITIVE_H_