import { Camera } from "@babylonjs/core/Cameras/camera"; import { Matrix, Vector3 } from "@babylonjs/core/Maths/math.vector"; import { Observable } from "@babylonjs/core/Misc/observable"; import type { Scene } from "@babylonjs/core/scene"; import type { Nullable } from "@babylonjs/core/types"; import type { IMmdBindableCameraAnimation } from "./Animation/IMmdBindableAnimation"; import type { IMmdRuntimeCameraAnimation } from "./Animation/IMmdRuntimeAnimation"; import type { MmdCompositeRuntimeCameraAnimation } from "./Animation/mmdCompositeRuntimeCameraAnimation"; import type { MmdRuntimeCameraAnimation } from "./Animation/mmdRuntimeCameraAnimation"; import type { MmdRuntimeCameraAnimationGroup } from "./Animation/mmdRuntimeCameraAnimationGroup"; type RuntimeCameraAnimation = MmdRuntimeCameraAnimation | MmdRuntimeCameraAnimationGroup | MmdCompositeRuntimeCameraAnimation | IMmdRuntimeCameraAnimation; /** * MMD camera * * The MMD camera is a type of Arc Rotate Camera that determines the transform of the camera by the center position, rotation(yaw pitch roll), and distance parameters */ export declare class MmdCamera extends Camera { /** * Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera */ ignoreParentScaling: boolean; /** * Define the current rotation of the camera */ rotation: Vector3; /** * Define the current distance of the camera from its target (default: -45) */ distance: number; private readonly _viewMatrix; private readonly _tmpUpVector; private readonly _tmpTargetVector; /** * Observable triggered when the current animation is changed */ readonly onCurrentAnimationChangedObservable: Observable>; private readonly _animations; private readonly _animationIndexMap; private _currentAnimation; /** * Creates a new MMD camera * @param name Defines the name of the camera in the scene * @param position Defines the position of the camera * @param scene Defines the scene the camera belongs too * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene */ constructor(name: string, position?: Vector3, scene?: Scene, setActiveOnSceneIfNoneActive?: boolean); /** * Add an animation to the camera * @param animation MMD animation or MMD camera animation group to add */ addAnimation(animation: IMmdBindableCameraAnimation): void; /** * Remove an animation from the camera * * If index is out of range, this method does nothing * @param index The index of the animation to remove */ removeAnimation(index: number): void; /** * Set the current animation of the camera * * If name is null, the current animation is set to null * @param name The name of the animation to set * @throws {Error} if the animation is not found */ setAnimation(name: Nullable): void; /** * Get the animations of the camera */ get runtimeAnimations(): readonly RuntimeCameraAnimation[]; /** * Get the current animation of the camera */ get currentAnimation(): Nullable; /** * Animate the camera * @param frameTime The 30fps frame time */ animate(frameTime: number): void; private _storedPosition; private _storedRotation; private _storedDistance; /** * Store current camera state of the camera (fov, position, rotation, etc..) * @returns the camera */ storeState(): Camera; /** * Restored camera state. You must call storeState() first * @returns whether it was successful or not * @internal */ _restoreStateValues(): boolean; /** @internal */ _initCache(): void; /** * @internal */ _updateCache(ignoreParentClass?: boolean): void; /** @internal */ _isSynchronizedViewMatrix(): boolean; private static readonly _RotationMatrix; private static readonly _CameraEyePosition; private static readonly _UpVector; private static readonly _TargetVector; /** @internal */ _getViewMatrix(): Matrix; /** * Gets the current object class name. * @returns the class name */ getClassName(): string; } export {};