#include <lib_sculptbrush.h>
The brush data for an individual dab. This is passed into the method defined by the user in SculptBrushParams::SetMovePointFunc.
Private Member Functions | |
BrushDabData () | |
~BrushDabData () | |
|
private |
|
private |
const BaseContainer* GetData | ( | ) |
Gets the settings data for the brush.
const SculptObject* GetObject | ( | ) |
Gets the sculpt object that the dab is for.
const BrushPointData* GetPointData | ( | ) |
Gets the list of points that are affected by the brush.
const BrushPolyData* GetPolyData | ( | ) |
Gets the list of the polygons that are affected by the brush.
PolygonObject* GetPolygonObject | ( | ) |
Gets the PolygonObject for the SculptObject that is currently being displayed in the viewport.
PolygonObject* GetBaseObject | ( | ) |
Gets the original object that the SculptTag is applied to.
Int32 GetPointCount | ( | ) |
Gets the number of points that are touched by the dab.
Int32 GetPolyCount | ( | ) |
Gets the number of polygons that are touched by the dab.
Neighbor* GetNeighbor | ( | ) |
Gets the Neighbor information for the SculptObject if it is currently at level 0.
SculptLayer* GetLayer | ( | ) |
Gets the currently selected Layer for a subdivided SculptObject.
const Vector* GetPoints | ( | ) |
Retrieves the live points that are modified on the surface during a brush stroke.
These points may already have been modified by previous brush dabs during the current brush stroke.
const Vector32* GetOriginalPoints | ( | ) |
Retrieves a copy of the points in their state before the brush stroke started.
Use these points to compare where the surface was before the user started sculpting.
Vector GetNormal | ( | ) |
Gets the normal at the current hit point for the dab.
This is the average vertex normal of all the points that are affected by the dab.
Vector GetDrawDirectionNormal | ( | ) |
If the brush supports the Draw Direction, i.e. the user has set SculptBrushParams::EnableDrawDirection(true),
then this returns the direction selected by the user, otherwise it just returns the same vector as GetNormal().
Float GetBrushStrength | ( | ) |
Gets the brush strength for the dab.
Float GetBrushRadius | ( | ) |
Gets the brush radius for the dab.
Vector GetMousePos3D | ( | ) |
If the brush mode is ref SCULPTBRUSHMODE::GRAB then this method can be used to get the location of the mouse pointer in world space in the scene.
Vector(0,0,0)
. Vector GetHitPoint | ( | ) |
Gets the point on the surface of the SculptObject where the dab is going to be placed. This is the center of the dab.
Vector GetLastHitPoint | ( | ) |
Gets the hit point for the previous dab during the stroke.
Int32 GetHitPolygon | ( | ) |
Gets the index of the polygon on the surface of the SculptObject where the dab is going to be placed. This is the center of the dab.
Vector GetEyePoint | ( | ) |
Gets the location of the mouse in local space above the model.
Bool IsMirroredDab | ( | ) |
Checks if the dab is for a mirrored brush stroke.
OVERRIDE GetBrushOverride | ( | ) |
BaseDraw* GetBaseDraw | ( | ) |
Gets the view that the user is currently drawing in.
Gets the average point and normal.
The returned values depend on what the fixed plane (MDATA_SCULPTBRUSH_SETTINGS_FIXEDPLANE) setting is for the brush:
[out] | averagePoint | Assigned the average point based on the fixed plane settings. |
[out] | normal | Assigned the normal based on the fixed plane setting. |
void ApplySmooth | ( | ) |
Applies an effect of the smooth brush to the current dab.
const Vector32* GetVertexNormals | ( | ) |
Gets the vertex normals for the SculptObject.
const Vector32* GetOriginalVertexNormals | ( | ) |
Gets the state of the vertex normals before the user started a brush stroke.
const Vector32* GetFaceNormals | ( | ) |
Gets the face normals for the SculptObject.
Gets a value which represents the scale of the SculptObject.
[in] | noRadius | true means it does not take into account the radius of the object in its calculation and only uses the scale. |
Float GetBrushFalloff | ( | Int32 | index, |
Vector32 * | pRetStencilColor = nullptr , |
||
Float * | pCustomDistance = nullptr |
||
) |
Retrieves the brush falloff for the brush point at index.
The falloff is already adjusted by using the values from the stamp and stencil so it can be used directly to adjust the strength of an offset to add to the layer.
[in] | index | The index of the point on the SculptObject. This index can be found for the current point using BrushPointData.pointIndex. |
[out] | pRetStencilColor | Assigned the color of the stencil. This saves an additional call to GetStencilColor(). |
[in] | pCustomDistance | The custom distance to use. Internally this method uses the distance that the point is from the hit point in its calculation (BrushPointData::distance). Pass a value instead to use custom distance. |
Retrieves the falloff value, defined by the falloff curve, based on the distance from input pos to the hit point for the dab.
[in] | pos | A point in 3D space to get the falloff for. |
void OffsetPoint | ( | Int32 | index, |
const Vector & | offset, | ||
Vector32 * | pVertexColor = nullptr , |
||
SCULPTOFFSETFLAGS | flags = SCULPTOFFSETFLAGS::NONE |
||
) |
Offsets the brush point at index point on the layer by the given offset amount.
[in] | index | The index of the point on the SculptObject. This index can be found for the current point using BrushPointData.pointIndex. |
[in] | offset | The vector to offset the point by. |
[in] | pVertexColor | Private. Used internally. |
[in] | flags | The flags to let use or ignore settings such as the layers mask or strength when offsetting the point: SCULPTOFFSETFLAGS By setting the SCULPTOFFSETFLAGS::IGNOREMASK flag it will ignore whatever the mask checkbox state is for the layer Otherwise it uses this state to determine if it should use the mask. |
Bool IsPreviewDab | ( | ) |
Checks if the dab is a preview dab.
void OffsetPreviewPoint | ( | Int32 | index, |
const Vector & | offset, | ||
SCULPTOFFSETFLAGS | flags = SCULPTOFFSETFLAGS::NONE |
||
) |
If IsPreviewDab() returns true then apply the offset using this method.
This adds the offset to a temporary preview layer that is created when using the DragDab and DragRect draw modes.
[in] | index | The index of the point on the SculptObject. This index can be found for the current point using BrushPointData.pointIndex. |
[in] | offset | The vector to offset the point by. |
[in] | flags | The flags to let use or ignore settings such as the layers mask or strength when offsetting the point: SCULPTOFFSETFLAGS By setting the SCULPTOFFSETFLAGS::IGNOREMASK flag it ignores whatever the mask checkbox state is for the layer. Otherwise it uses this state to determine if it should use the mask. |
void DirtyAllPoints | ( | SCULPTBRUSHDATATYPE | type | ) |
Makes dirty all the points for the dab according to the SCULPTBRUSHDATATYPE.
[in] | type | The type to use for the brush data to make dirty. |
Checks if another brush stroke has changed a point.
[in] | index | The index of the point on the SculptObject. This index can be found for the current point using BrushPointData.pointIndex. |
Float GetStencilColor | ( | const Vector & | point, |
Vector32 * | pRetColor = nullptr , |
||
Vector32 * | pRetCoords = nullptr , |
||
SAMPLEMODE | mode = SAMPLEMODE::TAKEONEPIXEL |
||
) |
Retrieves the color and gray values of the stencil for a point in the SculptObject local space.
[in] | point | A point on the surface of the SculptObject for which to get a color for. |
[out] | pRetColor | Assigned the color of the stencil. |
[out] | pRetCoords | Assigned the returned coordinates of the pixel on the stencil bitmap. |
[in] | mode | The sample mode used to sample the stencil texture: SAMPLEMODE |
Float GetStampColor | ( | const Vector & | point, |
Float | distanceFromHitPoint, | ||
Vector32 * | pRetColor = nullptr , |
||
Vector32 * | pRetCoords = nullptr , |
||
SAMPLEMODE | mode = SAMPLEMODE::TAKEONEPIXEL |
||
) |
Retrieves the color and gray values of the stamp for a point in the SculptObject local space.
[in] | point | A point in the SculptObject coordinate system which is used to sample the stamp on the current dab. |
[in] | distanceFromHitPoint | Can be either the BrushPointData.distance value, the length of the vector (hit point - point) or a custom distance value. This is used to get the correct falloff for the point. |
[out] | pRetColor | Assigned the color of the stamp. |
[out] | pRetCoords | Assigned the coordinates of the pixel on the stamp bitmap. |
[in] | mode | The sample mode used to sample the stencil texture: SAMPLEMODE |
const BaseBitmap* GetStencil | ( | ) |
Get the stencil used for the dab.
const BaseBitmap* GetStamp | ( | ) |
Gets the stamp used for the dab.
SculptBrushToolData* GetBrush | ( | ) |
Gets the Brush being used. This only returns the brush if SculptBrushParams::EnableBrushAccess(true) has been set.
Int32 GetStrokeInstanceID | ( | ) |
Gets the ID of the stroke instance that the dab is being drawn for.
Bool IsSculptObject | ( | ) |
Checks if the object being touched is a SculptObject (i.e. it has a SculptTag).
Gets the mirrored point (or Normal) from the objects space to the correct location for the current dab.
[in] | point | The input point, or normal, to mirror. |
[in] | isNormal | Set to true if the point is a normal, the point is then only rotated and not offseted. |
Float32* GetMaskCache | ( | ) |
Gets the current mask values for the PolygonObject.
Averages out the values for a vertex on the PolygonObject.
[in] | vertex | The vertex number on the PolygonObject to get the average value for. |
[out] | values | The values to average out. This must contains the same number of values as there are points on the PolygonObject. |
Averages out the values for a vertex on the PolygonObject.
[in] | vertex | The vertex number on the PolygonObject to get the average value for. |
[in] | values | The values to average out. This must contains the same number of values as there are points on the PolygonObject. |
Checks if a point is within the drawn fill area.
[in] | p | A point in local space to check. |
Bool IsBackface | ( | ) |
Returns true if this dab is being applied backfacing polygons.