Skip to content

@jdultra/ultra-globe


@jdultra/ultra-globe / PerspectiveProjectedImageryLayer

Class: PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:27

Perspective-projected imagery layer.

This layer projects a single texture source, including a regular THREE.Texture or THREE.VideoTexture, onto terrain and/or other drape targets through the existing projected-layer screen-space pipeline.

The projector behaves like a perspective camera. The pose can be supplied as either:

  • longitude / latitude / height plus yaw / pitch / roll, or
  • world Cartesian position plus quaternion.

CPU query helpers are exposed in both directions:

  • world Cartesian position to projector UV
  • projector UV back to a projected world hit

UV-to-world queries currently support terrain hits. The query engine is intentionally structured so mesh and splat support can be added later without changing the public API.

Projection is occlusion-aware by default, so receivers hidden from the projector camera are masked out unless that behavior is explicitly disabled.

A thin white frustum helper is enabled by default. It is attached directly to map.vectorScene, follows floating-origin shifts, and is cleaned up automatically.

Extends

  • BaseProjectedTextureLayer

Extended by

Constructors

Constructor

new PerspectiveProjectedImageryLayer(properties?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:64

Parameters

properties?

Object

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.constructor

Properties

attribution

attribution: string | null

Defined in: layers/Layer.d.ts:29

Inherited from

BaseProjectedTextureLayer.attribution


bounds

bounds: any

Defined in: layers/Layer.d.ts:26

Inherited from

BaseProjectedTextureLayer.bounds


drapeOnMesh

drapeOnMesh: any

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:11

Inherited from

BaseProjectedTextureLayer.drapeOnMesh


drapeOnSplats

drapeOnSplats: any

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:12

Inherited from

BaseProjectedTextureLayer.drapeOnSplats


drapeOnTerrain

drapeOnTerrain: any

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:13

Inherited from

BaseProjectedTextureLayer.drapeOnTerrain


featherScale

featherScale: number

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:5

Inherited from

BaseProjectedTextureLayer.featherScale


flipY

flipY: boolean

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:4

Inherited from

BaseProjectedTextureLayer.flipY


id

id: string | number

Defined in: layers/Layer.d.ts:24

Inherited from

BaseProjectedTextureLayer.id


isBaseProjectedTextureLayer

isBaseProjectedTextureLayer: boolean

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:3

Inherited from

BaseProjectedTextureLayer.isBaseProjectedTextureLayer


isLayer

isLayer: boolean

Defined in: layers/Layer.d.ts:22

Inherited from

BaseProjectedTextureLayer.isLayer


isPerspectiveProjectedImageryLayer

isPerspectiveProjectedImageryLayer: boolean

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:120


isProjectedImageryLayer

isProjectedImageryLayer: boolean

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:10

Inherited from

BaseProjectedTextureLayer.isProjectedImageryLayer


isProjectedLayer

isProjectedLayer: boolean

Defined in: layers/ProjectedLayer.d.ts:15

Inherited from

BaseProjectedTextureLayer.isProjectedLayer


isRasterLayer

isRasterLayer: boolean

Defined in: layers/RasterLayer.d.ts:21

Inherited from

BaseProjectedTextureLayer.isRasterLayer


isSelectable

isSelectable: boolean

Defined in: layers/Layer.d.ts:23

Inherited from

BaseProjectedTextureLayer.isSelectable


listeners

listeners: Object

Defined in: layers/Layer.d.ts:28

Inherited from

BaseProjectedTextureLayer.listeners


localBounds

localBounds: any

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:9

Inherited from

BaseProjectedTextureLayer.localBounds


map

map: any

Defined in: layers/Layer.d.ts:92

Inherited from

BaseProjectedTextureLayer.map


material

material: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:26

Inherited from

BaseProjectedTextureLayer.material


name

name: string

Defined in: layers/Layer.d.ts:25

Inherited from

BaseProjectedTextureLayer.name


occlusionAware

occlusionAware: boolean

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:8

Inherited from

BaseProjectedTextureLayer.occlusionAware


occlusionBias

occlusionBias: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:10

Inherited from

BaseProjectedTextureLayer.occlusionBias


occlusionDepthBiasFactor

occlusionDepthBiasFactor: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:11

Inherited from

BaseProjectedTextureLayer.occlusionDepthBiasFactor


occlusionDepthMapSize

occlusionDepthMapSize: number

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:9

Inherited from

BaseProjectedTextureLayer.occlusionDepthMapSize


occlusionSlopeBias

occlusionSlopeBias: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:12

Inherited from

BaseProjectedTextureLayer.occlusionSlopeBias


paused

paused: boolean | undefined

Defined in: layers/Layer.d.ts:82

Inherited from

BaseProjectedTextureLayer.paused


projectorModel

projectorModel: PerspectiveProjectorModel

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:13

Inherited from

BaseProjectedTextureLayer.projectorModel


queryEngine

queryEngine: PerspectiveProjectionQueryEngine

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:14

Inherited from

BaseProjectedTextureLayer.queryEngine


queryResolution

queryResolution: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:6

Inherited from

BaseProjectedTextureLayer.queryResolution


reference

reference: number

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:15

Inherited from

BaseProjectedTextureLayer.reference


refreshQueryCacheEveryFrame

refreshQueryCacheEveryFrame: boolean

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:7

Inherited from

BaseProjectedTextureLayer.refreshQueryCacheEveryFrame


showHelpers

showHelpers: boolean

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:121


texture

texture: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:15

Inherited from

BaseProjectedTextureLayer.texture


transform

transform: Converter | undefined

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:8

Inherited from

BaseProjectedTextureLayer.transform


transparency

transparency: any

Defined in: layers/imagery/ProjectedImageryLayer.d.ts:14

Inherited from

BaseProjectedTextureLayer.transparency


uAllowMesh

uAllowMesh: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:36

Inherited from

BaseProjectedTextureLayer.uAllowMesh


uAllowSplats

uAllowSplats: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:37

Inherited from

BaseProjectedTextureLayer.uAllowSplats


uAllowTerrain

uAllowTerrain: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:35

Inherited from

BaseProjectedTextureLayer.uAllowTerrain


uCameraWorldMatrix

uCameraWorldMatrix: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:29

Inherited from

BaseProjectedTextureLayer.uCameraWorldMatrix


uFeatherScale

uFeatherScale: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:38

Inherited from

BaseProjectedTextureLayer.uFeatherScale


uFlipY

uFlipY: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:34

Inherited from

BaseProjectedTextureLayer.uFlipY


uOpacity

uOpacity: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:28

Inherited from

BaseProjectedTextureLayer.uOpacity


uProjectorNearFar

uProjectorNearFar: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:33

Inherited from

BaseProjectedTextureLayer.uProjectorNearFar


uProjectorOcclusionBias

uProjectorOcclusionBias: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:40

Inherited from

BaseProjectedTextureLayer.uProjectorOcclusionBias


uProjectorOcclusionDepthBiasFactor

uProjectorOcclusionDepthBiasFactor: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:41

Inherited from

BaseProjectedTextureLayer.uProjectorOcclusionDepthBiasFactor


uProjectorOcclusionEnabled

uProjectorOcclusionEnabled: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:39

Inherited from

BaseProjectedTextureLayer.uProjectorOcclusionEnabled


uProjectorOcclusionSlopeBias

uProjectorOcclusionSlopeBias: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:42

Inherited from

BaseProjectedTextureLayer.uProjectorOcclusionSlopeBias


uProjectorPosition

uProjectorPosition: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:30

Inherited from

BaseProjectedTextureLayer.uProjectorPosition


uProjectorView

uProjectorView: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:31

Inherited from

BaseProjectedTextureLayer.uProjectorView


uProjectorViewProjection

uProjectorViewProjection: any

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:32

Inherited from

BaseProjectedTextureLayer.uProjectorViewProjection


visible

visible: boolean

Defined in: layers/Layer.d.ts:27

Inherited from

BaseProjectedTextureLayer.visible

Methods

addListener()

addListener(key, listener): void

Defined in: layers/Layer.d.ts:74

Adds a listener for layer events

Parameters

key

any

can be anything but should be unique

listener

Function

a function : (layer, eventType)=>{}

Returns

void

Inherited from

BaseProjectedTextureLayer.addListener


dispose()

dispose(): void

Defined in: layers/Layer.d.ts:87

disposes of any resources used by this layer

Returns

void

Inherited from

BaseProjectedTextureLayer.dispose


getBounds()

getBounds(): Box2

Defined in: layers/Layer.d.ts:62

Returns

Box2

bounds in longitude latitude (degrees)

Inherited from

BaseProjectedTextureLayer.getBounds


getCenter()

getCenter(sfct): Vector3

Defined in: layers/Layer.d.ts:37

Moves a given point to this layer's center in degree longitude/latitude

Parameters

sfct

Vector3

a point to move

Returns

Vector3

the input point

Inherited from

BaseProjectedTextureLayer.getCenter


getID()

getID(): string | number

Defined in: layers/Layer.d.ts:42

Returns

string | number

layer id

Inherited from

BaseProjectedTextureLayer.getID


getName()

getName(): string

Defined in: layers/Layer.d.ts:47

Returns

string

layer name

Inherited from

BaseProjectedTextureLayer.getName


invalidateQueryCache()

invalidateQueryCache(): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:355

Invalidates cached UV-to-world query results.

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.invalidateQueryCache


projectWorldToUV()

projectWorldToUV(worldPosition): Object

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:339

Projects a world Cartesian position into projector UV space.

Parameters

worldPosition

any

World Cartesian position in EPSG:4978 meters.

Returns

Object


queryUVToTerrain()

queryUVToTerrain(uv, options?): Promise<{ position: any; type: number | null; valid: boolean; distance?: number; uv: any; }>

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:403

Resolves a projector UV back to a terrain hit.

Parameters

uv

any

Projector UV coordinate.

options?

Object

Returns

Promise<{ position: any; type: number | null; valid: boolean; distance?: number; uv: any; }>

Async


queryUVToWorld()

queryUVToWorld(uv, options?): Promise<{ position: any; type: number | null; valid: boolean; distance?: number; uv: any; }>

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:376

Resolves a projector UV back to a world hit.

Terrain is supported now. Mesh and splat targets are intentionally left as future extensions behind the same public method.

Parameters

uv

any

Projector UV coordinate.

options?

Object

Returns

Promise<{ position: any; type: number | null; valid: boolean; distance?: number; uv: any; }>

Async


raycast()

raycast(raycaster): any[]

Defined in: layers/Layer.d.ts:80

raycasts through objects from this layer if the layer is selectable and if the objects are raycastable

Parameters

raycaster

Object

a three.js Raycaster

Returns

any[]

an array of selected objects

Inherited from

BaseProjectedTextureLayer.raycast


removeListener()

removeListener(key): void

Defined in: layers/Layer.d.ts:68

Removes the listener associated to the given key

Parameters

key

any

can be anything but should be unique

Returns

void

Inherited from

BaseProjectedTextureLayer.removeListener


render()

render(colorTexture, normalTexture, emissiveTexture, metalnessRoughnessTexture, positionTexture, renderTarget): boolean

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:69

Render imagery into a render target using the provided position texture. Subclasses must implement this method.

Parameters

colorTexture

any

normalTexture

any

emissiveTexture

any

metalnessRoughnessTexture

any

positionTexture

any

renderTarget

any

Returns

boolean

Inherited from

BaseProjectedTextureLayer.render


setFeatherScale()

setFeatherScale(featherScale): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:284

Updates the optional UV border feather width.

A value of 0 disables feathering. Positive values apply a smooth alpha fade near projector UV borders.

Parameters

featherScale

number

Feather width in normalized UV units.

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setFeatherScale


setFlipY()

setFlipY(flipY): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:274

Updates the projected V orientation.

Parameters

flipY

boolean

Whether projected V should be flipped.

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setFlipY


setIntrinsics()

setIntrinsics(intrinsics?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:213

Updates projector intrinsics.

Parameters

intrinsics?

Object

Returns

PerspectiveProjectedImageryLayer


setName()

setName(name): void

Defined in: layers/Layer.d.ts:52

change the layer name

Parameters

name

string

Returns

void

Inherited from

BaseProjectedTextureLayer.setName


setOcclusionAware()

setOcclusionAware(occlusionAware?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:294

Enables or disables projector-view occlusion masking.

When enabled, the layer renders a depth map from the projector camera each frame and suppresses projected texels on receivers that sit behind nearer geometry.

Parameters

occlusionAware?

boolean

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setOcclusionAware


setOcclusionBias()

setOcclusionBias(options?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:301

Updates occlusion-bias parameters.

Parameters

options?

Object

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setOcclusionBias


setOcclusionDepthMapSize()

setOcclusionDepthMapSize(size?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:312

Updates the projector depth-map resolution used for occlusion masking.

Parameters

size?

number

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setOcclusionDepthMapSize


setProjectorPose()

setProjectorPose(pose?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:145

Updates the projector pose.

Two forms are supported:

  • world-space pose with positionWorld and quaternion
  • geodetic pose with projectorLLH (or one of its aliases) plus yaw / pitch / roll

Any successful pose update invalidates cached UV queries and refreshes the helper frustum.

Parameters

pose?

Object

Returns

PerspectiveProjectedImageryLayer


setProjectorPoseFromLLHYawPitchRoll()

setProjectorPoseFromLLHYawPitchRoll(llh, yaw, pitch, roll): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:185

Sets the projector pose from geodetic coordinates and yaw / pitch / roll.

Parameters

llh

any

Projector longitude, latitude, height.

yaw

number

Projector yaw in degrees.

pitch

number

Projector pitch in degrees.

roll

number

Projector roll in degrees.

Returns

PerspectiveProjectedImageryLayer


setProjectorPoseFromWorldQuaternion()

setProjectorPoseFromWorldQuaternion(positionWorld, quaternion): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:197

Sets the projector pose from a world Cartesian position and quaternion.

Parameters

positionWorld

any

Projector world Cartesian position.

quaternion

any

Projector world orientation.

Returns

PerspectiveProjectedImageryLayer


setShowHelpers()

setShowHelpers(showHelpers?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:319

Enables or disables the white frustum helper lines.

Parameters

showHelpers?

boolean

Returns

PerspectiveProjectedImageryLayer


setTargetMask()

setTargetMask(targetMask?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:263

Sets which drape target classes may receive the projection.

Parameters

targetMask?

Object

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setTargetMask


setTexture()

setTexture(texture, options?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:229

Assigns the projected texture source.

By default the layer does not dispose externally owned textures. Pass ownsSourceTexture: true when the layer should release the texture on replacement or dispose.

Parameters

texture

Texture

Texture to project.

options?

Object

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setTexture


setVideo()

setVideo(video, options?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:254

Wraps an HTMLVideoElement in a new THREE.VideoTexture and uses it as the projected source.

The created texture is owned by the layer by default and is disposed automatically. The underlying video element is never disposed by the layer.

Parameters

video

HTMLVideoElement

Video element to project.

options?

Object

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setVideo


setVideoTexture()

setVideoTexture(videoTexture, options?): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:241

Assigns an existing projected THREE.VideoTexture.

The layer does not take ownership unless ownsSourceTexture: true is supplied.

Parameters

videoTexture

VideoTexture

Video texture to project.

options?

Object

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setVideoTexture


setVisible()

setVisible(visible): PerspectiveProjectedImageryLayer

Defined in: layers/projections/PerspectiveProjectedImageryLayer.d.ts:326

Shows or hides the layer and its helper geometry.

Parameters

visible

boolean

Whether the layer should be visible.

Returns

PerspectiveProjectedImageryLayer

Overrides

BaseProjectedTextureLayer.setVisible


updateMaterialTexture()

updateMaterialTexture(): void

Defined in: layers/projections/BaseProjectedTextureLayer.d.ts:50

Returns

void

Inherited from

BaseProjectedTextureLayer.updateMaterialTexture