You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
820 B
35 lines
820 B
package com.mykaruga.models.wavefront.parser.mtl;
|
|
|
|
|
|
import com.mykaruga.models.wavefront.loader.Material;
|
|
import com.mykaruga.models.wavefront.loader.RenderModel;
|
|
import com.mykaruga.models.wavefront.loader.Vertex;
|
|
import com.mykaruga.models.wavefront.parser.LineParser;
|
|
|
|
|
|
|
|
public class KdParser extends LineParser {
|
|
|
|
Vertex kd = null;
|
|
|
|
@Override
|
|
public void incoporateResults(RenderModel wavefrontObject) {
|
|
Material currentMaterial = wavefrontObject.getCurrentMaterial();
|
|
currentMaterial.setKa(kd);
|
|
|
|
}
|
|
|
|
@Override
|
|
public void parse() {
|
|
kd = new Vertex();
|
|
|
|
try {
|
|
kd.setX(Float.parseFloat(words[1]));
|
|
kd.setY(Float.parseFloat(words[2]));
|
|
kd.setZ(Float.parseFloat(words[3]));
|
|
} catch (Exception e) {
|
|
throw new RuntimeException("VertexParser Error");
|
|
}
|
|
}
|
|
|
|
}
|
|
|