示例#1
0
 /**
  * Create a geometry from the specified primitive aggregate. The
  * acceleration structure for this object will be built on demand.
  *
  * @param primitives primitive list object
  */
 public Geometry(PrimitiveList primitives)
 {
     tesselatable    = null;
     this.primitives = primitives;
     accel           = null;
     builtAccel      = 0;
     builtTess       = 1; // already tesselated
 }
示例#2
0
 /**
  * Create a geometry from the specified primitive aggregate. The
  * acceleration structure for this object will be built on demand.
  *
  * @param primitives primitive list object
  */
 public Geometry(PrimitiveList primitives)
 {
     tesselatable = null;
     this.primitives = primitives;
     accel = null;
     builtAccel = 0;
     builtTess = 1; // already tesselated
 }
示例#3
0
 /**
  * Create a geometry from the specified tesselatable object. The actual
  * renderable primitives will be generated on demand.
  *
  * @param tesselatable tesselation object
  */
 public Geometry(ITesselatable tesselatable)
 {
     this.tesselatable = tesselatable;
     primitives        = null;
     accel             = null;
     builtAccel        = 0;
     builtTess         = 0;
     acceltype         = null;
 }
示例#4
0
 /**
  * Create a geometry from the specified tesselatable object. The actual
  * renderable primitives will be generated on demand.
  *
  * @param tesselatable tesselation object
  */
 public Geometry(ITesselatable tesselatable)
 {
     this.tesselatable = tesselatable;
     primitives = null;
     accel = null;
     builtAccel = 0;
     builtTess = 0;
     acceltype = null;
 }
示例#5
0
 /**
  * Defines a geometry with a given name. The geometry is built from the
  * specified type. Note that geometries may be created from
  * {@link Tesselatable} objects or {@link PrimitiveList} objects. This means
  * that two seperate plugin lists will be searched for the geometry type.
  * {@link Tesselatable} objects are search first. If the type name is left
  * <code>null</code>, the geometry with the given name will be updated
  * (if it exists).
  *
  * @param name a unique name given to the geometry
  * @param typeName a tesselatable or primitive plugin type name
  */
 public void geometry(string name, string typeName)
 {
     if (!isIncremental(typeName))
     {
         // we are declaring a geometry for the first time
         if (renderObjects.has(name))
         {
             UI.printError(UI.Module.API, "Unable to declare geometry \"{0}\", name is already in use", name);
             parameterList.clear(true);
             return;
         }
         // check tesselatable first
         if (PluginRegistry.tesselatablePlugins.hasType(typeName))
         {
             ITesselatable tesselatable = PluginRegistry.tesselatablePlugins.createObject(typeName);
             if (tesselatable == null)
             {
                 UI.printError(UI.Module.API, "Unable to create tesselatable object of type \"{0}\"", typeName);
                 return;
             }
             renderObjects.put(name, tesselatable);
         }
         else
         {
             PrimitiveList primitives = PluginRegistry.primitivePlugins.createObject(typeName);
             if (primitives == null)
             {
                 UI.printError(UI.Module.API, "Unable to create primitive of type \"{0}\"", typeName);
                 return;
             }
             renderObjects.put(name, primitives);
         }
     }
     if (lookupGeometry(name) != null)
     {
         update(name);
     }
     else
     {
         UI.printError(UI.Module.API, "Unable to update geometry \"{0}\" - geometry object was not found", name);
         parameterList.clear(true);
     }
 }
示例#6
0
 /**
  * Defines a geometry with a given name. The geometry is built from the
  * specified {@link Tesselatable}. If the object is <code>null</code>,
  * the geometry with the given name will be updated (if it exists).
  *
  * @param name a unique name given to the geometry
  * @param tesselatable the tesselatable object to create the geometry from
  */
 public void geometry(string name, ITesselatable tesselatable)
 {
     if (tesselatable != null)
     {
         // we are declaring a geometry for the first time
         if (renderObjects.has(name))
         {
             UI.printError(UI.Module.API, "Unable to declare geometry \"{0}\", name is already in use", name);
             parameterList.clear(true);
             return;
         }
         renderObjects.put(name, tesselatable);
     }
     if (lookupGeometry(name) != null)
     {
         update(name);
     }
     else
     {
         UI.printError(UI.Module.API, "Unable to update geometry \"{0}\" - geometry object was not found", name);
         parameterList.clear(true);
     }
 }
示例#7
0
 public RenderObjectHandle(ITesselatable tesselatable)
 {
     obj = new Geometry(tesselatable);
     type = RenderObjectType.GEOMETRY;
 }
示例#8
0
 public void put(string name, ITesselatable tesselatable)
 {
     renderObjects[name] = new RenderObjectHandle(tesselatable);
 }
示例#9
0
 public RenderObjectHandle(ITesselatable tesselatable)
 {
     obj  = new Geometry(tesselatable);
     type = RenderObjectType.GEOMETRY;
 }
示例#10
0
 public void put(string name, ITesselatable tesselatable)
 {
     renderObjects[name] = new RenderObjectHandle(tesselatable);
 }