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.48 kB
import { Object3D, Vector3 } from "three"; import { Behaviour } from "./Component.js"; /** * @deprecated LookAtConstraint will be removed in future versions. Please either use a direct object reference instead (e.g. assigning an Object3D as a look target in scripts that reply on the LookAtConstraint) or implement the LookAtConstraint signature in your web project: * ```ts * export class LookAtConstraint extends Behaviour { * constraintActive: boolean = true; * locked: boolean = false; * sources: Object3D[] = []; * setConstraintPosition(worldPosition: Vector3) { * const source = this.sources[0]; * if (source) source.worldPosition = worldPosition; * } * } * ``` */ export declare class LookAtConstraint extends Behaviour { /** * When true, the constraint is active and affects the target. * Set to false to temporarily disable without removing sources. */ constraintActive: boolean; /** * When true, the look-at position is locked and won't update * even if source objects move. */ locked: boolean; /** * Objects to look at. The first object in the array is used * as the primary look-at target. */ sources: Object3D[]; /** * Sets the world position that the constraint should look at. * Updates the first source object's position. * @param worldPosition The world-space position to look at */ setConstraintPosition(worldPosition: Vector3): void; }