HPatch Class Reference

Defines a valid 4 point patch. More...

#include <HPatch.h>

Inheritance diagram for HPatch:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void operator delete (void *ptr)
HCPGetCP1 ()
HCPGetCP2 ()
HCPGetCP3 ()
HCPGetCP4 ()
VectorGetIT1 ()
VectorGetOT1 ()
VectorGetIT2 ()
VectorGetOT2 ()
VectorGetIT3 ()
VectorGetOT3 ()
VectorGetIT4 ()
VectorGetOT4 ()
BOOL IsFlipV1 ()
BOOL IsFlipV2 ()
BOOL IsFlipV3 ()
BOOL IsFlipV4 ()
BOOL IsHook1 ()
BOOL IsHook2 ()
BOOL IsHook3 ()
BOOL IsHook4 ()
BOOL IsUseHook1 ()
BOOL IsUseHook2 ()
BOOL IsUseHook3 ()
BOOL IsUseHook4 ()
BOOL IsEndHook1 ()
BOOL IsEndHook2 ()
BOOL IsEndHook3 ()
BOOL IsEndHook4 ()
BOOL IsHookData1 ()
BOOL IsHookData2 ()
BOOL IsHookData3 ()
BOOL IsHookData4 ()
int GetGroupImageRotation ()
PatchID GetPatchID ()
HAttrPropertyGetCompositedAttr ()
HAttrPropertyGetAttr ()
int GetNumPoints ()
void GetPatchPoints (Vector *p)
void ReverseNormal ()
Vector GetPointOnPatch (float s, float t)
Vector GetPointNormalOnPatch (float s, float t, Vector &normal)

Static Public Member Functions

static void DeleteHandle (HPatch *handle)

Detailed Description

Defines a valid 4 point patch.

Internal Hash Patch is essentially defined by 4 Hermite splines. So there is 8 tangents around a 4 point patch. One in tangent and one Out tangent for each CP.

CP-Tangents.gif

Relations between In tangents, Out tangents and CPs

A Hash patch does not have the 4 central vectors called "Twist vectors" as is the case with Bezier surfaces. Instead of these twist vectors, A:M uses a heuristic to decide how to subdivide the patch based on the curviest splines first.

Starting with a HPatch, one can walk the splines by first retrieving the HCPs and then using the HCP::GetSpline() function.

See also:
HCP and HSpline

PDF document describing the Hash patches.

Definition at line 53 of file HPatch.h.


Member Function Documentation

static void HPatch::DeleteHandle HPatch handle  )  [static]
 

HAttrProperty * HPatch::GetAttr  ) 
 

This returns a pointer to the real HAttr in the Model or Group on the HPatch in case a person wanted to take their own samples from a HAttr.

HAttrProperty * HPatch::GetCompositedAttr  ) 
 

On a HPatch there is a HAttr that is a composited attribute using the coordinates (0,0,0). This is what Hash use in real-time.

HCP * HPatch::GetCP1  ) 
 

Returns a pointer to the first HCP in the list of 4 CPs that defines the patch.

Note:
There aren't actually real "first" CP but we need to start somewhere.

When looking down the patch normal, patch vertices are numbered in ascending order, counter clockwise.

A vertex's normal N can be computed by getting the cross product of its Out Tangent A with its In Tangent B; N = A ^ B ( the ^ symbol is defined as the cross product operator for the Vector class )
A: the Out Tangent A, is the "in" tangent of the spline leading to the next vertex ( unless the IsFlipV for the current vertex is set )
B: The In Tangent B, is the "out" tangent of the spline leading from the previous vertex ( unless the IsFlipV for the previous vertex is set )

HCP * HPatch::GetCP2  ) 
 

Returns a pointer to the second HCP in the list of 4 CPs that defines the patch.

HCP * HPatch::GetCP3  ) 
 

Returns a pointer to the third HCP in the list of 4 CPs that defines the patch.

HCP * HPatch::GetCP4  ) 
 

Returns a pointer to the fourth HCP in the list of 4 CPs that defines the patch.

int HPatch::GetGroupImageRotation  ) 
 

Vector & HPatch::GetIT1  ) 
 

Returns a Vector that is the In tangent to the first HCP in the list of 4 CPs that defines the patch.

Note:
There aren't actually real "first" CP but we need to start somewhere.
See also:
HPatch::GetOT1()

Vector & HPatch::GetIT2  ) 
 

Returns a Vector that is the In tangent to the second HCP in the list of 4 CPs that defines the patch.

See also:
HPatch::GetOT1()

Vector & HPatch::GetIT3  ) 
 

Returns a Vector that is the In tangent to the third HCP in the list of 4 CPs that defines the patch.

See also:
HPatch::GetOT1()

Vector & HPatch::GetIT4  ) 
 

Returns a Vector that is the In tangent to the fourth HCP in the list of 4 CPs that defines the patch.

See also:
HPatch::GetOT1()

int HPatch::GetNumPoints  ) 
 

Vector & HPatch::GetOT1  ) 
 

Returns a Vector that is the Out tangent to the first HCP in the list of 4 CPs that defines the patch.

Note:
GetIT1 and GetOT1 will get the tangent from different HCPs. That is because an HPatch is the result of HSpline crossing and so the InTangent is from one of the crossing HSplines while the OutTangent is from the other crossing HSpline. The CP and their tangents may be viewed like this:
CP-Tangents.gif

Relations between In tangents, Out tangents and CPs

The functions GetITx() and GetOTx() are usefull for the computing of normals to the CPs in a patch. it1^ot1 (that is the cross product between it1 and ot1) will generate the surface normal for the cp1 on the patch. However, just crossing the in & out tangents of the splines that make the patch will produce some normals facing in and some out.

There aren't actually real "first" CP but we need to start somewhere.

Vector & HPatch::GetOT2  ) 
 

Returns a Vector that is the Out tangent to the second HCP in the list of 4 CPs that defines the patch.

See also:
HPatch::GetOT1()

Vector & HPatch::GetOT3  ) 
 

Returns a Vector that is the Out tangent to the third HCP in the list of 4 CPs that defines the patch.

See also:
HPatch::GetOT1()

Vector & HPatch::GetOT4  ) 
 

Returns a Vector that is the Out tangent to the fourth HCP in the list of 4 CPs that defines the patch.

See also:
HPatch::GetOT1()

PatchID HPatch::GetPatchID  ) 
 

Reimplemented in HPatch5.

void HPatch::GetPatchPoints Vector p  ) 
 

Vector HPatch::GetPointNormalOnPatch float  s,
float  t,
Vector normal
 

Vector HPatch::GetPointOnPatch float  s,
float  t
 

BOOL HPatch::IsEndHook1  ) 
 

If TRUE, the vertex is the last hook on the spline segment

BOOL HPatch::IsEndHook2  ) 
 

See also:
HPatch::IsEndHook1()

BOOL HPatch::IsEndHook3  ) 
 

See also:
HPatch::IsEndHook1()

BOOL HPatch::IsEndHook4  ) 
 

See also:
HPatch::IsEndHook1()

BOOL HPatch::IsFlipV1  ) 
 

If TRUE, means that to traverse to the next vertex you must use GetNext() instead of GetPrev() -- the spline is leading to the next vertex instead of back from it.

BOOL HPatch::IsFlipV2  ) 
 

If TRUE, means that to traverse to the next vertex you must use GetNext() instead of GetPrev() -- the spline is leading to the next vertex instead of back from it.

BOOL HPatch::IsFlipV3  ) 
 

If TRUE, means that to traverse to the next vertex you must use GetNext() instead of GetPrev() -- the spline is leading to the next vertex instead of back from it.

BOOL HPatch::IsFlipV4  ) 
 

If TRUE, means that to traverse to the next vertex you must use GetNext() instead of GetPrev() -- the spline is leading to the next vertex instead of back from it.

BOOL HPatch::IsHook1  ) 
 

The vertex is the end of an IsUseHook1 spline segment.

BOOL HPatch::IsHook2  ) 
 

The vertex is the end of an IsUseHook2 spline segment.

BOOL HPatch::IsHook3  ) 
 

The vertex is the end of an IsUseHook3 spline segment.

BOOL HPatch::IsHook4  ) 
 

The vertex is the end of an IsUseHook4 spline segment.

BOOL HPatch::IsHookData1  ) 
 

If TRUE, this vertex is a hook

if IsHookData1 is set then

if it is an end hook ( its IsEndHook1 flag is set ), calling GetNextAttached(), will yield the base CP of the spline that the vertex is hooked into. If the vertex is not an end hook, calling GetNextAttached() will yield the next hook down the spline.

BOOL HPatch::IsHookData2  ) 
 

See also:
HPatch::IsHookData1()

BOOL HPatch::IsHookData3  ) 
 

See also:
HPatch::IsHookData1()

BOOL HPatch::IsHookData4  ) 
 

See also:
HPatch::IsHookData1()

BOOL HPatch::IsUseHook1  ) 
 

If TRUE, an adjacent vertex is a hook, or this vertex is a hook. You may not be able to traverse to the next vertex, or the previous from this vertex.

If IsUseHook1 is set then

if the next vertex's IsHookData1 flag is set, it is a hook, and you cannot traverse to it. another way of getting the Out Tangent "A" must be found

1) The next vertex may be a hook--find out by calling IsHookData1() on it.

1.1) If the next vertex is a hook, then you can determine which direction the connecting spline runs by calling IsEndHook1() on it. If the call returns a true value, then the spline is coming into the current vertex.

2) The previous vertex may be a hook--find out by calling IsHookData1() on it

2.1) If the previous vertex is a hook, then you can determine which direction the connecting spline runs by calling IsEndHook1() to it. If the call returns a true value, then the spline is coming into the currnet vertex.

3) The current vertex may be a hook--find out by calling IsEndHook1() on the current vertex

BOOL HPatch::IsUseHook2  ) 
 

See also:
HPatch::IsUseHook1()

BOOL HPatch::IsUseHook3  ) 
 

See also:
HPatch::IsUseHook1()

BOOL HPatch::IsUseHook4  ) 
 

See also:
HPatch::IsUseHook1()

void HPatch::operator delete void *  ptr  )  [inline]
 

Definition at line 56 of file HPatch.h.

void HPatch::ReverseNormal  ) 
 

Reverses the normal on the patch.


The documentation for this class was generated from the following files:
This A:M SDK v12.0 documentation is maintained by Hash Inc. Please address any comments concerning this documentation to AMReports. If you have any information, knowledge, or documentation to share with the A:M developer community, please post them on the Hash SDK forum.

Generated on Thu Oct 27 11:46:56 2005 with doxygen 1.4.5 written by Dimitri van Heesch, © 1997-2001