threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
75 lines • 3.19 kB
TypeScript
import { AViewerPluginEventMap, AViewerPluginSync, ThreeViewer } from '../../viewer';
import { IObject3D, IObject3DEventMap } from '../../core';
import { ConstraintPropsType, TConstraintPropsType } from './helpers/BasicObjectConstraints';
import { UiObjectConfig } from 'uiconfig.js';
export type ObjectConstraintsPluginEventMap = AViewerPluginEventMap;
/**
* Object Constraints Plugin
*
* Create sophisticated object relationships and behaviors using simple constraint-based animation system inspired by Blender's constraints.
*
* The ObjectConstraintsPlugin provides a powerful constraint system that allows objects to automatically follow, copy, or respond to other objects' transformations and properties. This enables complex animations and interactive behaviors without manual keyframe animation.
*/
export declare class ObjectConstraintsPlugin extends AViewerPluginSync<ObjectConstraintsPluginEventMap> {
static readonly PluginType = "ObjectConstraintsPlugin";
enabled: boolean;
dependencies: never[];
constructor(enabled?: boolean);
addConstraint<T extends TConstraintPropsType = TConstraintPropsType>(obj: IObject3D, constraintOrType?: ObjectConstraint<T> | T, target?: string | IObject3D): ObjectConstraint<T>;
removeConstraint(obj: IObject3D, constraint: ObjectConstraint): void;
private _objectAdd;
private _objectRemove;
private _constraints;
private _constraintTargets;
private _constraintObjects;
private _objectUpdate;
private _refreshConstraint;
private _registerConstraint;
private _unregisterConstraint;
private _animatableComponents;
private _addTarget;
private _removeTarget;
private _setupUiConfig;
private _cleanUpUiConfig;
onAdded(viewer: ThreeViewer): void;
onRemove(viewer: ThreeViewer): void;
protected _viewerListeners: {
preFrame: () => void;
};
static ConstraintTypes: Record<keyof import('./helpers/BasicObjectConstraints').ConstraintPropsTypes, {
defaultProps: ConstraintPropsType;
update: (obj: IObject3D, target: IObject3D | undefined, props: ConstraintPropsType, influence: number) => {
changed: boolean;
end?: boolean;
change?: string;
};
setDirty?: (e: IObject3DEventMap["objectUpdate"], isTarget?: boolean) => boolean;
}>;
}
export declare class ObjectConstraint<T extends TConstraintPropsType = TConstraintPropsType> {
uuid: string;
enabled: boolean;
type: T;
target: string;
influence: number;
props: ConstraintPropsType<T>;
constructor(type?: T);
update(data: {
obj: IObject3D;
target?: IObject3D;
}): boolean;
needsUpdate: boolean;
setDirty: (e?: IObject3DEventMap["objectUpdate"], isTarget?: boolean) => boolean | undefined;
refresh?: () => void;
remove?: () => void;
refresh2: () => void;
typeChanged(): void;
private _propsUi;
uiConfig: UiObjectConfig;
}
declare module '../../assetmanager/IAssetImporter' {
interface IImportResultUserData {
constraints?: ObjectConstraint[];
}
}
//# sourceMappingURL=../../src/plugins/extras/ObjectConstraintsPlugin.d.ts.map