Click or drag to resize
Ab4d.SharpEngine logo

ModelUtils Class

ModelUtils class contains static methods that can process ModelNode objects that are children of a GroupNode.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.UtilitiesModelUtils

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public static class ModelUtils

The ModelUtils type exposes the following members.

Methods
 NameDescription
Public methodStatic memberChangeBackMaterial ChangeMaterial method changes BackMaterial (and preserves Material) on all child models of the specified groupNode.
Public methodStatic memberChangeMaterial(SceneNode, Material) ChangeMaterial method changes Material (and preserves BackMaterial) on all child models of the specified groupNode.
Public methodStatic memberChangeMaterial(SceneNode, Material, Material) ChangeMaterial method changes Material and BackMaterial on all child models of the specified sceneNode (or on the specified ModelNode if it is specified as sceneNode).
Public methodStatic memberCountAllPositions CountAllPositions method returns the total number of all positions that are defined in ModelNodes that are children of the specified GroupNode.
Public methodStatic memberCountAllTriangles CountAllTriangles method returns the total number of all triangles that are defined in ModelNodes that are children of the specified GroupNode.
Public methodStatic memberGetModelTranslationVector GetModelTranslationVector returns a Vector3 that defines how much the model with modelBounds needs to be translated in order to be positioned at a targetPosition that represents a targetPositionType.
Public methodStatic memberPositionAndScaleSceneNode PositionAndScaleModel3D method translates and scales the model3D so that it is positioned according to position and positionType parameters and that it will fit into the Size3D defined by finalSize parameter. This method may call Update method in case the BoundingBox is Empty.
Public methodStatic memberPositionSceneNode PositionSceneNode method translates the sceneNode so that it is positioned according to position and positionType parameters. This method may call Update method in case the BoundingBox is Empty.
Public methodStatic memberReplaceMaterial Goes through all models and replaces the materialToFind with newMaterial. When isBackMaterial is set to true, BackMaterial is replaced instead of Material.
Public methodStatic memberSetMaterialOpacity Goes through all models in the models hierarchy that start with the specified sceneNode and sets the Opacity Materials and BackMaterials to the specified opacity value. Materials need to be defined as StandardMaterial objects.
Top
See Also