diff options
author | neothemachine <[email protected]> | 2013-02-21 16:40:08 +0100 |
---|---|---|
committer | neothemachine <[email protected]> | 2013-02-21 16:40:08 +0100 |
commit | f774bd917e9dfd8cf46e5ed66d41aad64477a238 (patch) | |
tree | 8d33aa0cf24165710d420c677f3336641223cff8 /ardor3d-collada/src/main | |
parent | edbc5c757c66d56eb2cffffa4076f0f2bfd6e748 (diff) |
normalized line endings
see
http://www.hanselman.com/blog/YoureJustAnotherCarriageReturnLineFeedInTheWall.aspx
and https://help.github.com/articles/dealing-with-line-endings
Diffstat (limited to 'ardor3d-collada/src/main')
5 files changed, 417 insertions, 417 deletions
diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaException.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaException.java index b4d4927..edadb0b 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaException.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaException.java @@ -1,31 +1,31 @@ -/**
- * Copyright (c) 2008-2012 Ardor Labs, Inc.
- *
- * This file is part of Ardor3D.
- *
- * Ardor3D is free software: you can redistribute it and/or modify it
- * under the terms of its license which may be found in the accompanying
- * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
- */
-
-package com.ardor3d.extension.model.collada.jdom;
-
-/**
- * Customer exception thrown when something unexpected is encountered in a Collada file.
- */
-public class ColladaException extends RuntimeException {
-
- private static final long serialVersionUID = 1L;
-
- public ColladaException(final String message, final Object source) {
- super(ColladaException.createMessage(message, source));
- }
-
- public ColladaException(final String msg, final Object source, final Throwable cause) {
- super(ColladaException.createMessage(msg, source), cause);
- }
-
- private static String createMessage(final String message, final Object source) {
- return "Collada problem for source: " + (source != null ? source.toString() : "null") + ": " + message;
- }
-}
+/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.extension.model.collada.jdom; + +/** + * Customer exception thrown when something unexpected is encountered in a Collada file. + */ +public class ColladaException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public ColladaException(final String message, final Object source) { + super(ColladaException.createMessage(message, source)); + } + + public ColladaException(final String msg, final Object source, final Throwable cause) { + super(ColladaException.createMessage(msg, source), cause); + } + + private static String createMessage(final String message, final Object source) { + return "Collada problem for source: " + (source != null ? source.toString() : "null") + ": " + message; + } +} diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/AnimationItem.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/AnimationItem.java index 43c732b..400384c 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/AnimationItem.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/AnimationItem.java @@ -1,94 +1,94 @@ -/**
- * Copyright (c) 2008-2012 Ardor Labs, Inc.
- *
- * This file is part of Ardor3D.
- *
- * Ardor3D is free software: you can redistribute it and/or modify it
- * under the terms of its license which may be found in the accompanying
- * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
- */
-
-package com.ardor3d.extension.model.collada.jdom.data;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.ardor3d.annotation.SavableFactory;
-import com.ardor3d.extension.animation.skeletal.clip.AnimationClip;
-import com.ardor3d.util.export.InputCapsule;
-import com.ardor3d.util.export.OutputCapsule;
-import com.ardor3d.util.export.Savable;
-import com.google.common.collect.Lists;
-
-@SavableFactory(factoryMethod = "initSavable")
-public class AnimationItem implements Savable {
- private final String _name;
- private final List<AnimationItem> _children = Lists.newArrayList();
- private AnimationClip _animationClip;
-
- public AnimationItem(final String name) {
- _name = name;
- }
-
- public AnimationClip getAnimationClip() {
- return _animationClip;
- }
-
- public void setAnimationClip(final AnimationClip animationClip) {
- _animationClip = animationClip;
- }
-
- public String getName() {
- return _name;
- }
-
- public List<AnimationItem> getChildren() {
- return _children;
- }
-
- @Override
- public String toString() {
- return "AnimationItem [name=" + _name + (_animationClip != null ? ", " + _animationClip.toString() : "") + "]";
- }
-
- // /////////////////
- // Methods for Savable
- // /////////////////
-
- @Override
- public Class<? extends AnimationItem> getClassTag() {
- return this.getClass();
- }
-
- @Override
- public void read(final InputCapsule capsule) throws IOException {
- final String name = capsule.readString("name", "");
- try {
- final Field field1 = AnimationClip.class.getDeclaredField("_name");
- field1.setAccessible(true);
- field1.set(this, name);
- } catch (final Exception e) {
- e.printStackTrace();
- }
- _children.clear();
- _children.addAll(capsule.readSavableList("children", new ArrayList<AnimationItem>()));
- _animationClip = (AnimationClip) capsule.readSavable("animationClip", null);
- }
-
- @Override
- public void write(final OutputCapsule capsule) throws IOException {
- capsule.write(_name, "name", null);
- capsule.writeSavableList(_children, "children", null);
- capsule.write(_animationClip, "animationClip", null);
- }
-
- public static AnimationItem initSavable() {
- return new AnimationItem();
- }
-
- private AnimationItem() {
- this(null);
- }
-}
+/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.extension.model.collada.jdom.data; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +import com.ardor3d.annotation.SavableFactory; +import com.ardor3d.extension.animation.skeletal.clip.AnimationClip; +import com.ardor3d.util.export.InputCapsule; +import com.ardor3d.util.export.OutputCapsule; +import com.ardor3d.util.export.Savable; +import com.google.common.collect.Lists; + +@SavableFactory(factoryMethod = "initSavable") +public class AnimationItem implements Savable { + private final String _name; + private final List<AnimationItem> _children = Lists.newArrayList(); + private AnimationClip _animationClip; + + public AnimationItem(final String name) { + _name = name; + } + + public AnimationClip getAnimationClip() { + return _animationClip; + } + + public void setAnimationClip(final AnimationClip animationClip) { + _animationClip = animationClip; + } + + public String getName() { + return _name; + } + + public List<AnimationItem> getChildren() { + return _children; + } + + @Override + public String toString() { + return "AnimationItem [name=" + _name + (_animationClip != null ? ", " + _animationClip.toString() : "") + "]"; + } + + // ///////////////// + // Methods for Savable + // ///////////////// + + @Override + public Class<? extends AnimationItem> getClassTag() { + return this.getClass(); + } + + @Override + public void read(final InputCapsule capsule) throws IOException { + final String name = capsule.readString("name", ""); + try { + final Field field1 = AnimationClip.class.getDeclaredField("_name"); + field1.setAccessible(true); + field1.set(this, name); + } catch (final Exception e) { + e.printStackTrace(); + } + _children.clear(); + _children.addAll(capsule.readSavableList("children", new ArrayList<AnimationItem>())); + _animationClip = (AnimationClip) capsule.readSavable("animationClip", null); + } + + @Override + public void write(final OutputCapsule capsule) throws IOException { + capsule.write(_name, "name", null); + capsule.writeSavableList(_children, "children", null); + capsule.write(_animationClip, "animationClip", null); + } + + public static AnimationItem initSavable() { + return new AnimationItem(); + } + + private AnimationItem() { + this(null); + } +} diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/DataCache.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/DataCache.java index 2ae984f..0017ebc 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/DataCache.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/data/DataCache.java @@ -1,229 +1,229 @@ -/**
- * Copyright (c) 2008-2012 Ardor Labs, Inc.
- *
- * This file is part of Ardor3D.
- *
- * Ardor3D is free software: you can redistribute it and/or modify it
- * under the terms of its license which may be found in the accompanying
- * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
- */
-
-package com.ardor3d.extension.model.collada.jdom.data;
-
-import java.nio.FloatBuffer;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-import org.jdom2.Element;
-import org.jdom2.xpath.XPath;
-
-import com.ardor3d.extension.animation.skeletal.Joint;
-import com.ardor3d.extension.animation.skeletal.Skeleton;
-import com.ardor3d.extension.animation.skeletal.SkeletonPose;
-import com.ardor3d.image.Texture;
-import com.ardor3d.scenegraph.Mesh;
-import com.ardor3d.scenegraph.MeshData;
-import com.ardor3d.scenegraph.Spatial;
-import com.ardor3d.util.geom.VertMap;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Multimap;
-
-/**
- * Performance cache and temp storage during parsing.
- */
-public class DataCache {
- private final Map<String, Element> _boundMaterials;
- private final Map<String, Texture> _textures;
- private final Map<String, Element> _idCache;
- private final Map<String, Element> _sidCache;
- private final Map<String, XPath> _xPathExpressions;
- private final Pattern _pattern;
- private final List<String> _transformTypes;
-
- private final Map<Element, float[]> _floatArrays;
- private final Map<Element, double[]> _doubleArrays;
- private final Map<Element, boolean[]> _booleanArrays;
- private final Map<Element, int[]> _intArrays;
- private final Map<Element, String[]> _stringArrays;
-
- private final Multimap<Element, MeshVertPairs> _vertMappings;
- private final Map<Mesh, VertMap> _meshVertMap;
- private final Multimap<MeshData, FloatBuffer> _parsedVertexColors;
- private final Map<String, MaterialInfo> _materialInfoMap;
- private final Map<Mesh, String> _meshMaterialMap;
- private final Map<Element, Spatial> _elementSpatialMapping;
-
- private final Map<Element, Joint> _elementJointMapping;
- private final Map<String, Joint> _externalJointMapping;
- private JointNode _rootJointNode;
- private final Map<Joint, Skeleton> _jointSkeletonMapping;
- private final Map<Skeleton, SkeletonPose> _skeletonPoseMapping;
- private final List<Skeleton> _skeletons;
- private final List<ControllerStore> _controllers;
-
- public DataCache() {
- _boundMaterials = Maps.newHashMap();
- _textures = Maps.newHashMap();
- _idCache = Maps.newHashMap();
- _sidCache = Maps.newHashMap();
- _xPathExpressions = Maps.newHashMap();
- _pattern = Pattern.compile("\\s");
-
- _transformTypes = Collections.unmodifiableList(Lists.newArrayList("lookat", "matrix", "rotate", "scale",
- "scew", "translate"));
-
- _floatArrays = Maps.newHashMap();
- _doubleArrays = Maps.newHashMap();
- _booleanArrays = Maps.newHashMap();
- _intArrays = Maps.newHashMap();
- _stringArrays = Maps.newHashMap();
- _vertMappings = ArrayListMultimap.create();
- _meshVertMap = Maps.newIdentityHashMap();
- _parsedVertexColors = ArrayListMultimap.create();
- _materialInfoMap = Maps.newHashMap();
- _meshMaterialMap = Maps.newIdentityHashMap();
-
- _elementSpatialMapping = Maps.newHashMap();
-
- _elementJointMapping = Maps.newHashMap();
- _externalJointMapping = Maps.newHashMap();
- _skeletons = Lists.newArrayList();
- _jointSkeletonMapping = Maps.newHashMap();
- _skeletonPoseMapping = Maps.newHashMap();
- _controllers = Lists.newArrayList();
- }
-
- public void bindMaterial(final String ref, final Element material) {
- if (!_boundMaterials.containsKey(ref)) {
- _boundMaterials.put(ref, material);
- }
- }
-
- public void unbindMaterial(final String ref) {
- _boundMaterials.remove(ref);
- }
-
- public Element getBoundMaterial(final String ref) {
- return _boundMaterials.get(ref);
- }
-
- public boolean containsTexture(final String path) {
- return _textures.containsKey(path);
- }
-
- public void addTexture(final String path, final Texture texture) {
- _textures.put(path, texture);
- }
-
- public Texture getTexture(final String path) {
- return _textures.get(path);
- }
-
- public Map<String, Element> getIdCache() {
- return _idCache;
- }
-
- public Map<String, Element> getSidCache() {
- return _sidCache;
- }
-
- public Map<String, XPath> getxPathExpressions() {
- return _xPathExpressions;
- }
-
- public Pattern getPattern() {
- return _pattern;
- }
-
- public List<String> getTransformTypes() {
- return _transformTypes;
- }
-
- public Map<Element, float[]> getFloatArrays() {
- return _floatArrays;
- }
-
- public Map<Element, double[]> getDoubleArrays() {
- return _doubleArrays;
- }
-
- public Map<Element, boolean[]> getBooleanArrays() {
- return _booleanArrays;
- }
-
- public Map<Element, int[]> getIntArrays() {
- return _intArrays;
- }
-
- public Map<Element, String[]> getStringArrays() {
- return _stringArrays;
- }
-
- public Multimap<Element, MeshVertPairs> getVertMappings() {
- return _vertMappings;
- }
-
- public Map<Mesh, VertMap> getMeshVertMap() {
- return _meshVertMap;
- }
-
- public Multimap<MeshData, FloatBuffer> getParsedVertexColors() {
- return _parsedVertexColors;
- }
-
- public Map<String, MaterialInfo> getMaterialInfoMap() {
- return _materialInfoMap;
- }
-
- public Map<Mesh, String> getMeshMaterialMap() {
- return _meshMaterialMap;
- }
-
- public Map<Element, Spatial> getElementSpatialMapping() {
- return _elementSpatialMapping;
- }
-
- public Map<Element, Joint> getElementJointMapping() {
- return _elementJointMapping;
- }
-
- public Map<String, Joint> getExternalJointMapping() {
- return _externalJointMapping;
- }
-
- public JointNode getRootJointNode() {
- return _rootJointNode;
- }
-
- public void setRootJointNode(final JointNode rootJointNode) {
- _rootJointNode = rootJointNode;
- }
-
- public Map<Joint, Skeleton> getJointSkeletonMapping() {
- return _jointSkeletonMapping;
- }
-
- public Map<Skeleton, SkeletonPose> getSkeletonPoseMapping() {
- return _skeletonPoseMapping;
- }
-
- public List<ControllerStore> getControllers() {
- return _controllers;
- }
-
- public List<Skeleton> getSkeletons() {
- return _skeletons;
- }
-
- public void addSkeleton(final Skeleton skeleton) {
- _skeletons.add(skeleton);
- }
-
- public void setMeshVertMap(final Mesh geometry, final VertMap map) {
- _meshVertMap.put(geometry, map);
- }
-}
+/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.extension.model.collada.jdom.data; + +import java.nio.FloatBuffer; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +import org.jdom2.Element; +import org.jdom2.xpath.XPath; + +import com.ardor3d.extension.animation.skeletal.Joint; +import com.ardor3d.extension.animation.skeletal.Skeleton; +import com.ardor3d.extension.animation.skeletal.SkeletonPose; +import com.ardor3d.image.Texture; +import com.ardor3d.scenegraph.Mesh; +import com.ardor3d.scenegraph.MeshData; +import com.ardor3d.scenegraph.Spatial; +import com.ardor3d.util.geom.VertMap; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; + +/** + * Performance cache and temp storage during parsing. + */ +public class DataCache { + private final Map<String, Element> _boundMaterials; + private final Map<String, Texture> _textures; + private final Map<String, Element> _idCache; + private final Map<String, Element> _sidCache; + private final Map<String, XPath> _xPathExpressions; + private final Pattern _pattern; + private final List<String> _transformTypes; + + private final Map<Element, float[]> _floatArrays; + private final Map<Element, double[]> _doubleArrays; + private final Map<Element, boolean[]> _booleanArrays; + private final Map<Element, int[]> _intArrays; + private final Map<Element, String[]> _stringArrays; + + private final Multimap<Element, MeshVertPairs> _vertMappings; + private final Map<Mesh, VertMap> _meshVertMap; + private final Multimap<MeshData, FloatBuffer> _parsedVertexColors; + private final Map<String, MaterialInfo> _materialInfoMap; + private final Map<Mesh, String> _meshMaterialMap; + private final Map<Element, Spatial> _elementSpatialMapping; + + private final Map<Element, Joint> _elementJointMapping; + private final Map<String, Joint> _externalJointMapping; + private JointNode _rootJointNode; + private final Map<Joint, Skeleton> _jointSkeletonMapping; + private final Map<Skeleton, SkeletonPose> _skeletonPoseMapping; + private final List<Skeleton> _skeletons; + private final List<ControllerStore> _controllers; + + public DataCache() { + _boundMaterials = Maps.newHashMap(); + _textures = Maps.newHashMap(); + _idCache = Maps.newHashMap(); + _sidCache = Maps.newHashMap(); + _xPathExpressions = Maps.newHashMap(); + _pattern = Pattern.compile("\\s"); + + _transformTypes = Collections.unmodifiableList(Lists.newArrayList("lookat", "matrix", "rotate", "scale", + "scew", "translate")); + + _floatArrays = Maps.newHashMap(); + _doubleArrays = Maps.newHashMap(); + _booleanArrays = Maps.newHashMap(); + _intArrays = Maps.newHashMap(); + _stringArrays = Maps.newHashMap(); + _vertMappings = ArrayListMultimap.create(); + _meshVertMap = Maps.newIdentityHashMap(); + _parsedVertexColors = ArrayListMultimap.create(); + _materialInfoMap = Maps.newHashMap(); + _meshMaterialMap = Maps.newIdentityHashMap(); + + _elementSpatialMapping = Maps.newHashMap(); + + _elementJointMapping = Maps.newHashMap(); + _externalJointMapping = Maps.newHashMap(); + _skeletons = Lists.newArrayList(); + _jointSkeletonMapping = Maps.newHashMap(); + _skeletonPoseMapping = Maps.newHashMap(); + _controllers = Lists.newArrayList(); + } + + public void bindMaterial(final String ref, final Element material) { + if (!_boundMaterials.containsKey(ref)) { + _boundMaterials.put(ref, material); + } + } + + public void unbindMaterial(final String ref) { + _boundMaterials.remove(ref); + } + + public Element getBoundMaterial(final String ref) { + return _boundMaterials.get(ref); + } + + public boolean containsTexture(final String path) { + return _textures.containsKey(path); + } + + public void addTexture(final String path, final Texture texture) { + _textures.put(path, texture); + } + + public Texture getTexture(final String path) { + return _textures.get(path); + } + + public Map<String, Element> getIdCache() { + return _idCache; + } + + public Map<String, Element> getSidCache() { + return _sidCache; + } + + public Map<String, XPath> getxPathExpressions() { + return _xPathExpressions; + } + + public Pattern getPattern() { + return _pattern; + } + + public List<String> getTransformTypes() { + return _transformTypes; + } + + public Map<Element, float[]> getFloatArrays() { + return _floatArrays; + } + + public Map<Element, double[]> getDoubleArrays() { + return _doubleArrays; + } + + public Map<Element, boolean[]> getBooleanArrays() { + return _booleanArrays; + } + + public Map<Element, int[]> getIntArrays() { + return _intArrays; + } + + public Map<Element, String[]> getStringArrays() { + return _stringArrays; + } + + public Multimap<Element, MeshVertPairs> getVertMappings() { + return _vertMappings; + } + + public Map<Mesh, VertMap> getMeshVertMap() { + return _meshVertMap; + } + + public Multimap<MeshData, FloatBuffer> getParsedVertexColors() { + return _parsedVertexColors; + } + + public Map<String, MaterialInfo> getMaterialInfoMap() { + return _materialInfoMap; + } + + public Map<Mesh, String> getMeshMaterialMap() { + return _meshMaterialMap; + } + + public Map<Element, Spatial> getElementSpatialMapping() { + return _elementSpatialMapping; + } + + public Map<Element, Joint> getElementJointMapping() { + return _elementJointMapping; + } + + public Map<String, Joint> getExternalJointMapping() { + return _externalJointMapping; + } + + public JointNode getRootJointNode() { + return _rootJointNode; + } + + public void setRootJointNode(final JointNode rootJointNode) { + _rootJointNode = rootJointNode; + } + + public Map<Joint, Skeleton> getJointSkeletonMapping() { + return _jointSkeletonMapping; + } + + public Map<Skeleton, SkeletonPose> getSkeletonPoseMapping() { + return _skeletonPoseMapping; + } + + public List<ControllerStore> getControllers() { + return _controllers; + } + + public List<Skeleton> getSkeletons() { + return _skeletons; + } + + public void addSkeleton(final Skeleton skeleton) { + _skeletons.add(skeleton); + } + + public void setMeshVertMap(final Mesh geometry, final VertMap map) { + _meshVertMap.put(geometry, map); + } +} diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/ColladaExtraPlugin.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/ColladaExtraPlugin.java index 49ce7bc..d766f38 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/ColladaExtraPlugin.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/ColladaExtraPlugin.java @@ -1,19 +1,19 @@ -/**
- * Copyright (c) 2008-2012 Ardor Labs, Inc.
- *
- * This file is part of Ardor3D.
- *
- * Ardor3D is free software: you can redistribute it and/or modify it
- * under the terms of its license which may be found in the accompanying
- * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
- */
-
-package com.ardor3d.extension.model.collada.jdom.plugin;
-
-import org.jdom2.Element;
-
-public interface ColladaExtraPlugin {
-
- boolean processExtra(Element extra, Object[] params);
-
-}
+/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.extension.model.collada.jdom.plugin; + +import org.jdom2.Element; + +public interface ColladaExtraPlugin { + + boolean processExtra(Element extra, Object[] params); + +} diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/GoogleEarthPlugin.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/GoogleEarthPlugin.java index 91ec7a8..73621ff 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/GoogleEarthPlugin.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/plugin/GoogleEarthPlugin.java @@ -1,44 +1,44 @@ -/**
- * Copyright (c) 2008-2012 Ardor Labs, Inc.
- *
- * This file is part of Ardor3D.
- *
- * Ardor3D is free software: you can redistribute it and/or modify it
- * under the terms of its license which may be found in the accompanying
- * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
- */
-
-package com.ardor3d.extension.model.collada.jdom.plugin;
-
-import org.jdom2.Attribute;
-import org.jdom2.Element;
-
-import com.ardor3d.renderer.state.CullState;
-import com.ardor3d.scenegraph.Mesh;
-
-public class GoogleEarthPlugin implements ColladaExtraPlugin {
-
- @Override
- public boolean processExtra(final Element extra, final Object[] params) {
- if (params.length > 0 && params[0] instanceof Mesh) {
- final Mesh mesh = (Mesh) params[0];
- // should have a child: <technique profile="GOOGLEEARTH">
- final Element technique = extra.getChild("technique");
- if (technique != null) {
- final Attribute profile = technique.getAttribute("profile");
- if (profile != null && "GOOGLEEARTH".equalsIgnoreCase(profile.getValue())) {
- for (final Element child : technique.getChildren()) {
- // disable back face culling if it's been enabled.
- if ("double_sided".equalsIgnoreCase(child.getName()) && "1".equals(child.getTextTrim())) {
- final CullState cs = new CullState();
- cs.setEnabled(false);
- mesh.setRenderState(cs);
- }
- }
- return true;
- }
- }
- }
- return false;
- }
-}
+/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.extension.model.collada.jdom.plugin; + +import org.jdom2.Attribute; +import org.jdom2.Element; + +import com.ardor3d.renderer.state.CullState; +import com.ardor3d.scenegraph.Mesh; + +public class GoogleEarthPlugin implements ColladaExtraPlugin { + + @Override + public boolean processExtra(final Element extra, final Object[] params) { + if (params.length > 0 && params[0] instanceof Mesh) { + final Mesh mesh = (Mesh) params[0]; + // should have a child: <technique profile="GOOGLEEARTH"> + final Element technique = extra.getChild("technique"); + if (technique != null) { + final Attribute profile = technique.getAttribute("profile"); + if (profile != null && "GOOGLEEARTH".equalsIgnoreCase(profile.getValue())) { + for (final Element child : technique.getChildren()) { + // disable back face culling if it's been enabled. + if ("double_sided".equalsIgnoreCase(child.getName()) && "1".equals(child.getTextTrim())) { + final CullState cs = new CullState(); + cs.setEnabled(false); + mesh.setRenderState(cs); + } + } + return true; + } + } + } + return false; + } +} |