UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

40 lines (39 loc) 1.32 kB
import { Behaviour } from "./Component.js"; /** * The [BasicIKConstraint](https://engine.needle.tools/docs/api/BasicIKConstraint) provides simple two-bone inverse kinematics. * Positions this GameObject as a "joint" between `from` and `to` targets, * using a `hint` object to determine the bend direction. * * **Use cases:** * - Simple arm/leg IK (elbow/knee positioning) * - Mechanical linkages * - Procedural animation joints * * **How it works:** * - Calculates joint position based on `desiredDistance` (bone length) * - Uses `hint` to determine which way the joint bends * - Automatically handles stretching when targets are too far apart * * @example Setup basic limb IK * ```ts * // Attach to the elbow/knee joint object * const ik = elbowJoint.addComponent(BasicIKConstraint); * // Configure via serialized properties in editor: * // - from: shoulder/hip * // - to: wrist/ankle * // - hint: control point for bend direction * ``` * * @summary Two-bone inverse kinematics constraint * @category Animation and Sequencing * @group Components * @see {@link AlignmentConstraint} for simpler alignment */ export declare class BasicIKConstraint extends Behaviour { private from; private to; private hint; private desiredDistance; onEnable(): void; update(): void; }