Package org.sunflow
Interface SunflowAPIInterface
- All Known Implementing Classes:
RealtimeBenchmark,SunflowAPI
public interface SunflowAPIInterface
This interface represents the entry point for rendering scenes using Sunflow.
Classes which implement this interface are able to receive input from any of
the Sunflow parsers.
-
Method Summary
Modifier and TypeMethodDescriptionvoidDefines a camera with a given name.voidcurrentFrame(int currentFrame) Set the value of the current frame.voidDefines a geometry with a given name.booleanParse the specified filename.voidInstance the specified geometry into the scene.voidDefines a light source with a given name.voidDefines a modifier with a given name.voidDefines an option object to hold the current parameters.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a color parameter in the given colorspace using the specified name and value.voidDeclare a parameter with the specified name.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a parameter with the specified name and value.voidDeclare a plugin of the specified type with the given name from a java code string.voidRemove the specified render object.voidRender using the specified options and the specified display.voidreset()Reset the state of the API completely.voidsearchpath(String type, String path) Add the specified path to the list of directories which are searched automatically to resolve scene filenames or textures.voidDefines a shader with a given name.
-
Method Details
-
reset
void reset()Reset the state of the API completely. The object table is cleared, and all search paths are set back to their default values. -
plugin
Declare a plugin of the specified type with the given name from a java code string. The code will be compiled with Janino and registered as a new plugin type upon success.- Parameters:
type-name-code-
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a color parameter in the given colorspace using the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namecolorspace- color space ornullto assume internal color spacedata- floating point color data
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name and value. This parameter will be added to the currently active parameter list.- Parameters:
name- parameter namevalue- parameter value
-
parameter
Declare a parameter with the specified name. The type may be one of the follow: "float", "point", "vector", "texcoord", "matrix". The interpolation determines how the parameter is to be interpreted over surface (seeParameterList.InterpolationType). The data is specified in a flattened float array.- Parameters:
name- parameter nametype- parameter data typeinterpolation- parameter interpolation modedata- raw floating point data
-
remove
Remove the specified render object. Note that this may cause the removal of other objects which depended on it.- Parameters:
name- name of the object to remove
-
searchpath
Add the specified path to the list of directories which are searched automatically to resolve scene filenames or textures. Currently the supported searchpath types are: "include" and "texture". All other types will be ignored.- Parameters:
path-
-
shader
Defines a shader with a given name. If the shader type name is leftnull, the shader with the given name will be updated (if it exists).- Parameters:
name- a unique name given to the shadershaderType- a shader plugin type
-
modifier
Defines a modifier with a given name. If the modifier type name is leftnull, the modifier with the given name will be updated (if it exists).- Parameters:
name- a unique name given to the modifiermodifierType- a modifier plugin type name
-
geometry
Defines a geometry with a given name. The geometry is built from the specified type. Note that geometries may be created fromTesselatableobjects orPrimitiveListobjects. This means that two seperate plugin lists will be searched for the geometry type.Tesselatableobjects are search first. If the type name is leftnull, the geometry with the given name will be updated (if it exists).- Parameters:
name- a unique name given to the geometrytypeName- a tesselatable or primitive plugin type name
-
instance
Instance the specified geometry into the scene. If geoname isnull, the specified instance object will be updated (if it exists). In order to change the instancing relationship of an existing instance, you should use the "geometry" string attribute.- Parameters:
name- instance namegeoname- name of the geometry to instance
-
light
Defines a light source with a given name. If the light type name is leftnull, the light source with the given name will be updated (if it exists).- Parameters:
name- a unique name given to the light sourcelightType- a light source plugin type name
-
camera
Defines a camera with a given name. The camera is built from the specified camera lens type plugin. If the lens type name is leftnull, the camera with the given name will be updated (if it exists). It is not currently possible to change the lens of a camera after it has been created.- Parameters:
name- camera namelensType- a camera lens plugin type name
-
options
Defines an option object to hold the current parameters. If the object already exists, the values will simply override previous ones.- Parameters:
name-
-
render
Render using the specified options and the specified display. If the specified options do not exist - defaults will be used.- Parameters:
optionsName- name of theRenderObjectwhich contains the optionsdisplay- display object
-
include
Parse the specified filename. The include paths are searched first. The contents of the file are simply added to the active scene. This allows to break up a scene into parts, even across file formats. The appropriate parser is chosen based on file extension.- Parameters:
filename- filename to load- Returns:
trueupon sucess,falseif an error occured.
-
currentFrame
void currentFrame(int currentFrame) Set the value of the current frame. This value is intended only for procedural animation creation. It is not used by the Sunflow core in anyway. The default value is 1.- Parameters:
currentFrame- current frame number
-