wdpapi
Version:
51WORLD WdpApi is a set of programming interfaces developed by JavaScript that is responsible for negotiating between web pages and cloud rendering platforms. Supported by 51Cloud rendering platform, it enables the users to create any HTML5 UI element on
290 lines (289 loc) • 8.98 kB
TypeScript
import { EntityEidType, CoordType, BasicInfoAtomType, MinMaxType, Rotator2DType, VisibleAtomType, EntityFlagAtomType, EntityOutlinerAtomType } from '../data-type';
/**
* @interface CameraPresetType
* @extends EntityEidType,Partial<BasicInfoAtomType>,Partial<CameraPresetEntityAtomType>,Partial<VisibleAtomType>,Partial<EntityFlagAtomType>
*/
export interface CameraPresetType extends EntityEidType, Partial<BasicInfoAtomType>, Partial<CameraPresetEntityAtomType>, Partial<VisibleAtomType>, Partial<EntityFlagAtomType>, Partial<EntityOutlinerAtomType> {
}
/**
* @interface IGeneratePre
* @param {Partial<CameraPresetEntityAtomType>} CameraPresetEntityAtom (optional)
* @param {Partial<BasicInfoAtomType} BasicInfoAtom (optional)
* @param {Partial<VisibleAtomType>} VisibleAtom (optional)
* @param {Partial<EntityFlagAtomType>} EntityFlagAtom (optional)
*/
export interface IGeneratePre {
CameraPresetEntityAtom?: Partial<CameraPresetEntityAtomType>;
BasicInfoAtom?: Partial<BasicInfoAtomType>;
VisibleAtom?: Partial<VisibleAtomType>;
EntityFlagAtom?: Partial<EntityFlagAtomType>;
EntityOutlinerAtom?: Partial<EntityOutlinerAtomType>;
}
/**
* @interface ICameraUpdateOpt
* @extends Partial<Exclude<CameraPresetEntityAtomType,'bDefaultCamera'>>
* @param {number} flyTime (optional)
* @param {Array<MinMaxType>} locationLimit (optional)
*/
export interface ICameraUpdateOpt extends Partial<Exclude<CameraPresetEntityAtomType, 'bDefaultCamera'>> {
flyTime?: number;
locationLimit?: Array<MinMaxType>;
}
/**
* @interface CameraPresetEntityAtomType
* @param {boolean} bDefaultCamera
* @param {CoordType} location
* @param {Rotator2DType} rotation
* @param {MinMaxType} pitchLimit
* @param {MinMaxType} yawLimit
* @param {MinMaxType} viewDistanceLimit
* @param {number} fieldOfView
* @param {string} controlMode
*/
export interface CameraPresetEntityAtomType {
bDefaultCamera: boolean;
location: CoordType;
rotation: Rotator2DType;
pitchLimit: MinMaxType;
yawLimit: MinMaxType;
viewDistanceLimit: MinMaxType;
fieldOfView: number;
controlMode: string;
}
/**
* @interface CameraControlType
* @param {CoordType} targetPosition (optional)
* @param {Rotator2DType} rotation (optional)
* @param {number} distance (optional)
* @param {number} flyTime (optional)
*/
export interface CameraControlType {
targetPosition?: CoordType;
rotation?: Rotator2DType;
distance?: number;
flyTime?: number;
}
/**
* @interface CameraFocusType
* @param {Rotator2DType} rotation (optional)
* @param {number} distanceFactor (optional)
* @param {number} flyTime (optional)
* @param {Array<any>} entity (optional)
* @param {Array<string>} eids (optional)
*/
export interface CameraFocusType {
rotation?: Rotator2DType;
distanceFactor?: number;
flyTime?: number;
entity?: Array<any>;
eids?: Array<string>;
}
/**
* @interface CameraFollowType
* @extends EntityEidType
* @param {any} entity (optional)
* @param {Rotator2DType} followRotation (optional)
* @param {boolean} useRelativeRotation (optional)
* @param {number} distance (optional)
*/
export interface CameraFollowType extends EntityEidType {
entity?: any;
followRotation?: Rotator2DType;
useRelativeRotation?: boolean;
distance?: number;
bFPS?: boolean;
}
/**
* @interface CameraRotateType
* @param {string} direction (optional)
* @param {number} velocity (optional)
*/
export interface CameraRotateType {
direction?: string;
velocity?: number;
}
/**
* @interface ICameraRoamFrames
* @param {CoordType} location
* @param {Rotator2DType} rotation
* @param {number} time
*/
export interface ICameraRoamFrames {
location: CoordType;
rotation: Rotator2DType;
time: number;
}
/**
* @interface CameraRoamAtomType
* @param {Array<ICameraRoamFrames>} frames
*/
export interface CameraRoamAtomType {
frames: Array<ICameraRoamFrames>;
bAutoRotation: boolean;
bResetAfterFinished: boolean;
}
/**
* @interface CameraRoamType
* @extends EntityEidType,Partial<BasicInfoAtomType>,Partial<CameraRoamAtomType>,Partial<VisibleAtomType>,Partial<EntityFlagAtomType>
*/
export interface CameraRoamType extends EntityEidType, Partial<BasicInfoAtomType>, Partial<CameraRoamAtomType>, Partial<VisibleAtomType>, Partial<EntityFlagAtomType>, Partial<EntityOutlinerAtomType> {
}
/**
* @interface IGenerateRoam
* @param {Partial<CameraRoamAtomType>} CameraRoamAtom (optional)
* @param {Partial<BasicInfoAtomType>} BasicInfoAtom (optional)
* @param {Partial<VisibleAtomType>} VisibleAtom (optional)
* @param {Partial<EntityFlagAtomType>} EntityFlagAtom (optional)
*/
export interface IGenerateRoam {
CameraRoamAtom?: Partial<CameraRoamAtomType>;
BasicInfoAtom?: Partial<BasicInfoAtomType>;
VisibleAtom?: Partial<VisibleAtomType>;
EntityFlagAtom?: Partial<EntityFlagAtomType>;
EntityOutlinerAtom?: Partial<EntityOutlinerAtomType>;
}
/**
* @interface IFocusToAllEntities
* @param {Array<string>} types (optional)
* @param {boolean} bFilterForExclude (optional)
*/
export interface IFocusToAllEntities {
types?: Array<string>;
bFilterForExclude?: boolean;
}
/**
* @interface IFocusToAllEntitiesParams
* @extends Pick<IFocusToAllEntities,'bFilterForExclude'>
* @param {Array<string>} entityTypes (optional)
*/
export interface IFocusToAllEntitiesParams extends Pick<IFocusToAllEntities, 'bFilterForExclude'> {
entityTypes?: Array<string>;
}
/**
* @interface CameraStartAtomType
* @param {CoordType} location
* @param {Rotator2DType} rotation
* @param {Array<MinMaxType>} locationLimit
* @param {MinMaxType} pitchLimit
* @param {MinMaxType} yawLimit
* @param {MinMaxType} viewDistanceLimit
* @param {number} fieldOfView
* @param {string} controlMode
*/
export interface CameraStartAtomType {
location: CoordType;
rotation: Rotator2DType;
locationLimit: Array<MinMaxType>;
pitchLimit: MinMaxType;
yawLimit: MinMaxType;
viewDistanceLimit: MinMaxType;
fieldOfView: number;
controlMode: string;
}
/**
* @type {SetCameraLimitType}
* @alias Pick<CameraStartAtomType,'locationLimit'|'pitchLimit'|'yawLimit'|'viewDistanceLimit'>
*/
export type SetCameraLimitType = Pick<CameraStartAtomType, 'locationLimit' | 'pitchLimit' | 'yawLimit' | 'viewDistanceLimit'>;
/**
* @interface CameraStartType
* @extends EntityEidType,Partial<CameraStartAtomType>
*/
export interface CameraStartType extends EntityEidType, Partial<CameraStartAtomType> {
}
/**
* @interface IGenerateStart
* @param {Partial<CameraStartAtomType>} CameraStartAtom (optional)
*/
export interface IGenerateStart {
CameraStartAtom?: Partial<CameraStartAtomType>;
}
/**
* @interface ICameraPose
* @param {CoordType} location
* @param {Rotator2DType} rotation
* @param {number} flyTime
*/
export interface ICameraPose {
location: CoordType;
rotation: Rotator2DType;
flyTime: number;
}
/**
* @interface IResetCameraPose
* @extends Pick<ICameraPose,'flyTime'>
* @param {string} state
*/
export interface IResetCameraPose extends Pick<ICameraPose, 'flyTime'> {
state: string;
}
/**
* @interface ISetCameraLockLimit
* @param {number} locationLimit
* @param {number} pitchLimit
* @param {number} yawLimit
* @param {number} viewDistanceLimit
*/
export interface ISetCameraLockLimit {
locationLimit: number;
pitchLimit: number;
yawLimit: number;
viewDistanceLimit: number;
}
/**
* @interface IFocusToNodes
* @extends Pick<ICameraPose,'rotation'|'flyTime'>
* @param {Record<string, any>} tiles (optional)
* @param {Record<string, any>} project (optional)
* @param {Array<string>} nodeIds
* @param {number} distanceFactor
*/
export interface IFocusToNodes extends Pick<ICameraPose, 'rotation' | 'flyTime'> {
entity?: Record<string, any>;
nodeIds: Array<string>;
distanceFactor: number;
}
/**
* @interface IFocusToNodesParams
* @extends Omit<IFocusToNodes,'tiles'>
* @param {string} aesTilesEid
*/
export interface IFocusToNodesParams extends Omit<IFocusToNodes, 'tiles'> {
eid: string;
}
/**
* @interface ICameraMoveBasic
* @param {number} step
* @param {boolean} bContinuous (optional)
*/
export interface ICameraMoveBasic {
step: number;
bContinuous?: boolean;
}
/**
* @interface ICameraStepMove
* @extends ICameraMoveBasic
* @param {string} moveDirection
*/
export interface ICameraStepMove extends ICameraMoveBasic {
moveDirection: string;
}
/**
* @interface ICameraStepRotate
* @extends ICameraMoveBasic
* @param {string} rotateDirection
*/
export interface ICameraStepRotate extends ICameraMoveBasic {
rotateDirection: string;
}
export interface ISetCameraSpeed {
rotationYawSpeedScale?: number;
rotationPitchSpeedScale?: number;
zoomSpeedScale?: number;
keyMovementBaseSpeed?: number;
enableDynamicSpeed?: boolean;
}
export interface ISetCameraAnimation {
showTouchEffect?: boolean;
showRotateICON?: boolean;
}