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.

24 lines (23 loc) 871 B
import { Behaviour } from "../Component.js"; import { Rigidbody } from "../RigidBody.js"; /** * Used to attract Rigidbodies towards the position of this component. * Add Rigidbodies to the `targets` array to have them be attracted. * You can use negative strength values to create a repulsion effect. * * @example Attractor component attracting a Rigidbody * ```ts * const attractor = object.addComponent(Attractor); * attractor.strength = 5; // positive value to attract * attractor.radius = 10; // only attract within 10 units * attractor.targets.push(rigidbody); // add the Rigidbody to be attracted * @summary Attract Rigidbodies towards the position of this component * @category Physics * @group Components */ export declare class Attractor extends Behaviour { strength: number; radius: number; targets: Rigidbody[]; update(): void; }