MCPcopy Index your code
hub / github.com/processing/processing / addChildren

Method addChildren

core/src/processing/core/PShapeOBJ.java:129–150  ·  view source on GitHub ↗
(ArrayList<OBJFace> faces,
                             ArrayList<OBJMaterial> materials,
                             ArrayList<PVector> coords,
                             ArrayList<PVector> normals,
                             ArrayList<PVector> texcoords)

Source from the content-addressed store, hash-verified

127
128
129 protected void addChildren(ArrayList<OBJFace> faces,
130 ArrayList<OBJMaterial> materials,
131 ArrayList<PVector> coords,
132 ArrayList<PVector> normals,
133 ArrayList<PVector> texcoords) {
134 int mtlIdxCur = -1;
135 OBJMaterial mtl = null;
136 for (int i = 0; i < faces.size(); i++) {
137 OBJFace face = faces.get(i);
138
139 // Getting current material.
140 if (mtlIdxCur != face.matIdx || face.matIdx == -1) {
141 // To make sure that at least we get the default material
142 mtlIdxCur = PApplet.max(0, face.matIdx);
143 mtl = materials.get(mtlIdxCur);
144 }
145
146 // Creating child shape for current face.
147 PShape child = new PShapeOBJ(face, mtl, coords, normals, texcoords);
148 addChild(child);
149 }
150 }
151
152
153 static protected void parseOBJ(PApplet parent, String path,

Callers 1

PShapeOBJMethod · 0.95

Calls 4

maxMethod · 0.95
getMethod · 0.65
sizeMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected