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:
-
box
BABYLON.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:
-
target
BABYLON.Meshis the animatable object that will be animate
-
src
BABYLON.Vectior3is a set of property and their value at the begin of the animation
-
dst
Objectis a set of property and their value at the end of the animation
-
options
ObjectAnimation 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:
-
target
BABYLON.MeshThe mesh to focus on.
-
camera
BABYLON.CameraThe camera involved.
-
[viewport]
BABYLON.Viewport optionalThe viewport to use, default is (0, 0, 1, 1);
Returns:
An object where :
target
is the targetted mesh.alpha
is the alpha angle of the camera (seeOrbitCamera
doc).beta
is the beta angle of the camera (seeOrbitCamera
doc).radius
is the radius of the camera (seeOrbitCamera
doc).
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:
-
wallMesh
BABYLON.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:
-
target
BABYLON.MeshThe mesh to focus on.
-
camera
BABYLON.CameraThe camera involved.
-
scene
BABYLON.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:
-
event
EventAn event object.
onCameraZoom
Syntax
onCameraZoom
-
event
Summary
Tests for wall transparency.
Triggered on wnp.engine3D.camera.zoom
.
Parameters:
-
event
EventAn event object.
onContextChanged
Syntax
onContextChanged
-
event
Summary
Sets all walls to opaque when the 3D mode is enabled.
Triggered on wnp.contextChanged
Parameters:
-
event
EventAn 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:
-
event
EventAn event object.
onWallsReady
Syntax
onWallsReady
-
event
Summary
Handler called when the whole walls are ready (with their subslopes).
Triggered on wnp.engine3D.subslopeOverturesReady
.
Parameters:
-
event
EventAn event object.
setCamera
Syntax
setCamera
-
camera
Summary
Sets the current camera for this class.
Parameters:
-
camera
BABYLON.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.