/* */ package com.sun.j3d.loaders.lw3d;
/* */
/* */ import com.sun.j3d.loaders.ParsingErrorException;
/* */ import java.io.IOException;
/* */ import java.io.StreamTokenizer;
/* */ import javax.media.j3d.BoundingSphere;
/* */ import javax.media.j3d.Fog;
/* */ import javax.media.j3d.LinearFog;
/* */ import javax.vecmath.Color3f;
/* */ import javax.vecmath.Point3d;
/* */
/* */ class LwsFog extends TextfileParser
/* */ {
/* */ float minDist;
/* */ float maxDist;
/* */ float minAmount;
/* */ float maxAmount;
/* */ int backdropFog;
/* */ Color3f color;
/* */ int type;
/* 62 */ Fog fogObject = null;
/* */
/* */ LwsFog(StreamTokenizer st, int debugVals)
/* */ throws ParsingErrorException
/* */ {
/* 68 */ this.debugPrinter.setValidOutput(debugVals);
/* 69 */ debugOutput(1, "LwsFog()");
/* 70 */ this.color = new Color3f(0.0F, 0.0F, 0.0F);
/* */
/* 72 */ while (!isCurrentToken(st, "DitherIntensity")) {
/* 73 */ debugOutputLn(8, "currentToken = " + st.sval);
/* */
/* 75 */ if (isCurrentToken(st, "FogMinDist")) {
/* 76 */ this.minDist = ((float)getNumber(st));
/* */ }
/* 78 */ else if (isCurrentToken(st, "FogMaxDist")) {
/* 79 */ this.maxDist = ((float)getNumber(st));
/* */ }
/* 81 */ else if (isCurrentToken(st, "FogMinAmount")) {
/* 82 */ this.minAmount = ((float)getNumber(st));
/* */ }
/* 84 */ else if (isCurrentToken(st, "FogMaxAmount")) {
/* 85 */ this.maxAmount = ((float)getNumber(st));
/* */ }
/* 87 */ else if (isCurrentToken(st, "BackdropFog")) {
/* 88 */ this.backdropFog = ((int)getNumber(st));
/* */ }
/* 90 */ else if (isCurrentToken(st, "FogColor")) {
/* 91 */ this.color.x = ((float)getNumber(st) / 255.0F);
/* 92 */ this.color.y = ((float)getNumber(st) / 255.0F);
/* 93 */ this.color.z = ((float)getNumber(st) / 255.0F);
/* */ }
/* */ try {
/* 96 */ st.nextToken();
/* */ }
/* */ catch (IOException e) {
/* 99 */ throw new ParsingErrorException(e.getMessage());
/* */ }
/* */ }
/* 102 */ st.pushBack();
/* */ }
/* */
/* */ void createJava3dObject()
/* */ {
/* 117 */ this.fogObject = new LinearFog(this.color, this.minDist, this.maxDist);
/* 118 */ debugOutputLn(2, "just set linearFog with color, minDist, maxDist = " + this.color + ", " + this.minDist + ", " + this.maxDist);
/* */
/* 123 */ BoundingSphere bounds = new BoundingSphere(new Point3d(0.0D, 0.0D, 0.0D), 100000.0D);
/* 124 */ this.fogObject.setInfluencingBounds(bounds);
/* */ }
/* */
/* */ Fog getObjectNode()
/* */ {
/* 129 */ return this.fogObject;
/* */ }
/* */
/* */ void printVals()
/* */ {
/* 134 */ debugOutputLn(2, " FOG vals: ");
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\j3dutils.jar
* Qualified Name: com.sun.j3d.loaders.lw3d.LwsFog
* JD-Core Version: 0.6.2
*/