#ifndef shaveVertexShader_h #define shaveVertexShader_h // Shave and a Haircut // (c) 2019 Epic Games // US Patent 6720962 #include #include #include #include #include #include #include class shaveVertexShader : public MPxNode { public: shaveVertexShader(); virtual ~shaveVertexShader(); virtual MStatus compute(const MPlug&, MDataBlock&); virtual void postConstructor(); #if MAYA_API_VERSION >= 201600 virtual SchedulingType schedulingType() const { return kUntrusted; } #endif static void* creator(); static MStatus initialize(); static MTypeId id; static const MString nodeTypeName; private: static inline float dotProduct(const MFloatVector&, const MFloatVector&); // Input attributes static MObject pointAttr; static MObject surfaceIndexAttr; static MObject objectIdAttr; static MObject primitiveIdAttr; // Output attributes static MObject outColorAttr; static MObject outAlphaAttr; // // Local members. // }; inline float shaveVertexShader::dotProduct( const MFloatVector& v1, const MFloatVector& v2 ) { return (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z); } #endif