 |
ModelUtilsPositionAndScaleSceneNode Method |
PositionAndScaleSceneNode method translates and scales the sceneNode so that it is positioned according to position and positionType parameters
and that it will fit into the size defined by finalSize parameter.
This method may call
Update method in case the BoundingBox is Empty.
Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntaxpublic static void PositionAndScaleSceneNode(
SceneNode sceneNode,
Vector3 position,
PositionTypes positionType,
Vector3 finalSize,
bool preserveAspectRatio = true,
bool preserveCurrentTransformation = true,
bool createStandardTransform = true
)
Parameters
- sceneNode SceneNode
- SceneNode to center and scale
- position Vector3
- Vector3 that specifies position of the sceneNode
- positionType PositionTypes
- type of position
- finalSize Vector3
- Vector3 that specifies the new size of the sceneNode (if preserveAspectRatio is true, then min scale will be used to fit the model into the size)
- preserveAspectRatio Boolean (Optional)
- if true, then the scale is uniform (using the min required scale to fit the model into finalSize)
- preserveCurrentTransformation Boolean (Optional)
- if true (by default), then the translation and scale transform are added to the existing transform.
- createStandardTransform Boolean (Optional)
- if true (by default), then a new StandardTransform is created instead of a TransformGroup with ScaleTransform and TranslateTransform. This can be set to false for backwards compatibility.
See Also