AbstractSplineSource

← prev index next →

Base class for SplineSource implementations that provides default implementations for the PointsSource-shaped members (pointCount, localMatrices, setWorldReferenceNode, getWorldMatrix, the multicast subscribeVersionChanged / subscribeDataChanged notifications) plus the standard *-spline-source Custom Element lifecycle (self-attach to the owning <sk-spline> / <sk-morph-spline-source> on connect, detach on real removal). The scene half of the typed source-lifecycle contract (_registerScene / _unregisterScene / scene) is delegated to a single-scene, reference-counted SceneLeaseCell: these sources own no scene-coupled effects, but the lease still enforces the single-scene policy for them and refcounts shared consumers. _setOwnerNode stays a no-op default (no source here consumes world-space inputs).

Remarks

Extends SkenraAnimatable so every concrete subclass IS a registerable Custom Element (<sk-svg-spline-source>, <sk-points-spline-source>, <sk-morph-spline-source>). Concrete spline sources override polyline and bump version to drive the lazy materialization of localMatrices here (a per-vertex [ T·width | N·width | B·width | P ] frame). The ribbon-normal hook (_computeNormals) has a no-normals default — each source implements its own per-source-type rule (plane-orthogonal for 2D SVG, bbox-outward for 3D points, etc.). Returning null from _computeNormals lets the frame builder fall back to a deterministic world-axis ribbon normal.

ComputeBufferSplineSource and TrailSplineSource extend SkenraAnimatable directly (their scene-coupled state predates this base); they use SplinePointsMaterializer directly to share the same caching policy and implement the same source-element lifecycle.

Abstract base class — not instantiated directly. Construct one of its concrete subclasses; this class contributes the members below to them.

Properties

Other Properties

PropertyTypeDefaultDescriptionDeclared by
pointCountread-only number Cloner-facing point count. Tracks distribution: equals AbstractSplineSource
localMatricesread-only Float32Array<ArrayBufferLike> | null AbstractSplineSource
distribution SplineDistributionMode AbstractSplineSource
distributionCount number AbstractSplineSource
sceneread-only any Gets the Scene this animatable belongs to, if any. SkenraAnimatable
animationsread-only SkenraAnimation[] Public getter for the animations affecting this target. SkenraAnimatable

Methods

MethodDescriptionDeclared by
animate(firstArg: TypedKeyframe<this>[] | TypedPropertyIndexedKeyframes<this> | Record<string, any> | globalThis.Keyframe[] | globalThis.PropertyIndexedKeyframes | null, secondArg?: number | KeyframeAnimationOptions | globalThis.KeyframeAnimationOptions): SkenraAnimation & Animation Creates a new SkenraAnimation for this target per Web Animations API. SkenraAnimatable
removeAnimation(animation: SkenraAnimation): boolean Removes a specific animation from this object. SkenraAnimatable
constrain(type: K, config: ConstraintConfigMap[K]): ConstraintReturnMap[K] Creates a constraint on this Animatable using a fluent API. SkenraAnimatable