pixi-wheels

FlapConfig

pixi-wheels


pixi-wheels / index / FlapConfig

Interface: FlapConfig

Defined in: config/types.ts:412

The pointer flap: how the tongue behaves against the pegs.

The blade is a triangle hinged at the pin, tipWidth across at its base and a point at the tip; a peg is a circle. Each frame the tongue takes the smallest swing from where it stands that keeps the circle outside the triangle, rides the peg until it is through, and springs back (stiffness, damping) into clear air only. elasticity and friction pad the peg. At speed a peg passes within one frame and the tongue is flicked to the angle that peg would have held it at.

Properties#

PropertyTypeDescriptionDefined in
damping?numberSpring damping (1/s). Default 14; lower rings longer after a release.config/types.ts:422
drag?numberHow hard the tongue holds the ring back while a peg climbs it, 0..1. Default 0 (the tongue is weightless). At 1 the ring is held for a whole contact width of arc and springs forward when the peg slips over the crown: a crawling wheel visibly catches on every peg. Purely visual - the hold always relaxes to zero, so the planned landing is unchanged.config/types.ts:450
dragRelease?numberHow fast the ring catches up after a drag hold, 1/s. Default 24.config/types.ts:452
elasticity?numberHow far the tongue yields, as a padding on the peg. Default 1: exactly enough to clear it. Over 1 treats the peg as fatter than it is, so the blade swings wider and looks floppier. Under 1 is clamped - a tongue that yields less than the geometry demands is one drawn through a peg.config/types.ts:429
friction?numberHow long the peg drags the tongue on, as a fraction of the peg’s radius added to it. Default 0.35. A fatter peg takes longer to get out from under the blade, so the tongue is held up further past it; 0 lets go the moment the real peg is through, 1 hangs on a long way.config/types.ts:436
invert?booleanFlip the deflection direction if your art is mirrored. Default false.config/types.ts:454
maxAngle?numberLargest deflection, degrees. Default 45: a blade that dips past the peg ring has to swing a long way before a peg can get by it, and a cap below what the geometry needs makes the tongue ride through the pegs instead.config/types.ts:418
stiffness?numberSpring stiffness pulling the tongue back to rest (1/s^2). Default 420.config/types.ts:420
tipWidth?numberWidth of the blade where the pegs cross it, px. Default 14. The contact model is that blade: a triangle from the pin, tipWidth across at the peg ring, tapering to a point at the tip.config/types.ts:442