class M_Point

The M_Point class represents a single control point in a 2D vector layer.

Member Functions

int CountCurves()

Returns the number of curves that pass through the point.

Return value (int): the number of curves that pass through the point

M_Curve Curve(id, where)

Returns a curve that passes through the point.

Return value (M_Curve): a curve that passes through the point
id (int): the curve's id (0 is the first curve passing through the point)
where (int): the where value is returned, indicating where on the curve the point lies

void SetPos(pos, frame)

Set the position of the point at a given time.

Return value: none
pos (LM_Vector2): position
frame (int): frame number

void SetCurvature(curvature, frame)

Sets the curvature of all curves that pass through this point.

Return value: none
curvature (float): curvature value
frame (int): frame number

bool IsEndpoint()

Tests whether this point is the endpoint of a curve

Return value (bool): true if endpoint, false if the point is in the middle of a curve

void GetEndpointEdge(curveID, segID)

Returns which curve, and which segment of that curve, this point is an endpoint of.

Return value: none
curveID (int): the curve identifier
segID (int): which segment of that curve

Member Variables

fSelected (bool)

true if the point is selected, otherwise false

fPrevSelected (bool)

true if the point was previously selected, otherwise false

fPos (LM_Vector2)

the point's current position

fTempPos (LM_Vector2)

a temporary variable for storing position, useful when transforming points

fAnimPos (AnimVec2)

the point's position animation channel

fWidth (float)

the width of curves that pass through this point (-1 means that curves aren't affected by variable width)

fTempWidth (float)

a temporary variable to store line width

fParent (int)

id number of the parent bone this point is bound to. A value of -1 means the point is not bound to any bone. A value of -2 means the point is flexi-bound to all bones in the parent layer.

class M_Point {
  int32 GetNumCurves @ CountCurves();
  M_Curve *GetCurve @ Curve(int32 id, int32 *where);
  bool IsPointOnCurve(int32 curveID, int32 where = -1);
  void SetPos(LM_Vector2 pos, int32 frame);
  void SetCurvature(real curvature, int32 frame);
  bool IsEndpoint();
  void GetEndpointEdge(int32 *curveID, int32 *segID);
  bool    fSelected;
  bool    fPrevSelected;
  LM_Vector2  fPos;
  LM_Vector2  fTempPos;
  AnimVec2  fAnimPos;
  AnimVal    fWidth;
  real    fTempWidth;
  int32    fParent;