RadialPushPointConstraint

← prev index next →

Pushes every point of a host outward from a center node, as far as a field's weight allows — the way to blow a cloud of clones apart or pull it together.

Remarks

This is the radial-push member of the PointConstraint family: like every point-constraint it runs a GPU kernel over all of its host's points at once — the clones of a sk-cloner, or the vertices of a mesh or spline. For each point it forms the direction from a center node to that point and slides the point along it, so a whole cloud (or surface) expands or contracts from one center — the classic radial "effector".

Key attributes. origin is REQUIRED — it names the center node the push radiates from, by #id; because it is a real node it can be parented and animated, moving the whole burst's center. distance is how far each clone slides (negative pulls inward), and it is animatable, so keyframing it 0 → distance plays an explosion. An optional field (by #id, a SpatialField) with field-weight-range modulates the push per clone — only clones where the field is strong move; with no field every clone pushes at full strength.

Related. Sibling point-constraints include sk-simple-point-constraint (field-driven translate/scale/rotate) and sk-target-at-point-constraint (aim every clone at a node). Its single-node CPU cousin is sk-field-constraint.

Constructor

constructor(config?: { origin: SceneNode; distance?: number; field?: Field | null; fieldWeightRange?: readonly [number, number] })

Properties

Config Properties

PropertyTypeDefaultDescriptionDeclared by
originanimatable SceneNode The node whose world position is the push center, or null when the RadialPushPointConstraint
distanceanimatable number 0 How far points are pushed along the radial direction. RadialPushPointConstraint
fieldanimatableread-only Field | null The field used by this point constraint, if any. PointConstraint
fieldWeightRangeanimatable readonly [number, number] The [lo, hi] range the normalized field weight maps onto. PointConstraint

Other Properties

PropertyTypeDefaultDescriptionDeclared by
targetread-only ConstrainablePointsHost | null The target host this modifier applies to, or null before PointConstraint
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

Example

const originNode = new SceneNode({ id: 'origin', x: 0, y: 2, z: 0 });
scene.appendChild(originNode);

const constraint = cloner.constrain('radial-push', {
    origin: originNode,
    distance: 3,
    field: sphericalField,
});