|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.object.Object3D
artofillusion.object.ImplicitObject
artofillusion.object.ImplicitSphere
public class ImplicitSphere
This is a spherical implicit object (i.e. a metaball). It is characterized by two numbers: a radius, which is the radius of the sphere it creates in isolation, and an "influence radius", which is the distance it extends outward before the implicit function becomes zero. The influence radius must by larger than the radius, or the behavior becomes undefined. This class is generally not useful on its own, but collections of ImplicitSpheres are useful for many sorts of effects where balls should smoothly merge together when they come close.
Nested Class Summary | |
---|---|
static class |
ImplicitSphere.ImplicitSphereKeyframe
Inner class representing a pose for an ImplicitSphere. |
Field Summary |
---|
Fields inherited from class artofillusion.object.Object3D |
---|
APPROXIMATELY, CANT_CONVERT, EXACTLY |
Constructor Summary | |
---|---|
ImplicitSphere(java.io.DataInputStream in,
Scene theScene)
The following two methods are used for reading and writing files. |
|
ImplicitSphere(double radius,
double influenceRadius)
|
Method Summary | |
---|---|
void |
applyPoseKeyframe(Keyframe k)
Modify this object based on a pose keyframe. |
void |
configurePoseTrack(PoseTrack track)
This will be called whenever a new pose track is created for this object. |
void |
copyObject(Object3D obj)
Copy all the properties of another object, to make this one identical to it. |
Object3D |
duplicate()
Create a new object which is an exact duplicate of this one. |
void |
edit(EditingWindow parent,
ObjectInfo info,
java.lang.Runnable cb)
Display a window in which the user can edit this object. |
void |
editKeyframe(EditingWindow parent,
Keyframe k,
ObjectInfo info)
Allow the user to edit a keyframe returned by getPoseKeyframe(). |
BoundingBox |
getBounds()
Get a BoundingBox which just encloses the object. |
double |
getCutoff()
Get the cutoff value which defines the surface of the object. |
double[] |
getDefaultPoseValues()
Get the default list of graphable values for a keyframe returned by getPoseKeyframe(). |
void |
getFieldGradient(double x,
double y,
double z,
double size,
double time,
Vec3 grad)
Get the gradient of the field function at a point specified in object coordinates. |
double |
getFieldValue(double x,
double y,
double z,
double size,
double time)
Get the value of the field function at a point specified in object coordinates. |
double |
getInfluenceRadius()
|
Keyframe |
getPoseKeyframe()
Return a Keyframe which describes the current pose of this object. |
java.lang.String[] |
getPoseValueNames()
Return an array containing the names of the graphable values for the keyframes returned by getPoseKeyframe(). |
boolean |
getPreferDirectRendering()
Get the preferred rendering method to use when this object is rendered by a renderer that supports direct evaluation of the field. |
Property[] |
getProperties()
Get a list of editable properties defined by this object. |
java.lang.Object |
getPropertyValue(int index)
Get the value of one of this object's editable properties. |
double |
getRadius()
|
RenderingMesh |
getRenderingMesh(double tol,
boolean interactive,
ObjectInfo info)
Objects which can be rendered as part of a scene should override this method to return a RenderingMesh which describes the appearance of the object. |
WireframeMesh |
getWireframeMesh()
Every object should override this method to return a WireframeMesh. |
boolean |
isEditable()
If the object can be edited by the user, isEditable() should be overridden to return true. |
void |
setInfluenceRadius(double influenceRadius)
|
void |
setMaterial(Material mat,
MaterialMapping map)
Set the Material and MaterialMapping for this object. |
void |
setPropertyValue(int index,
java.lang.Object value)
Set the value of one of this object's editable properties. |
void |
setRadius(double radius)
|
void |
setSize(double xsize,
double ysize,
double zsize)
Resize the object. |
void |
setTexture(Texture tex,
TextureMapping mapping)
Set the Texture and TextureMapping for this object. |
void |
writeToFile(java.io.DataOutputStream out,
Scene theScene)
Subclasses should invoke this method in their own writeToFile() methods. |
Methods inherited from class artofillusion.object.ImplicitObject |
---|
canConvertToTriangleMesh, convertToTriangleMesh, generateMesh, getMaxGradient, sceneChanged |
Methods inherited from class artofillusion.object.Object3D |
---|
canConvertToActor, canSetMaterial, canSetTexture, copyTextureAndMaterial, editGesture, getAverageParameterValues, getMaterial, getMaterialMapping, getParameters, getParameterValue, getParameterValues, getPosableObject, getSkeleton, getTexture, getTextureMapping, isClosed, readParameterValue, renderObject, setParameters, setParameterValue, setParameterValues |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImplicitSphere(double radius, double influenceRadius)
public ImplicitSphere(java.io.DataInputStream in, Scene theScene) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
Method Detail |
---|
public double getRadius()
public void setRadius(double radius)
public double getInfluenceRadius()
public void setInfluenceRadius(double influenceRadius)
public double getCutoff()
ImplicitObject
The default implementation returns 1.0. It may be overridden to return a different value.
getCutoff
in class ImplicitObject
public boolean getPreferDirectRendering()
ImplicitObject
getPreferDirectRendering
in class ImplicitObject
public double getFieldValue(double x, double y, double z, double size, double time)
ImplicitObject
getFieldValue
in class ImplicitObject
x
- the x coordinate of the location at which to evaluate the functiony
- the y coordinate of the location at which to evaluate the functionz
- the z coordinate of the location at which to evaluate the functionsize
- the width of the region over which to average the function for antialiasingtime
- the time at which the function is being evaluated
public void getFieldGradient(double x, double y, double z, double size, double time, Vec3 grad)
ImplicitObject
The default implementation of this method estimates the gradient by evaluating the field function at several closely spaced points. In many cases, it is possible to calculate the gradient both more quickly and more accurately by analytical means. Whenever possible, this method should be overridden to calculate the gradient directly.
getFieldGradient
in class ImplicitObject
x
- the x coordinate of the location at which to evaluate the functiony
- the y coordinate of the location at which to evaluate the functionz
- the z coordinate of the location at which to evaluate the functionsize
- the width of the region over which to average the function for antialiasingtime
- the time at which the function is being evaluatedgrad
- on exit, this should be set equal to the gradient of the field function at
the specified locationpublic void applyPoseKeyframe(Keyframe k)
Object3D
applyPoseKeyframe
in class Object3D
public void configurePoseTrack(PoseTrack track)
configurePoseTrack
in class Object3D
public java.lang.String[] getPoseValueNames()
public double[] getDefaultPoseValues()
public Object3D duplicate()
Object3D
duplicate
in class Object3D
public void copyObject(Object3D obj)
Object3D
copyObject
in class Object3D
public BoundingBox getBounds()
Object3D
getBounds
in class Object3D
public void setSize(double xsize, double ysize, double zsize)
Object3D
setSize
in class Object3D
public WireframeMesh getWireframeMesh()
Object3D
getWireframeMesh
in class ImplicitObject
public RenderingMesh getRenderingMesh(double tol, boolean interactive, ObjectInfo info)
Object3D
The ObjectInfo contains additional information which may affect how the object is rendered, such as it location in the scene, texture parameters, etc.
Objects which cannot be rendered directly (lights, cameras, curves, etc.) do not need to override this method.
getRenderingMesh
in class ImplicitObject
public Keyframe getPoseKeyframe()
Object3D
getPoseKeyframe
in class Object3D
public Property[] getProperties()
Object3D
getProperties
in class Object3D
public java.lang.Object getPropertyValue(int index)
Object3D
getPropertyValue
in class Object3D
index
- the index of the property to getpublic void setPropertyValue(int index, java.lang.Object value)
Object3D
setPropertyValue
in class Object3D
index
- the index of the property to setvalue
- the value to set for the propertypublic void setTexture(Texture tex, TextureMapping mapping)
Object3D
setTexture
in class Object3D
public void setMaterial(Material mat, MaterialMapping map)
Object3D
setMaterial
in class Object3D
public boolean isEditable()
Object3D
isEditable
in class Object3D
public void edit(EditingWindow parent, ObjectInfo info, java.lang.Runnable cb)
Object3D
edit
in class Object3D
parent
- the window from which this command is being invokedinfo
- the ObjectInfo corresponding to this objectcb
- a callback which will be executed when editing is complete. If the user
cancels the operation, it will not be called.public void writeToFile(java.io.DataOutputStream out, Scene theScene) throws java.io.IOException
ImplicitObject
writeToFile
in class ImplicitObject
java.io.IOException
public void editKeyframe(EditingWindow parent, Keyframe k, ObjectInfo info)
editKeyframe
in class Object3D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |