Click or drag to resize
AB4D logo

IFitIntoViewCameraGetFitIntoViewDistanceOrCameraWidth Method

GetFitIntoViewDistanceOrCameraWidth returns Distance (for PerspectiveCamera) or CameraWidth (for OrthographicCamera) and sets the newTargetPosition that will adjust the camera so that all the objects on the scene will be visible from one edge of the viewport to another edge.

Namespace: Ab3d.Cameras
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.1.8864.1045
Syntax
C#
double GetFitIntoViewDistanceOrCameraWidth(
	IList<Visual3D> visuals,
	FitIntoViewType fitIntoViewType,
	bool adjustTargetPosition,
	out Point3D newTargetPosition
)

Parameters

visuals  IListVisual3D
IList of Visual3D objects
fitIntoViewType  FitIntoViewType
type of check
adjustTargetPosition  Boolean
true if the center position is adjusted; false if center position is preserved
newTargetPosition  Point3D
out Point3D that specified the new target position

Return Value

Double
Distance (for PerspectiveCamera) or CameraWidth (for OrthographicCamera)
Remarks

GetFitIntoViewDistanceOrCameraWidth returns Distance (for PerspectiveCamera) or CameraWidth (for OrthographicCamera) and sets the newTargetPosition that will adjust the camera so that all the objects on the scene will be visible from one edge of the viewport to another edge.

DXEngine notice:
When scene contains 3D objects defined by SceneNodes that are not created from WPF 3D objects (for example MeshObjectNode), this method can get the bounds of those SceneNodes but cannot access individual positions (as CheckBounds fitIntoViewType would be used for those SceneNodes).

See Also