TwinfinityCameraExtensions
Hierarchy
- TwinfinityCameraExtensions
Index
Properties
readonlyhasMovedInCurrentFrame
true
if the camera has somehow moved during this frame. Otherwise false
. Will automatically be reset to false
after each frame has rendered (if camera is used by TwinfinityViewer).
readonlyperspectiveDistanceFromOrtho
Gets the distance that the camera has to be positioned at (perpendicular to pivot plane) when in perspective mode to get approximately the same view. The objects in the center of the frustum will appear to have almost the same size.
Accessors
viewer
Twinfinity viewer instance.
Returns undefined | TwinfinityViewer
Methods
clearHasMovedInCurrentFrame
Sets hasMovedInCurrentFrame to
false
.Returns void
createPickingRayToRef
Creates a ray from the camera through the screen coordinate defined by screenPos. This ray is useful for pick operations.
Parameters
dst: Ray
Ray is written here.
o: CanvasPosition
Returns Ray
getFrustumToRef
Gets the camera frustum planes
Parameters
dst: FrustumPlanes
Camera frustum planes are written
Returns FrustumPlanes
Frustum planes (same reference as
dst
)
getOrthoFrustumSizeToRef
pick
Performs intersection testing against objects in the scene from the cameras point of view.
Parameters
o: PickOption
See PickOption.
Returns PickResult
setOrtho
Sets the orthographic frustum based on either
distance
orheight
Parameters
o: { distance: number } | { height: number }
Sets orthographic frustum based on either
distance
orheight
. Ifheight
then Camera.orthoBottom = -height
/ 2 and Camera.orthoTop is set toheight
/ 2. Camera.orthoLeft and Camera.orthoRight is then calculated using the aspect ratio.- Ifdistance
then frustum is sized optimally so a object in center of camera atdistance
will get approx the same size as it would with the perspective camera.
Returns void
stateSnapshot
Gets a TwinfinityState instance which can be used to check if a camera has changed since a previous check.
Returns TwinfinityCameraStateSnapshot
Includes methods and properties for querying and manipulating a Camera instance.