new SceneViewer( [config] [, name])
Creates a new scene viewer.
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object |
<optional> |
An optional configuration object. |
||||||||||||||||||||||||||||||||||||||||||||||||
Properties of
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Name | Type | Argument | Description |
|---|---|---|---|
element |
Element | string |
<optional> |
The DOM element or id attribute of the host container, defaults to 'view-panel'. |
renderer |
THREE.WebGLRenderer |
<optional> |
The THREE WebGL renderer instance to use, creates a new WebGL renderer if not given. |
renderTarget |
THREE.WebGLRenderer |
<optional> |
An optional render target to render output to, defaults to the renderer's canvas. |
canvas |
HTMLCanvasElement |
<optional> |
An optional canvas DOM element to render to, defaults to the renderer's canvas. |
camera |
THREE.Camera |
<optional> |
An optional camera to view the scene when rendering to the canvas. |
background |
THREE.Color | number |
<optional> |
The background colour of the view canvas, defaults to global background color. |
fog |
THREE.Fog | number |
<optional> |
The background fog object or colour, defaults to global background color. |
lights |
Array | THREE.Light |
<optional> |
An optional light or array of lights to illuminate the scene. |
objects |
Array | THREE.Object3D |
<optional> |
An optional object or array of objects to render in the scene. |
viewAxis |
PD.AXIS |
<optional> |
The view axis to render the scene from, defaults to |
showSky |
boolean |
<optional> |
Whether to display a sky hemisphere within the canvas. defaults to false. |
nameA human-readable name for this instance, defaults to 'SceneViewer'.
Throws:
-
Throws an error if no valid container element is given or found.
- Type
- Error
Extends
Members
-
:Array.<THREE.AnimationMixer>
animations
-
An array of animations mixers, if any are present.
Type
- Array.<THREE.AnimationMixer>
-
:THREE.Box3
boundingBox
-
Stores the bounding box of all objects in the main scene.
Type
- THREE.Box3
-
:THREE.Sphere
boundingSphere
-
Stores the bounding sphere of all objects in the main scene.
Type
- THREE.Sphere
-
:THREE.Camera
camera
-
The camera that generates perspective and orthographic views of the model.
Type
- THREE.Camera
-
:HTMLCanvasElement
canvas
-
Stores the HTML5 canvas element the WebGL view is rendered to.
Type
- HTMLCanvasElement
-
:number
canvasHeight
-
The height of the display canvas in pixels, modified to fit within the container element.
This value is typically slightly smaller than the container in order to accommodate its border.
Type
- number
-
:THREE.Vector3
canvasPos
-
The canvas pixel position used by the
computeCanvasCoordinates()andcomputePageCoordinates()methods.Type
- THREE.Vector3
-
:number
canvasWidth
-
The width of the display canvas in pixels, modified to fit within the container element.
This value is typically slightly smaller than the container in order to accommodate its border.
Type
- number
-
:THREE.Clock
clock
-
A clock for tracking animation time.
Type
- THREE.Clock
-
:Element
container
-
The HTML element that hosts the view canvas.
Type
- Element
-
:DOMRect
containerRect
-
The top, left, width and height of the container element.
This is updated whenever the container/canvas size changes and is used to compute normalised canvas coordinates from pointer positions as well as converting canvas to page coordinates.
Type
- DOMRect
-
:number
frameCount
-
Counts the number of rendered frames.
Type
- number
-
:THREE.Frustum
frustum
-
The current view frustum.
This is used to determine if points or parts of the model can be seen within the current camera view.
Type
-
:PD.GridMesh|null
grid
-
A floor/ground grid for indicating the working plane.
Type
- PD.GridMesh | null
-
:THREE.Vector2
hoverPos
-
The current pointer hover position.
This is used mainly by scene editors to track the pointer as it hovers over cursors or hotspots in the model. However, it is also used by scene viewers when zooming to the pointer position.
Type
- THREE.Vector2
-
:boolean
isPlanView
-
Stores whether or not the current view axis is +Z.
Type
- boolean
-
:boolean
isSceneViewer <readonly>
-
A flag identifying this object as a scene viewer.
Type
- boolean
-
:boolean
isViewAxiallyAligned
-
Stores whether or not the current view axis is aligned with one of the cartesian axis.
When an orthogonal view is aligned with an axis, it is considered to be an elevation or plan view, in which interactive rotation is replaced by interactive pan. As a result, this value is used a lot by the
PD.SceneViewer#viewController.Type
- boolean
-
:Array
lights
-
An array of lights to illuminate the scene.
Type
- Array
-
:boolean
logCanvasSize
-
A flag to allow the scene to log its canvas size to the browser console.
This is used mainly for ensuring the canvas is the right size for video capture.
Type
- boolean
-
:string
name
-
The human-readable name for this view panel.
Type
- string
-
:THREE.Vector2
normalisedCanvasCoords
-
The normalised canvas coordinates of the last pointer down.
Type
- THREE.Vector2
-
:Array
objects
-
An array of 3D objects to display in the scene.
Type
- Array
-
:THREE.Raycaster
rayCaster
-
The ray casting object used for interactive selection.
Type
- THREE.Raycaster
-
:THREE.WebGLRenderTarget
renderTarget
-
Stores the render target to use.
If a render target is given, the renderer will render to this target rather than directly to the canvas.
Type
- THREE.WebGLRenderTarget
-
:THREE.WebGLRenderer
renderer
-
The WebGL renderer for displaying the scene.
Type
- THREE.WebGLRenderer
-
:THREE.Scene
scene
-
The scene that is viewed by the camera and displayed in the view canvas.
This is the main scene and where model meshes and lights are added. It is also the scene used to generate shadows.
Type
- THREE.Scene
-
:THREE.Mesh|null
sky
-
Store a simple gradient sky.
Type
- THREE.Mesh | null
-
:PD.ViewOrbital
view
-
The current camera view of the model.
Type
-
:PD.AXIS
viewAxis
-
The view axis the scene is being rendered from.
Type
-
:PD.ViewController
viewController
-
The camera view controller for interacting with the view.
Type
Methods
-
addAnimation(animation)
-
Adds one or more animations to the scene.
Parameters:
Name Type Description animationTHREE.AnimationMixer | Array The new animation or array of animations to add to the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
addEventListener(type, listener)
-
Adds or replaces a listener function.
This method returns the listener function which allows a caller to use an unnamed or arrow function defined within the call and still store it for later removal.
Parameters:
Name Type Description typestring The type of event to listen to.
listenerfunction The function that gets called when the event is fired.
- Inherited From:
- Overrides:
Returns:
Returns the listener function so it can be stored for later removal.
- Type
- function
Example
let event_listener; onMounted() { event_listener = PD.GlobalEvents.addEventListener(PD.EVENT.SITE_LOCATION, (location) => { this.doSomethingWithTheLocation(location); }); }; onUnmounted() { if (event_listener) { PD.GlobalEvents.removeEventListener(PD.EVENT.SITE_LOCATION, event_listener); event_listener = null; } }; -
addLight(light)
-
Adds one or more lights to the scene.
Parameters:
Name Type Description lightTHREE.Light | Array The new light or array of lights to add to the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
addObject(object)
-
Adds one or more geometry objects to the scene.
Parameters:
Name Type Description objectTHREE.Object3D | Array The new object or array of objects to add to the scene.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
checkPixelRatio()
-
Checks for any changes in the maximum allowable device pixel ratio and updates.
Returns:
Returns true if the pixel ratio changed, otherwise false.
- Type
- boolean
-
clearAnimations()
-
Removes all animations from the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
clearLights()
-
Removes all lights from the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
clearObjects()
-
Removes all geometry objects from the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
computeBoundingBox( [action])
-
Computes the bounding box of the currently displayed model.
NOTE: If you have manually set the scene bounding box, you can give an
actionvalue of less than zero to update the view and scene size using the existingboundingBox.Parameters:
Name Type Argument Description actionnumber <optional>
An optional fit action (0:CHECK, 1:EXTENTS, 2:VIEW), defaults to 0.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
computeCanvasCoordinates(model_pos [, canvas_pos])
-
Computes the canvas position of the 3D point, in pixels.
The resulting point is given in canvas coordinates, relative to the top-left corner of the 3D model drawing canvas. If you want actual page coordinates, use the
computePageCoordinates()instead.If only a single argument is given, this method returns the
canvasPosproperty of the scene manager set to the new position.Parameters:
Name Type Argument Description model_posTHREE.Vector3 The 3D model-space position.
canvas_posTHREE.Vector3 <optional>
An optional vector to receive the screen-space position.
Returns:
Returns the given canvas position, or a shared vector.
- Type
- THREE.Vector3
-
computePageCoordinates(model_pos [, page_pos])
-
Computes the page position of the 3D point, in pixels.
The resulting point is given in page coordinates, relative to the top-left corner of the web page content area. If you want actual canvas coordinates, use the
computeCanvasCoordinates()instead.If only a single argument is given, this method returns the
canvasPosproperty of the scene manager set to the new position.Parameters:
Name Type Argument Description model_posTHREE.Vector3 The 3D model-space position.
page_posTHREE.Vector3 <optional>
An optional vector to receive the screen-space position.
Returns:
Returns the given canvas position, or a shared vector.
- Type
- THREE.Vector3
-
computeScreenSpaceScale(pos)
-
Computes the multiplier required to maintain the same screen-space size.
if
PD.GlobalState.cursorDynamicResizeis true, this method calculates the distance from the point to the camera and returns the scale factor required to ensure something at that point remains roughly the same size in screen coordinates. If not set, a one-to-one scale is returned.This is primarily used by the
PD.CursorandPD.Dimensionsclasses to dynamically resize their arrows and text when the view is zoomed.Parameters:
Name Type Description posTHREE.Vector3 A point in model space.
Returns:
Returns the screen-space scaling.
- Type
- number
-
computeViewAxis()
-
Calculates the view axis from current view angles.
Returns:
Returns the computed axis.
- Type
- PD.AXIS
-
computeWorldCoordinates(canvas_pos, model_pos [, depth])
-
Computes a 3D world-space position given a 2D canvas coordinate in pixels.
The canvas position must ve given in canvas coordinates, relative to the top-left corner of the 3D model drawing canvas. If using a pointer event position, you may have to subtract the
PD.SceneViewer#containerRectleftandtopoffsets from theclientXandclientYevent properties.Parameters:
Name Type Argument Default Description canvas_posTHREE.Vector2 A 2D vector defining the canvas position in pixels.
model_posTHREE.Vector3 The vector to receive 3D model-space position.
depthnumber <optional>
0.5 An optional fractional depth value (0 to 1), defaults to 0.5.
Returns:
Returns the given
model_posset to model-space position.- Type
- THREE.Vector3
-
dispatch(type, args)
-
Invokes all the listeners for the given event type with the given arguments.
NOTE: This method is different to the standard
dispatchEvent()method onTHREE.EventDispatcherthat you may be used to. The THREE.js method requires a bespoke event object with the event arguments as properties of that object. It also modifies that object by adding an additionaltargetproperty prior to sending, and creates a copy of the listener array on every call.In our case, events may be generated many times a second as the view, location and/or sun-position are changed dynamically. The listener methods are all called in a tight loop and, given the nature of framework events, they do not remove themselves when called, so changes to the listener array during iteration are unlikely enough for the risk to be tolerable. Also, the dispatching object is typically static and globally available, so there is no need to send a reference to each listener. Whilst having to create a transitory event object, modify it and then copy the array may be a relatively small overhead, it is still an unnecessary one.
As a result, this method simply passes on the given event arguments to each listener without requiring a custom object, modifying it or copying the listener array each time.
Parameters:
Name Type Argument Description typestring The event type identifier.
argsany <repeatable>
The additional arguments that correspond to the given event type.
- Inherited From:
- Overrides:
Returns:
Returns true if at least one event listener was invoked, otherwise false.
- Type
- boolean
-
dispatchCanvasResizeEvent()
-
Notifies any listeners of a CANVAS_SIZE event.
This method is called automatically by the
resize()method. It is provided as a public method for direct use by subclasses that use their own custom resize logic/methods. -
dispose()
-
Cleans up the scene viewer and removes all event listeners.
NOTE: Only call this method when the scene viewer is no longer needed and you wish to free all its resources.
-
ensurePointIsWithinView(point)
-
Checks whether or not the given point is within the view frustum and, if not, moves the point to the center of the current view.
Parameters:
Name Type Description pointTHREE.Vector3 The point to check and move.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
fitFrustumToPoint(point [, tolerance])
-
Check to extend the near and far frustum clipping planes to given point.
Parameters:
Name Type Argument Default Description pointTHREE.Vector3 The point to check near and far distance.
tolerancenumber <optional>
1 An optional tolerance around the point.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
fitGridToModel( [padding])
-
Resizes the background grid to fit the extents of the current model.
Parameters:
Name Type Argument Description paddingnumber <optional>
The padding around the model extents, defaults to
PD.GlobalState.floorGridPaddingmultiplied byPD.GlobalState.gridCellMajor.Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
fitViewToModel( [instant])
-
Animates the current view so that it fits to the visible model.
Parameters:
Name Type Argument Description instantboolean <optional>
An optional flag to force an instant update rather than an animated transition.
-
generateSky()
-
Generates a spherical sky mesh based on CIE sky type.
Returns:
- Type
- THREE.Mesh
-
getClosestViewAxis()
-
Determine the closest cartesian axis to the current view vector.
This uses the current vector between target to camera to determine which is the closest cartesian axis.
Returns:
Returns the closest artesian axis to the view.
- Type
- PD.AXIS
-
getDefaultSkyColor()
-
Retrieve the current default sky color.
This can be used by subclasses to access the default sky color object that is shared by all scenes.
Returns:
Returns the default sky color.
- Type
- THREE.Color
-
getGridExtents()
-
Retrieve the bounding box of the floor/shadow grid.
Returns:
Returns the bounding box.
- Type
- THREE.Box3 | null
-
getModelDashSize()
-
Retrieve the dynamic virtual dashed line size, relative to the model.
Returns:
Returns the relative size of a dash lines, in model units.
- Type
- number
-
getPointSizeModel()
-
Retrieve the dynamic virtual point size, relative to the model.
This value is based on the current model size and is not affected by view zoom.
Returns:
Returns the relative size of a model point, in model units.
- Type
- number
-
getPointSizeView()
-
Retrieve the dynamic virtual point size, relative to the model view.
This value is used to dynamically resize things like 3D cursors and dimension text when the view zooms in and out.
Returns:
Returns the current zoom-moderated relative point size, in model units.
- Type
- number
-
getSkyShader(uniforms)
-
Generates a simple sky shader based on the CIE Standard General Sky type.
See the
PD.SKYDOME.SIMPLE_SHADERclass for more details.Parameters:
Name Type Description uniformsobject A data object containing uniform values.
Returns:
Return a shader material.
- Type
- THREE.ShaderMaterial
-
getUpdatedViewFrustum()
-
Updates and returns the current view frustum.
Returns:
Returns the updated view frustum.
- Type
- THREE.Frustum
-
handleResize()
-
Handles window and container size changes.
-
hasAnimation(animation)
-
Checks if the given animation mixer is already present in the scene.
Parameters:
Name Type Description animationTHREE.AnimationMixer The animation mixer to check.
Returns:
Returns
trueif the mixer is already present, otherwisefalse.- Type
- boolean
-
hasEventListener(type, listener)
-
Determines if the given listener function is associated with the given event type.
Parameters:
Name Type Description typestring The type of event to listen to.
listenerfunction The function that gets called when the event is fired.
- Inherited From:
- Overrides:
Returns:
Returns true if the listener function exists.
- Type
- boolean
-
hasEventListeners(type)
-
Determines if an event has any registered listeners.
Parameters:
Name Type Description typestring The type of event to check.
- Inherited From:
- Overrides:
Returns:
Returns true if there is more than one listener for the given event.
- Type
- boolean
-
initialiseLights( [lights])
-
Sets up an initial lighting configuration.
Parameters:
Name Type Argument Description lightsArray <optional>
An optional list of lights to add.
-
initialiseObjects(objects)
-
Add any THREE objects to the scene.
Parameters:
Name Type Description objectsTHREE.Object3D | Array A list of objects to add.
-
moveBy(vector, amount)
-
Pan or dolly the view by moving the camera.
Parameters:
Name Type Description vectorTHREE.Vector3 The vector direction to move in.
amountnumber The amount to move in the vector direction.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
removeAnimation(animation, action, clip)
-
Removes one or more existing animations from the scene.
Parameters:
Name Type Description animationTHREE.AnimationMixer The existing animation or array of animations to delete from the scene.
actionTHREE.AnimationAction The existing animation action to delete from the scene.
clipTHREE.AnimationClip The existing animation clip to delete from the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
removeEventListener(type, listener)
-
Removes the given listener function from the given event type.
Parameters:
Name Type Description typestring The type of event to listen to.
listenerfunction The function that gets called when the event is fired.
- Inherited From:
- Overrides:
Returns:
Returns true if the listener function was found and removed.
- Type
- boolean
-
removeLight(light)
-
Removes one or more existing lights from the scene.
Parameters:
Name Type Description lightTHREE.Light | Array The existing light or array of lights to delete from the scene.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
removeObject(object)
-
Removes one or more existing geometry objects from the scene.
Parameters:
Name Type Description objectTHREE.Object3D | Array The existing object or array of objects to delete from the scene.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
render()
-
Renders the scene within the WebGL view canvas.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
resize(width, height)
-
Resizes the render canvas.
Parameters:
Name Type Description widthnumber The new width of the render canvas in pixels.
heightnumber The new height of the render canvas in pixels.
-
rotateBy(azi, alt)
-
Rotates the current view by the given poler increments.
Parameters:
Name Type Description azinumber The azimuth angle increment, in degrees.
altnumber The altitude angle increment, in degrees.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
setCameraFOV(fov [, immediate])
-
Sets the field of view of the camera.
Parameters:
Name Type Argument Default Description fovnumber The new camera field of view, in decimal degrees (0.1 to 160).
immediateboolean <optional>
false Whether or not to apply immediately rather than transition, defaults to false.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
setCameraView(axis, dx, dy, dz)
-
Sets the new view direction of the camera.
Parameters:
Name Type Description axisPD.AXIS The camera view axis to use.
dxnumber | THREE.Vector3 The new X component of the view, or a vector.
dynumber The new Y component of the view vector.
dznumber The new Z component of the view vector.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
setOrbitLocus( [vec])
-
Sets the position of the orbit center if different to view target.
Parameters:
Name Type Argument Description vecTHREE.Vector3 | null <optional>
The new centre position of view orbits.
-
setRayCaster(canvas_pos)
-
Updates the internal raycaster based on the given 2D canvas coordinates.
This method computes a ray from the current camera position into the current scene based on the 2D screen-space coordinates. This is typically used by scene editors for interactive selection of elements in the model, but also by scene viewers when zooming to pointer position.
Parameters:
Name Type Description canvas_posTHREE.Vector2 The X and Y position of the pointer relative to the WebGL canvas.
Returns:
Returns the shared raycaster set to the given canvas coordinates.
- Type
- THREE.Raycaster
-
setVectorToCamera( [instant])
-
Sets the new view direction of the camera.
Parameters:
Name Type Argument Description instantboolean <optional>
An optional flag to force an instant update.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
showSky(state)
-
Toggles the display of the background sky.
If
stateis true and there is no previous sky, a new sky will be created.Parameters:
Name Type Description stateboolean Whether or not to show the sky.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneManager
-
snapshot(callback)
-
Creates a snapshot image of the current canvas and passes it to a callback function.
The image will be passed back as a binary large object block (blob) formatted as a PNG encoded image with the same resolution as the current canvas. If the image cannot be created for some reason, a
nullvalue may be passed back.Parameters:
Name Type Description callbackfunction A callback function with the resulting Blob object as a single argument.
-
startTransition( [instant])
-
Initiates an animated transition when the current view has changed.
Parameters:
Name Type Argument Description instantboolean <optional>
An optional flag to force an instant update.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
update()
-
Requests that the view be re-rendered as soon as practical.
Scene viewers start an animation loop that checks 60 times a second for changes to the view controller and head-up display manager, as well as a flag that indicates that the scene needs to be re-rendered. This method simply sets that flag and returns. This allows multiple events and/or actions to call this update method as often as required without rendering the scene every time, but will still be fast enough for most animations and updates to feel fully responsive.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
updateCameraPosition( [model_radius])
-
Updates the position of the camera based on field of view.
Parameters:
Name Type Argument Description model_radiusnumber <optional>
The radius of the current view sphere.
-
updateExtents( [action] [, instant])
-
Check extents of the scene to fit the camera.
NOTE: If you have manually set the scene bounding box, you can give an
actionvalue of less than zero to update the view and scene size using the existingboundingBox.Parameters:
Name Type Argument Description actionnumber <optional>
An optional fit action (0:CHECK, 1:EXTENTS, 2:VIEW), defaults to 0.
instantboolean <optional>
An optional flag to force an instant update rather than an animated transition, defaults to false.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
updateFrustumRange( [extents])
-
Update the near and far frustum clipping planes to include the model bounding box and, if displayed, any projected shadows.
This method needs to be called whenever the camera position, model bounding box or sunlight direction vector changes. If shadows are displayed, if also updates the size of the shadow projection plane to ensure that it fits all shadows.
Parameters:
Name Type Argument Description extentsTHREE.Box3 <optional>
An optional set of extents to check.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
updateShading()
-
Changes the background color of the scene to match the current light/dark mode.
The canvas color is obtained using
PD.GlobalActions.getCanvasColorAsHexrather than accessingPD.GlobalView.canvasColordirectly. This allows thePD.GlobalView.canvasColorvalue to be negative, indicating that the default canvas color values should be used. The actual canvas color (default or otherwise) is stored inPD.SceneViewer#viewso we can access its numeric value. -
updateSkyColors(background, twilight)
-
Sets the background colour
Parameters:
Name Type Description backgroundTHREE.Color The background color for the canvas.
twilightnumber The twilight fraction.
-
updateViewAxis()
-
Update the camera view axis state properties.
-
updateViewDistance()
-
Recalculates the view size based on the distance from camera to target.
Returns:
Returns this scene viewer to support method chaining.
- Type
- PD.SceneViewer
-
zoomBy(factor)
-
Zooms in by moving the camera.
Parameters:
Name Type Description factornumber The multiplier factor.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer
-
zoomToPointer(factor, event)
-
Zooms in by moving the camera towards the pointer.
Parameters:
Name Type Description factornumber The multiplier factor.
eventEvent The pointer event to get the canvas position from.
Returns:
Returns this manager to support method chaining.
- Type
- PD.SceneViewer