Visit Cem Yuksel's web site

Files

Class List

Class Members

Class Hierarchy

cyHairFile Class Reference

#include <cyHairFile.h>

List of all members.


Detailed Description

HAIR file class.


Public Member Functions

Constant Data Access Methods
const cyHairFileHeaderGetHeader () const
 Use this method to access header data.
const unsigned short * GetSegmentsArray () const
 Returns segments array (segment count for each hair strand).
const float * GetPointsArray () const
 Returns points array (xyz coordinates of each hair point).
const float * GetThicknessArray () const
 Returns thickness array (thickness at each hair point}.
const float * GetTransparencyArray () const
 Returns transparency array (transparency at each hair point).
const float * GetColorsArray () const
 Returns colors array (rgb color at each hair point).
Data Access Methods
unsigned short * GetSegmentsArray ()
 Returns segments array (segment count for each hair strand).
float * GetPointsArray ()
 Returns points array (xyz coordinates of each hair point).
float * GetThicknessArray ()
 Returns thickness array (thickness at each hair point}.
float * GetTransparencyArray ()
 Returns transparency array (transparency at each hair point).
float * GetColorsArray ()
 Returns colors array (rgb color at each hair point).
Methods for Setting Array Sizes
void Initialize ()
 Deletes all arrays and initializes the header data.
void SetHairCount (int count)
 Sets the hair count, re-allocates segments array if necessary.
void SetPointCount (int count)
 Deletes all arrays and initializes the header data.
void SetArrays (int array_types)
 Use this function to allocate/delete arrays.
void SetDefaultSegmentCount (int s)
 Sets default number of segments for all hair strands, which is used if segments array does not exist.
void SetDefaultThickness (float t)
 Sets default hair strand thickness, which is used if thickness array does not exist.
void SetDefaultTransparency (float t)
 Sets default hair strand transparency, which is used if transparency array does not exist.
void SetDefaultColor (float r, float g, float b)
 Sets default hair color, which is used if color array does not exist.
Load and Save Methods
int LoadFromFile (const char *filename)
 Loads hair data from the given HAIR file.
int SaveToFile (const char *filename) const
 Saves hair data to the given HAIR file.
Other Methods
int FillDirectionArray (float *dir)
 Fills the given direction array with normalized directions using the points array.


Member Function Documentation

int FillDirectionArray float *  dir  )  [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.

void SetArrays int  array_types  )  [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.

Visit Cem Yuksel's website!