LuxCore
2.0
|
HAIR file class. More...
#include <cyHairFile.h>
Public Member Functions | |
cyHairFile () | |
~cyHairFile () | |
Constant Data Access Methods | |
const cyHairFileHeader & | GetHeader () const |
Use this method to access header data. More... | |
const unsigned short * | GetSegmentsArray () const |
Returns segments array (segment count for each hair strand). More... | |
const float * | GetPointsArray () const |
Returns points array (xyz coordinates of each hair point). More... | |
const float * | GetThicknessArray () const |
Returns thickness array (thickness at each hair point}. More... | |
const float * | GetTransparencyArray () const |
Returns transparency array (transparency at each hair point). More... | |
const float * | GetColorsArray () const |
Returns colors array (rgb color at each hair point). More... | |
const float * | GetUVsArray () const |
Returns uvs array (uv at each hair point). More... | |
Data Access Methods | |
unsigned short * | GetSegmentsArray () |
Returns segments array (segment count for each hair strand). More... | |
float * | GetPointsArray () |
Returns points array (xyz coordinates of each hair point). More... | |
float * | GetThicknessArray () |
Returns thickness array (thickness at each hair point}. More... | |
float * | GetTransparencyArray () |
Returns transparency array (transparency at each hair point). More... | |
float * | GetColorsArray () |
Returns colors array (rgb color at each hair point). More... | |
float * | GetUVsArray () |
Returns uvs array (uv at each hair point). More... | |
Methods for Setting Array Sizes | |
void | Initialize () |
Deletes all arrays and initializes the header data. More... | |
void | SetHairCount (int count) |
Sets the hair count, re-allocates segments array if necessary. More... | |
void | SetPointCount (int count) |
void | SetArrays (int array_types) |
void | SetDefaultSegmentCount (int s) |
Sets default number of segments for all hair strands, which is used if segments array does not exist. More... | |
void | SetDefaultThickness (float t) |
Sets default hair strand thickness, which is used if thickness array does not exist. More... | |
void | SetDefaultTransparency (float t) |
Sets default hair strand transparency, which is used if transparency array does not exist. More... | |
void | SetDefaultColor (float r, float g, float b) |
Sets default hair color, which is used if color array does not exist. More... | |
Load and Save Methods | |
int | LoadFromFile (const char *filename) |
Loads hair data from the given HAIR file. More... | |
int | SaveToFile (const char *filename) const |
Saves hair data to the given HAIR file. More... | |
Other Methods | |
int | FillDirectionArray (float *dir) |
Private Variables and Methods | |
cyHairFileHeader | header |
unsigned short * | segments |
float * | points |
float * | thickness |
float * | transparency |
float * | colors |
float * | uvs |
float | ComputeDirection (float *d, float &d0len, float &d1len, const float *p0, const float *p1, const float *p2) |
HAIR file class.
Definition at line 75 of file cyHairFile.h.
|
inline |
Definition at line 78 of file cyHairFile.h.
|
inline |
Definition at line 79 of file cyHairFile.h.
|
inlineprivate |
Definition at line 380 of file cyHairFile.h.
|
inline |
Fills the given direction array with normalized directions using the points array. Call this function if you need strand directions for shading. The given array dir should be allocated as an array of size 3 times point count. Returns point count, returns zero if fails.
Definition at line 303 of file cyHairFile.h.
|
inline |
Returns colors array (rgb color at each hair point).
Definition at line 90 of file cyHairFile.h.
|
inline |
Returns colors array (rgb color at each hair point).
Definition at line 101 of file cyHairFile.h.
|
inline |
Use this method to access header data.
Definition at line 85 of file cyHairFile.h.
|
inline |
Returns points array (xyz coordinates of each hair point).
Definition at line 87 of file cyHairFile.h.
|
inline |
Returns points array (xyz coordinates of each hair point).
Definition at line 98 of file cyHairFile.h.
|
inline |
Returns segments array (segment count for each hair strand).
Definition at line 86 of file cyHairFile.h.
|
inline |
Returns segments array (segment count for each hair strand).
Definition at line 97 of file cyHairFile.h.
|
inline |
Returns thickness array (thickness at each hair point}.
Definition at line 88 of file cyHairFile.h.
|
inline |
Returns thickness array (thickness at each hair point}.
Definition at line 99 of file cyHairFile.h.
|
inline |
Returns transparency array (transparency at each hair point).
Definition at line 89 of file cyHairFile.h.
|
inline |
Returns transparency array (transparency at each hair point).
Definition at line 100 of file cyHairFile.h.
|
inline |
Returns uvs array (uv at each hair point).
Definition at line 91 of file cyHairFile.h.
|
inline |
Returns uvs array (uv at each hair point).
Definition at line 102 of file cyHairFile.h.
|
inline |
Deletes all arrays and initializes the header data.
Definition at line 109 of file cyHairFile.h.
References CY_HAIR_FILE_INFO_SIZE.
|
inline |
Loads hair data from the given HAIR file.
Definition at line 205 of file cyHairFile.h.
References _CY_FAILED_RETURN, CY_HAIR_FILE_COLORS_BIT, CY_HAIR_FILE_ERROR_CANT_OPEN_FILE, CY_HAIR_FILE_ERROR_CANT_READ_HEADER, CY_HAIR_FILE_ERROR_READING_COLORS, CY_HAIR_FILE_ERROR_READING_POINTS, CY_HAIR_FILE_ERROR_READING_SEGMENTS, CY_HAIR_FILE_ERROR_READING_THICKNESS, CY_HAIR_FILE_ERROR_READING_TRANSPARENCY, CY_HAIR_FILE_ERROR_READING_UVS, CY_HAIR_FILE_ERROR_WRONG_SIGNATURE, CY_HAIR_FILE_POINTS_BIT, CY_HAIR_FILE_SEGMENTS_BIT, CY_HAIR_FILE_THICKNESS_BIT, CY_HAIR_FILE_TRANSPARENCY_BIT, and CY_HAIR_FILE_UVS_BIT.
|
inline |
Saves hair data to the given HAIR file.
Definition at line 273 of file cyHairFile.h.
References CY_HAIR_FILE_COLORS_BIT, CY_HAIR_FILE_POINTS_BIT, CY_HAIR_FILE_SEGMENTS_BIT, CY_HAIR_FILE_THICKNESS_BIT, CY_HAIR_FILE_TRANSPARENCY_BIT, and CY_HAIR_FILE_UVS_BIT.
|
inline |
Use this function to allocate/delete arrays. Before you call this method set hair count and point count. Note that a valid HAIR file should always have points array.
Definition at line 172 of file cyHairFile.h.
References CY_HAIR_FILE_COLORS_BIT, CY_HAIR_FILE_POINTS_BIT, CY_HAIR_FILE_SEGMENTS_BIT, CY_HAIR_FILE_THICKNESS_BIT, CY_HAIR_FILE_TRANSPARENCY_BIT, and CY_HAIR_FILE_UVS_BIT.
|
inline |
Sets default hair color, which is used if color array does not exist.
Definition at line 199 of file cyHairFile.h.
|
inline |
Sets default number of segments for all hair strands, which is used if segments array does not exist.
Definition at line 190 of file cyHairFile.h.
|
inline |
Sets default hair strand thickness, which is used if thickness array does not exist.
Definition at line 193 of file cyHairFile.h.
|
inline |
Sets default hair strand transparency, which is used if transparency array does not exist.
Definition at line 196 of file cyHairFile.h.
|
inline |
Sets the hair count, re-allocates segments array if necessary.
Definition at line 134 of file cyHairFile.h.
|
inline |
Definition at line 144 of file cyHairFile.h.
|
private |
Definition at line 376 of file cyHairFile.h.
|
private |
Definition at line 371 of file cyHairFile.h.
|
private |
Definition at line 373 of file cyHairFile.h.
|
private |
Definition at line 372 of file cyHairFile.h.
|
private |
Definition at line 374 of file cyHairFile.h.
|
private |
Definition at line 375 of file cyHairFile.h.
|
private |
Definition at line 377 of file cyHairFile.h.