PaintTool (interface)¶
バージョン 2.0 で追加.
PaintTool is the interface for Painting tools.
注釈
This is a work in progress, needs to be generalized to abstract the type of attribute being painted.
参考
BasePaintTool, RTRBasePaintTool
Functions¶
Vec3 | computeDisplacementDir ? ( in Ref<PolygonMesh> mesh ) |
ensureAttributeExists ! ( io Ref<Geometry> geometry, in Boolean resetValues ) | |
paintPolygons ! ( io Ref<PolygonMesh> mesh, in GeometryLocation location ) | |
Ref<Geometry> | rayCast ! ( io MouseEvent mouseEvent, io GeometryLocation location, io Mat44 transform, io Vec3 position ) |
reset ! () | |
setPointAttribute ! ( in Index i, in Float32 weight, in Vec3 displacementDir, io Ref<PolygonMesh> mesh ) | |
smoothPointAttribute ! ( in Index i, in Float32 weight, in Vec3 displacementDir, io Ref<PolygonMesh> mesh ) | |
toolTransformChanged ! ( in Mat44 transform ) |
Functions in detail¶
Vec3 PaintTool.computeDisplacementDir? ( in Ref<PolygonMesh> mesh )
Computes the average normal direction within a certain radius around of a hit-point.
mesh | A reference to the PolygonMesh. |
PaintTool.ensureAttributeExists! ( io Ref<Geometry> geometry, in Boolean resetValues )
Creates or resets the geometry attributes.
geometry | The geometry to create/reset. |
resetValues | If true, reset the attributes. |
PaintTool.paintPolygons! ( io Ref<PolygonMesh> mesh, in GeometryLocation location )
Paints polygons mesh attributes.
mesh | A reference to the PolygonMesh. |
location | The mesh location. |
Ref<Geometry> PaintTool.rayCast! ( io MouseEvent mouseEvent, io GeometryLocation location, io Mat44 transform, io Vec3 position )
Casts a ray in the scene and gets the hit geometry. Returns null if not hit.
mouseEvent | The mousevent event when the user clicks in the viewport. |
location | The geometry location (where the geo has been hit). |
transform | The geometry transform in the scene. |
position | The hit point position, in wolrd coordinates. |
PaintTool.reset! ()
Resets all the geometry attributes used for painting.
PaintTool.setPointAttribute! ( in Index i, in Float32 weight, in Vec3 displacementDir, io Ref<PolygonMesh> mesh )
Sets the point attributes of a polygons mesh. The type of attributes depends of the tool : (position + normal for sculpting, color for paiting).
i | The index of the point. |
weight | The weight of the attributes. |
displacementDir | The average normal direction at this point. |
mesh | A reference to the PolygonMesh. |
PaintTool.smoothPointAttribute! ( in Index i, in Float32 weight, in Vec3 displacementDir, io Ref<PolygonMesh> mesh )
Smooths the point attributes of a polygons mesh.
i | The index of the point. |
weight | The weight of the attributes. |
displacementDir | The average normal direction at this point. |
mesh | A reference to the PolygonMesh. |
PaintTool.toolTransformChanged! ( in Mat44 transform )
Updates the transformation (position and orientation).
transform | The new transform. |