#ifndef DUST3D_MESH_STROKETIFIER_H #define DUST3D_MESH_STROKETIFIER_H #include #include #include #include class MeshStroketifier : public QObject { Q_OBJECT public: struct Node { QVector3D position; float radius; }; void setCutRotation(float cutRotation); void setDeformThickness(float deformThickness); void setDeformWidth(float deformWidth); bool prepare(const std::vector &strokeNodes, const std::vector &vertices); void stroketify(std::vector *vertices); void stroketify(std::vector *nodes); private: float m_cutRotation = 0.0; float m_deformThickness = 1.0; float m_deformWidth = 1.0; QVector3D m_modelOrigin; float m_modelLength = 0.0; float m_scaleAmount = 1.0; QVector3D m_modelAlignDirection; QVector3D m_modelBaseNormal; std::vector m_modelJointPositions; std::vector m_modelTransforms; QMatrix4x4 m_modelRotation; static float calculateStrokeLengths(const std::vector &strokeNodes, std::vector *lengths); static void calculateBoundingBox(const std::vector &vertices, float *minX, float *maxX, float *minY, float *maxY, float *minZ, float *maxZ); void translate(std::vector *vertices); void scale(std::vector *vertices); void transform(std::vector *vertices); void rotate(std::vector *vertices); void deform(std::vector *vertices); }; #endif