public class ObjSplitting extends Object
ReadableObj objects into multiple parts,
based on different criteria.| Modifier and Type | Method and Description |
|---|---|
static Map<String,Obj> |
splitByGroups(ReadableObj obj)
Split the given
ReadableObj based on its groups. |
static Map<String,Obj> |
splitByMaterialGroups(ReadableObj obj)
Split the given
ReadableObj based on its material groups. |
static List<Obj> |
splitByMaxNumVertices(ReadableObj obj,
int maxNumVertices)
Split the given
ReadableObj into Obj instances based
on the given maximum number of vertices. |
public static Map<String,Obj> splitByGroups(ReadableObj obj)
ReadableObj based on its groups. This will
create one Obj from each (non-empty) group in the
given input.obj - The input ReadableObjObj for each non-empty group of the given inputpublic static Map<String,Obj> splitByMaterialGroups(ReadableObj obj)
ReadableObj based on its material groups.
This will create one Obj from each (non-empty) material
group in the given input. usemtl directive), then the resulting map will
be empty. obj - The input ReadableObjusemtl directives in the input file) to the Obj
that represents this material group.public static List<Obj> splitByMaxNumVertices(ReadableObj obj, int maxNumVertices)
ReadableObj into Obj instances based
on the given maximum number of vertices.n vertices,
the resulting parts will have at most maxNumVertices + n - 1
vertices. For example, if the given input contains only triangles,
then the parts will have at most maxNumVertices + 2
vertices.Obj into parts that it may be rendered in
environments that only allow a certain number of vertices (indices)
per rendered object. For example, in order to create parts whose
indices can be represented with an unsigned short value,
this method may be called with maxNumVertices=65000.obj - The input ReadableObjmaxNumVertices - The maximum number of verticesObj for each part.IllegalArgumentException - If the given number is smaller than 3.Copyright © 2018. All rights reserved.