Class ColladaImporter

java.lang.Object
com.ardor3d.extension.model.collada.jdom.ColladaImporter

public class ColladaImporter extends Object
Main class for importing Collada files.

Example usages: new ColladaImporter().load(resource); new ColladaImporter().loadTextures(false).modelLocator(locator).load(resource);

  • Constructor Details

    • ColladaImporter

      public ColladaImporter()
  • Method Details

    • isLoadTextures

      public boolean isLoadTextures()
    • setLoadTextures

      public ColladaImporter setLoadTextures(boolean loadTextures)
    • isCompressTextures

      public boolean isCompressTextures()
    • setCompressTextures

      public ColladaImporter setCompressTextures(boolean compressTextures)
    • isLoadAnimations

      public boolean isLoadAnimations()
    • setLoadAnimations

      public ColladaImporter setLoadAnimations(boolean loadAnimations)
    • isFlipTransparency

      public boolean isFlipTransparency()
    • addExtraPlugin

      public void addExtraPlugin(ColladaExtraPlugin plugin)
    • clearExtraPlugins

      public void clearExtraPlugins()
    • setFlipTransparency

      public ColladaImporter setFlipTransparency(boolean flipTransparency)
      Parameters:
      flipTransparency - if true, invert the value of any "transparency" entries found - required for some exporters.
      Returns:
      this importer, for chaining
    • getTextureLocator

      public ResourceLocator getTextureLocator()
    • setTextureLocator

      public ColladaImporter setTextureLocator(ResourceLocator textureLocator)
    • setExternalJoints

      public ColladaImporter setExternalJoints(Map<String,Joint> map)
    • getExternalJoints

      public Map<String,Joint> getExternalJoints()
    • getModelLocator

      public ResourceLocator getModelLocator()
    • setModelLocator

      public ColladaImporter setModelLocator(ResourceLocator modelLocator)
    • isOptimizeMeshes

      public boolean isOptimizeMeshes()
    • setOptimizeMeshes

      public void setOptimizeMeshes(boolean optimizeMeshes)
    • getOptimizeSettings

      public Set<GeometryTool.MatchCondition> getOptimizeSettings()
    • setOptimizeSettings

      public void setOptimizeSettings(GeometryTool.MatchCondition... optimizeSettings)
    • load

      public ColladaStorage load(String resource) throws IOException
      Reads a Collada file from the given resource and returns it as a ColladaStorage object.
      Parameters:
      resource - the name of the resource to find. ResourceLocatorTool will be used with TYPE_MODEL to find the resource.
      Returns:
      a ColladaStorage data object containing the Collada scene and other useful elements.
      Throws:
      IOException - if the resource can not be located or loaded for some reason.
    • load

      public ColladaStorage load(String resource, GeometryTool geometryTool) throws IOException
      Reads a Collada file from the given resource and returns it as a ColladaStorage object.
      Parameters:
      resource - the name of the resource to find. ResourceLocatorTool will be used with TYPE_MODEL to find the resource.
      geometryTool - the geometry tool used to minimize the vertex count.
      Returns:
      a ColladaStorage data object containing the Collada scene and other useful elements.
      Throws:
      IOException - if the resource can not be located or loaded for some reason.
    • load

      public ColladaStorage load(ResourceSource resource) throws IOException
      Reads a Collada file from the given resource and returns it as a ColladaStorage object.
      Parameters:
      resource - the name of the resource to find.
      Returns:
      a ColladaStorage data object containing the Collada scene and other useful elements.
      Throws:
      IOException - if the resource can not be loaded for some reason.
    • load

      public ColladaStorage load(ResourceSource resource, GeometryTool geometryTool) throws IOException
      Reads a Collada file from the given resource and returns it as a ColladaStorage object.
      Parameters:
      resource - the name of the resource to find.
      geometryTool - the geometry tool used to minimize the vertex count.
      Returns:
      a ColladaStorage data object containing the Collada scene and other useful elements.
      Throws:
      IOException - if the resource can not be loaded for some reason.
    • parseFloat

      public static float parseFloat(String candidate)
      Parse a numeric value. Commas are replaced by dot automatically. Also handle special values : INF, -INF, NaN
      Parameters:
      candidate - the string to parse
      Returns:
      float the float representing the numeric value
    • readExtra

      public boolean readExtra(org.jdom2.Element extra, Object... params)