ModelsUtil
Description
Helper class for dealing with 3D model hierarchies.
The Distance*
methods can be used for low-level distance computations for common geometric primitives found in 3D model hierarchies:
-
Point (A)
-
Line-segment (A,B)
-
Triangle (A,B,C)
The following computation pairs are supported:
-
Point to line-segment
-
Point to triangle
-
Line-segment to line-segment
-
Line-segment to triangle
-
Triangle to triangle
These methods are similar to the ones of Geometric, except that they use different input vector parametrization in order to reduce the amount of redundant computations.
Public / Methods
ApplyTransform
2 overloads
Applies the non-uniform scaling to the given vertex arrays.
Applies the given transformation to the given vertex arrays.
ComputeNormals
Computes smooth per-vertex normal vectors given vertex arrays.
Vertex positions are read from Semantic.Position, non unit-length normal vectors are written to Semantic.Normal. If Semantic.Normal is already present, normal vectors will only be computed for vertex array entries that are equal to Vec3F.Zero. To produce per-face normals, vertices must have been duplicated accordingly, before this method is called.
- See also
DistanceLineSegmentToLineSegment
Computes the distance between the given line-segment (first) and line-segment (second).
This method is similar to Geometric.DistanceLineToLine, if the returned line coefficients are clamped to [0..1].
DistanceLineSegmentToTriangle
Computes the distance between the given line-segment (first) and triangle (second).
DistancePointToLineSegment
Computes the distance between the given point (first) and line-segment (second).
This method is similar to Geometric.DistancePointToLineSegment3
DistancePointToTriangle
Computes the distance between the given point (first) and triangle (second).
This method is similar to Geometric.DistancePointToTriangle.
DistanceTriangleToTriangle
Computes the distance between the given triangle (first) and triangle (second).
NormalizeNormals
Normalizes the normal vectors in the given vertex arrays to unit-length.
Undefined normal vectors will be set to Vec3F.Zero.
- See also
ReadModelDebug
Implements the default behaviour of the IModelReader.ReadModelDebug method.
Implementations of IModelReader may delegate to this method in order to provide the default behaviour.
- IOException
-
If an I/O error has occurred.
ReadTextLine
Reads a line of text from stream in, using the CharacterEncodingSimple.ISO_8859_1 encoding.
- IOException
-
If an I/O error has occurred while reading from stream in.