#include <lib_hair.h>
Helper class for guides/hair.
Static Public Member Functions | |
static HairGuides * | Alloc (Int32 count, Int32 segments) |
static void | Free (HairGuides *&guides) |
Private Member Functions | |
HairGuides () | |
~HairGuides () | |
|
private |
|
private |
|
static |
Allocates a hair guides helper. Destroy the allocated hair guides helper with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
[in] | count | The number of guides. |
[in] | segments | The number of segments per guide. |
|
static |
Int32 GetCount | ( | ) |
Gets the number of guides.
Int32 GetSegmentCount | ( | ) |
Gets the number of segments per guide.
Int32 GetPointCount | ( | void | ) |
Gets the total number of points for all guides.
Int32 GetGuidePointCount | ( | ) |
Gets the number of points per segment i.e. GetSegmentCount() + 1.
Vector* GetPoints | ( | ) |
Retrieves a pointer to the point vectors for the guides.
HairGuideDynamics* GetDynamics | ( | ) |
Gets the dynamics.
Matrix GetMg | ( | ) |
Gets the global matrix.
void SetMg | ( | const Matrix & | mg | ) |
Sets the global matrix.
[in] | mg | The new global matrix. |
HairRootData GetRoot | ( | Int32 | index | ) |
Gets the root data for the specified guide index.
[in] | index | The guide index: 0 <= index < GetCount() |
void SetRoot | ( | Int32 | index, |
const HairRootData & | root, | ||
Bool | update | ||
) |
Sets the root data for the specified guide index.
[in] | index | The guide index: 0 <= index < GetCount() |
[in] | root | The new root data. |
[in] | update | If true then an update is made. |
HairObject* GetObject | ( | ) |
Gets the corresponding hair object.
Bool GetSelected | ( | Int32 | mode, |
BaseSelect * | select | ||
) |
Gets the selection state.
[in] | mode | The selection mode: HAIR_MODE |
[out] | select | Assigned the selection. |
Bool SetSelected | ( | Int32 | mode, |
BaseSelect * | select | ||
) |
Sets the selection state.
[in] | mode | The selection mode: HAIR_MODE |
[out] | select | The new selection. |
Bool ConvertSelection | ( | Int32 | from_mode, |
Int32 | to_mode, | ||
BaseSelect * | from_select, | ||
BaseSelect * | to_select | ||
) |
Bool CopyFrom | ( | const HairGuides * | src | ) |
Copies the guide data from src.
[in] | src | The source hair guides helper. |
Gets the tangent of guide at segment and t.
[in] | guide | The guide index: 0 <= guide < GetCount() |
[in] | segment | The segment index: 0 <= segment < GetSegmentCount() |
[in] | t | The T coordinate. |
SplineObject* CreateSpline | ( | ) |
Creates splines from the guides.
void ToLocal | ( | ) |
Changes all the points for the guides into a local coordinate system.
void ToWorld | ( | ) |
Changes all the points for the guides into the world coordinate system.
void ToInitial | ( | Bool | align | ) |
Changes the coordinate space and transforms the points back to their initial state.
This is useful when applying coordinate Dependant changes to the points, by moving them back to an initial state the changes are not affecting when the guide roots move due to animation.
[in] | align | If true the guides are rotated from their root back to their initial orientation. |
void DisplaceRoots | ( | ) |
Used when HNs have affected the guide roots. Call DisplaceRoots() and it will ensure they are in the correct displaced state for HNs, UndisplaceRoots() will make sure they are not.
Generally not needed if using ToInitial(), as the initial state is undisplaced.
void UndisplaceRoots | ( | ) |
Bool GetRootAxis | ( | Int32 | index, |
Matrix & | m, | ||
Bool | bAlign = false , |
||
Bool | bLocal = true , |
||
Bool | bInitial = false , |
||
Bool | bZAxis = false |
||
) |
Gets the root axis of guide index.
[in] | index | The guide index: 0 <= index < GetCount() |
[out] | m | Filled with the root axis. |
[in] | bAlign | Aligned. |
[in] | bLocal | Local. |
[in] | bInitial | Initial. |
[in] | bZAxis | If true then the alignment is done along the Z axis, otherwise it is Y. |
Gets the root UV for guide index.
[in] | index | The guide index: 0 <= index < GetCount() |
Bool GetRootData | ( | Int32 | index, |
Vector * | p = nullptr , |
||
Vector * | n = nullptr , |
||
Int32 * | ply_id = nullptr , |
||
Bool | bLocal = true , |
||
Bool | bDisplaced = true , |
||
Bool | bInitial = false |
||
) |
Gets the root data.
[in] | index | The guide index: 0 <= index < GetCount() |
[out] | p | Assigned the point. |
[out] | n | Assigned the normal. |
[out] | ply_id | Assigned the polygon ID.. |
[in] | bLocal | Local. |
[in] | bDisplaced | Displaced. |
[in] | bInitial | Initial. |
Matrix* GetTransformMatrix | ( | ) |
Gets the transformation matrix array.
void SetTransformMatrix | ( | Matrix * | tm | ) |
Sets a new array of transformation matrices.
[in] | tm | The new transformation matrix array. Each matrix element is an axis at the root of each guide. |
Bool Delete | ( | BaseSelect * | bs | ) |
Deletes the guide selection.
[out] | bs | The selection to delete. |
Adds a root.
[in] | ply_id | The polygon ID. |
[in] | s | The S coordinate. |
[in] | t | The T coordinate. |
[in] | len | The length. |
Bool GetRootObject | ( | RootObjectData * | pData | ) |
Gets the root object data.
[out] | pData | Filled with the root object data. |
Bool LinkToObject | ( | HairObject * | pHair | ) |
Links this to a specific HairObject.
[in] | pHair | A hair object. |
Int32 GetFlags | ( | ) |
Gets the flags.