Next: , Previous: ClutterBackend, Up: Top


5 ClutterBehaviourBspline

A behaviour interpolating position along a B-Spline

5.1 Overview

<clutter-behaviour-bspline> interpolates actors along a defined B-Spline path.

A bezier spline is a set of cubic bezier curves defined by a sequence of control points given when creating a new <clutter-behaviour-bspline> instance.

Additional bezier curves can be added to the end of the bspline using clutter_behaviour_bspline_append_* family of functions, control points can be moved using clutter-behaviour-bspline-adjust. The bspline can be split into two with clutter-behaviour-bspline-split, and bsplines can be concatenated using clutter-behaviour-bspline-join.

Each time the behaviour reaches a point on the path, the "knot-reached" signal is emitted.

5.2 Usage

— Class: <clutter-behaviour-bspline>

Derives from <clutter-scriptable>, <clutter-behaviour>.

This class defines no direct slots.

— Signal on <clutter-behaviour-bspline>: knot-reached (arg0 <clutter-knot>)

This signal is emitted at the end of each frame.

Since 0.2

— Function: clutter-behaviour-bspline-new (alpha <clutter-alpha>) (knots <clutter-knot>) (n_knots unsigned-int)   (ret <clutter-behaviour>)

Creates a new bezier spline behaviour. You can use this behaviour to drive actors along the bezier spline, described by the knots control points.

Bspline is defined by 3n + 1 points, n >=1; any trailing points passed into this function are stored internally and used during any subsequent clutter_behaviour_bspline_append_* operations.

alpha
a <clutter-alpha>, or ‘#f
knots
a list of <clutter-knots> representing individual control points
n-knots
the number of control points
ret
a <clutter-behaviour>

Since 0.4

— Function: clutter-behaviour-bspline-truncate (self <clutter-behaviour-bspline>) (offset unsigned-int)
— Method: truncate

Truncates the bezier spline at the control point; if the control point at offset is not one of the on-curve points, the bspline will be truncated at the nearest preceeding on-curve point.

bs
a <clutter-behaviour-bspline>
offset
offset of control where the bspline should be truncated

Since 0.4

— Function: clutter-behaviour-bspline-join (self <clutter-behaviour-bspline>) (bs2 <clutter-behaviour-bspline>)
— Method: join

Joins a copy of bezier spline bs2 onto the end of bezier spline bs1; bs2 is not modified.

bs1
a <clutter-behaviour-bspline>
bs2
a <clutter-behaviour-bspline>

Since 0.4

— Function: clutter-behaviour-bspline-split (self <clutter-behaviour-bspline>) (offset unsigned-int)   (ret <clutter-behaviour>)
— Method: split

Splits a bezier spline into two at the control point at offset; if the control point at offset is not one of the on-curve bezier points, the bspline will be split at the nearest on-curve point before the offset. The original bspline is shortened appropriately.

bs
a <clutter-behaviour-bspline>
offset
an offset of the control point at which to split the spline.
ret
new ClutterBehaviourBspline.

Since 0.4

— Function: clutter-behaviour-bspline-clear (self <clutter-behaviour-bspline>)
— Method: clear

Empties a bspline.

bs
a <clutter-behaviour-bspline>

Since 0.4

— Function: clutter-behaviour-bspline-adjust (self <clutter-behaviour-bspline>) (offset unsigned-int) (knot <clutter-knot>)
— Method: adjust

Change the coordinaces of control point at index to those represented by the knot.

bs
a <clutter-behaviour-bspline>
offset
an index of control point to ajdust
knot
a <clutter-knot> with new coordinances for the control point.

Since 0.4