HairCollider Class Reference Library » 头发

#include <lib_hair.h>

详细描述

Hair collider class.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

公共成员函数

Bool   Init ( HairGuides *hair)
void  发行 ()
Int32   GetClosestPoint (const 向量 &p)
Bool   GetClosestSegment (const 向量 &p, Int32 *guide, Int32 *segment, Float *segt)
Bool   GetParticleIntersection (const 向量 &p, const 向量 &v, Float r, Int32 *guide, Int32 *segment, Float *segt, Float *rayt)

静态公共成员函数

static HairCollider Alloc ()
static void  Free ( HairCollider *&p)

私有成员函数

  HairCollider ()
  ~HairCollider ()

Private Attributes

HairColliderData *  m_pData

构造函数 & 析构函数文档编制

◆  HairCollider()

HairCollider () private

◆  ~HairCollider()

~ HairCollider () private

成员函数文档编制

◆  Alloc()

static HairCollider * Alloc ( )
static

Allocates a hair collider. Destroy the allocated hair collider with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated hair collider, or nullptr if the allocation failed.

◆  Free()

static void Free ( HairCollider *&  p )
static

Destructs hair colliders allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] p The hair collider to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  Init()

Bool Init ( HairGuides hair )

Initializes the hair collider.

参数
[in] hair The hair to initialize with.
返回
true if successful, otherwise false .

◆  Release()

void Release ( )

Releases allocated memory. Called automatically by Free() .

◆  GetClosestPoint()

Int32 GetClosestPoint ( const 向量 p )

Gets the closest point to p .

参数
[in] p The point to search for.
返回
The closest point or NOTOK if an error occurred.

◆  GetClosestSegment()

Bool GetClosestSegment ( const 向量 p ,
Int32 guide ,
Int32 segment ,
Float segt  
)

Gets the closest segment to p .

参数
[in] p The point to search for.
[out] guide Assigned the guide index.
[out] segment Assigned the segment index.
[out] segt Assigned the segment t coordinate.
返回
true if successful, otherwise false .

◆  GetParticleIntersection()

Bool GetParticleIntersection ( const 向量 p ,
const 向量 v ,
Float   r ,
Int32 guide ,
Int32 segment ,
Float segt ,
Float rayt  
)

Gets the intersection of particle p with vector v , looking within a distance radius of r .

参数
[in] p The point to search for.
[in] v The vector of particle to search for.
[in] r The search distance radius.
[out] guide Assigned the guide index.
[out] segment Assigned the segment index.
[out] segt Assigned the segment t coordinate.
[out] rayt Assigned the ray coordinate.
返回
true if successful, otherwise false .

Member Data Documentation

◆  m_pData

HairColliderData* m_pData private