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.

35 lines (34 loc) 1.25 kB
import { Object3D } from "three"; import { Axes } from "../engine/engine_physics.types.js"; import { Behaviour } from "./Component.js"; /** * SmoothFollow makes the {@link Object3D} (`GameObject`) smoothly follow another target {@link Object3D}. * It can follow the target's position, rotation, or both. * @category Interactivity * @group Components */ export declare class SmoothFollow extends Behaviour { /** * The target to follow. If null, the GameObject will not move. */ target: Object3D | null; /** * The factor to smoothly follow the target's position. * The value is clamped between 0 and 1. If 0, the GameObject will not follow the target's position. */ followFactor: number; /** * The factor to smoothly follow the target's rotation. * The value is clamped between 0 and 1. If 0, the GameObject will not follow the target's rotation. */ rotateFactor: number; positionAxes: Axes; flipForward: boolean; private static _invertForward; private _firstUpdate; /** * Update the position and rotation of the GameObject to follow the target. */ onBeforeRender(): void; updateNow(hard: boolean): void; }