HSpline Class Reference

The HSpline class represents the spline curves that contain HCPs and that are stitched together to make the patch based models. More...

#include <HPatch.h>

Inheritance diagram for HSpline:

Inheritance graph
[legend]
Collaboration diagram for HSpline:

Collaboration graph
[legend]
List of all members.

Public Member Functions

HCPGetHeadCP ()
HSplineGetNextSpline ()
HCPCreateCPAtHead (const Vector &p)
HCPCreateCPAtTail (const Vector &p)
HCPCreateCPBefore (HCP *beforecp, const Vector &p)
HCPCreateCPAfter (HCP *aftercp, const Vector &p)
BOOL DeleteCP (HCP *cp)
BOOL MakeLooped (BOOL looped)
void operator delete (void *ptr)
float GetLength ()
BOOL GetPositionAndDirection (float ease, Vector &position, Vector &direction)

Static Public Member Functions

static void DeleteHandle (HSpline *handle)

Detailed Description

The HSpline class represents the spline curves that contain HCPs and that are stitched together to make the patch based models.

Note:
Most operations that affect HSplines are actually performed on HCPs.
Model files store a list of splines. These splines are Bezier splines. A spline is a list of vertices and each vertex has an input/output tangent control vertice which is computed based on the alpha/gamma/magnitude values. Once these splines are loaded, a heuristic traverses them and determines valid 3 and 4 vertex patches.

Internal Hash Patch is essentially defined by 4 Hermite splines. Unlike the Bezier spline where the tangents are defined from control vectors which have absolute coordinates, Hermite splines are defined from CPs and tangent vectors for each CP. There are two tangents on each CP: the In tangent and the Out tangent. For smooth CPs, the In tangent and the Out tangent are in excact opposed direction.

Generally when you want to walk a spline you will use the HSpline member function GetHeadCP() to get the first HCP in the HSpline, and use HCP::GetNext() to walk to the end. If the spline is looped, make sure to use the HCP::IsLoop() function to find the last HCP in the spline.

See also:
HCP
Note:
All splines have a minimum of two control points.

Definition at line 12 of file HPatch.h.


Member Function Documentation

HCP * HSpline::CreateCPAfter HCP aftercp,
const Vector p
 

Creates a new HCP and places it after the specified HCP of the spline.

If aftercp points to the spline tail HCP, the result is the same as with CreateCPAtTail(const Vector &p).

Parameters:
aftercp - Points to the current HCP in the spline after which the new HCP will be inserted.
p - Specifies the coordinate of the new control point.

HCP * HSpline::CreateCPAtHead const Vector p  ) 
 

Creates a new HCP and places it before the first HCP of the spline. The new HCP becomes the head control point.

If the spline is looped, the new HCP also becomes the tail control point.

Parameters:
p - Specifies the coordinate of the new control point.

HCP * HSpline::CreateCPAtTail const Vector p  ) 
 

Creates a new HCP and places it after the last HCP of the spline. The new HCP becomes the tail control point.

If the spline is looped, the new HCP also becomes the head control point.

Parameters:
p - Specifies the coordinate of the new control point.

HCP * HSpline::CreateCPBefore HCP beforecp,
const Vector p
 

Creates a new HCP and places it before the specified HCP of the spline.

If beforecp points to the spline head HCP, the result is the same as with CreateCPAtHead(const Vector &p).

Parameters:
beforecp - Points to the current HCP in the spline before which the new HCP will be inserted.
p - Specifies the coordinate of the new control point.

BOOL HSpline::DeleteCP HCP cp  ) 
 

Deletes the specifid HCP from the spline and destroys it.

void HSpline::DeleteHandle HSpline handle  )  [static]
 

Explicitly destroys the HSpline.

HCP * HSpline::GetHeadCP  ) 
 

Returns a pointer to the first HCP in the spline.

float HSpline::GetLength  ) 
 

HSpline * HSpline::GetNextSpline  ) 
 

Returns a pointer to teh next spline in the list of spline that composes a model.

BOOL HSpline::GetPositionAndDirection float  ease,
Vector position,
Vector direction
 

BOOL HSpline::MakeLooped BOOL  looped  ) 
 

Marks the Spline as looped. In essence, that creates a spline segment between the head and the tail HCPs of the spline.

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

Destructor for the HSpline.

Reimplemented from HTreeObject.

Definition at line 25 of file HPatch.h.

References HTreeObject::DeleteHandle().

Here is the call graph for this function:


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:58 2005 with doxygen 1.4.5 written by Dimitri van Heesch, © 1997-2001