@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.
42 lines (41 loc) • 1.29 kB
TypeScript
import { Object3D } from "three";
import { AssetReference } from "../engine/engine_addressables.js";
import { Behaviour } from "./Component.js";
declare type UserCamInfo = {
obj: Object3D;
lastUpdate: number;
userId: string;
};
/**
* SyncedCamera is a component that syncs the camera position and rotation of all users in the room.
* A prefab can be set to represent the remote cameras visually in the scene.
* @category Networking
* @group Components
*/
export declare class SyncedCamera extends Behaviour {
static instances: UserCamInfo[];
getCameraObject(userId: string): Object3D | null;
/**
* The prefab to visually represent the remote cameras in the scene.
*/
cameraPrefab: Object3D | null | AssetReference;
private _lastWorldPosition;
private _lastWorldQuaternion;
private _model;
private _needsUpdate;
private _lastUpdateTime;
private remoteCams;
private userToCamMap;
private _camTimeoutInSeconds;
private _receiveCallback;
/** @internal */
awake(): Promise<void>;
/** @internal */
onEnable(): void;
/** @internal */
onDisable(): void;
/** @internal */
update(): void;
private onReceivedRemoteCameraInfoBin;
}
export {};