wnp.CameraFeatures
Summary
The Camera Features adds cool features for camera management.
Item Index
Methods
Events
Methods
buildPlaneFromBB
Syntax
buildPlaneFromBB
-
box
Summary
Builds a plane from a bounding box.
Parameters:
-
boxBABYLON.BoundingBoxA bounding box.
Returns:
A plane.
computeAnimation
Syntax
Summary
Computes an animation by given an amnimatable object , source state and destination state, compute the animations babylon way and start play it
Parameters:
-
targetBABYLON.Meshis the animatable object that will be animate
-
srcBABYLON.Vectior3is a set of property and their value at the begin of the animation
-
dstObjectis a set of property and their value at the end of the animation
-
optionsObjectAnimation options
-
[duration=0]Number optionalAnimation duration in ms.
-
[callback]Function optionalA function to call at the end of the animation.
-
[cleanAfterAnimation=true]Boolean optionalIf true the animation will be cleaned at the end, if false, the cancel function MUST be called somewhere.
-
[name="Animation"]String optionalA name.
-
[isACamera=false]Boolean optionalIf set to true, the event camera.move will be triggered during the animation
-
[smooth='linear'] Smoothing interpolation. Accepted values are `"linear"`, `"ease"` or a function f : [0:1] -> [0:1]String | Function optional
-
Returns:
A function that cancels the animation on calling and cleans it up. This function will be called at the end of the animation if cleanAfterAnimation is true.
computeCameraStateLooking
Syntax
Summary
Computes the best camera state to focus on an object. Only works with an OrbitCamera.
Parameters:
-
targetBABYLON.MeshThe mesh to focus on.
-
cameraBABYLON.CameraThe camera involved.
-
[viewport]BABYLON.Viewport optionalThe viewport to use, default is (0, 0, 1, 1);
Returns:
An object where :
targetis the targetted mesh.alphais the alpha angle of the camera (seeOrbitCameradoc).betais the beta angle of the camera (seeOrbitCameradoc).radiusis the radius of the camera (seeOrbitCameradoc).
dynamicWallTransparency
Syntax
dynamicWallTransparency
()
Summary
Applies transparency to wall materials based on the position and target of the camera. Used to see through walls and roofs.
fillByZIndex
Syntax
Summary
This function is related to the wall transparency.
Builds an index array corresponding to the submesh indexes in the wall mesh.
These submeshes must be transparent to have a clear display of the camera target.
This is only relevant if the wall transparency option is active.
Parameters:
-
wallMeshBABYLON.MeshThe wall mesh.
Returns:
The submesh index array.
getBestFocusRadius
Syntax
Summary
Gets the best focus radius for the camera to be in the best setup, in order to see the whole mesh.
N.B : The current position and target of the camera is irrelevant, this function will work anyway.
Parameters:
-
targetBABYLON.MeshThe mesh to focus on.
-
cameraBABYLON.CameraThe camera involved.
-
sceneBABYLON.SceneThe scene.
Returns:
radius Returns the radius to use.
makeWallsOpaque
Syntax
makeWallsOpaque
-
[floor]
Summary
Sets all walls to opaque for a given floor.
Parameters:
-
[floor]FloorStructure optionalA floor to make opaque. Default is the current selected floor.
onCameraMove
Syntax
onCameraMove
-
event
Summary
Tests for wall transparency.
Triggered on wnp.engine3D.camera.move.
Parameters:
-
eventEventAn event object.
onCameraZoom
Syntax
onCameraZoom
-
event
Summary
Tests for wall transparency.
Triggered on wnp.engine3D.camera.zoom.
Parameters:
-
eventEventAn event object.
onContextChanged
Syntax
onContextChanged
-
event
Summary
Sets all walls to opaque when the 3D mode is enabled.
Triggered on wnp.contextChanged
Parameters:
-
eventEventAn event object.
onGlobaleFloorReady
Syntax
onGlobaleFloorReady
-
event
Summary
Handler which will apply transparency only on walls at the current floor.
Triggered on wnp.engine3D.allFloorsReady
Parameters:
-
eventEventAn event object.
onWallsReady
Syntax
onWallsReady
-
event
Summary
Handler called when the whole walls are ready (with their subslopes).
Triggered on wnp.engine3D.subslopeOverturesReady.
Parameters:
-
eventEventAn event object.
setCamera
Syntax
setCamera
-
camera
Summary
Sets the current camera for this class.
Parameters:
-
cameraBABYLON.CameraThe camera to use.
startTransparency
Syntax
startTransparency
()
Summary
Starts the transparency when the user clicks on the transparency button.
stopTransparency
Syntax
stopTransparency
()
Summary
Stops the wall transparency when the user clicks on the transparency button.
Events
wnp.engine3D.camera.move
Syntax
wnp.engine3D.camera.move
Summary
Fired when the 3D camera has moved.