|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartofillusion.object.Object3D
artofillusion.object.SceneCamera
public class SceneCamera
SceneCamera is a type of Object3D. It represents a camera which the user can position within a scene. It should not be confused with the Camera class.
Nested Class Summary | |
---|---|
static class |
SceneCamera.CameraKeyframe
|
Field Summary |
---|
Fields inherited from class artofillusion.object.Object3D |
---|
APPROXIMATELY, CANT_CONVERT, EXACTLY |
Constructor Summary | |
---|---|
SceneCamera()
|
|
SceneCamera(java.io.DataInputStream in,
Scene theScene)
|
Method Summary | |
---|---|
void |
applyImageFilters(ComplexImage image,
Scene scene,
CoordinateSystem coords)
Apply all of this camera's filters to an image. |
void |
applyPoseKeyframe(Keyframe k)
Modify this object based on a pose keyframe. |
boolean |
canSetTexture()
This method tells whether textures can be assigned to the object. |
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. |
Camera |
createCamera(int width,
int height,
CoordinateSystem coords)
Create a Camera object representing the view through this SceneCamera. |
SceneCamera |
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. |
int |
getComponentsForFilters()
Get a list of all image components that should be included in rendered images. |
double |
getDepthOfField()
|
int |
getExtraRequiredComponents()
Get a list of additional image components, beyond those required by the camera's filters, which should be included in rendered images. |
double |
getFieldOfView()
|
double |
getFocalDistance()
|
ImageFilter[] |
getImageFilters()
Get the list of ImageFilters for this camera. |
Keyframe |
getPoseKeyframe()
Return a Keyframe which describes the current pose of this object. |
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. |
void |
getRayFromCamera(double x,
double y,
double dof1,
double dof2,
Vec3 origin,
Vec3 direction)
Compute a ray from the camera location through a point in its field of, represented in the camera's local coordinate system. |
Mat4 |
getScreenTransform(int width,
int height)
Get the transform which maps between view coordinates and screen coordinates for this camera. |
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. |
boolean |
isPerspective()
|
ComplexImage |
renderScene(Scene theScene,
int width,
int height,
Renderer rend,
CoordinateSystem cameraPos)
This is a utility method which synchronously renders an image of the scene from the viewpoint of this camera. |
void |
setDepthOfField(double dof)
|
void |
setExtraRequiredComponents(int components)
Set a list of additional image components, beyond those required by the camera's filters, which should be included in rendered images. |
void |
setFieldOfView(double fieldOfView)
|
void |
setFocalDistance(double dist)
|
void |
setImageFilters(ImageFilter[] filters)
Set the list of ImageFilters for this camera. |
void |
setPerspective(boolean perspective)
|
void |
setPropertyValue(int index,
java.lang.Object value)
Set the value of one of this object's editable properties. |
void |
setSize(double xsize,
double ysize,
double zsize)
Resize the object. |
void |
writeToFile(java.io.DataOutputStream out,
Scene theScene)
The following method writes the object's data to an output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SceneCamera()
public SceneCamera(java.io.DataInputStream in, Scene theScene) throws java.io.IOException, java.io.InvalidObjectException
java.io.IOException
java.io.InvalidObjectException
Method Detail |
---|
public double getFieldOfView()
public void setFieldOfView(double fieldOfView)
public double getDepthOfField()
public void setDepthOfField(double dof)
public double getFocalDistance()
public void setFocalDistance(double dist)
public boolean isPerspective()
public void setPerspective(boolean perspective)
public ImageFilter[] getImageFilters()
public void setImageFilters(ImageFilter[] filters)
public int getExtraRequiredComponents()
public void setExtraRequiredComponents(int components)
public int getComponentsForFilters()
public void applyImageFilters(ComplexImage image, Scene scene, CoordinateSystem coords)
image
- the image to filterscene
- the Scene which was rendered to create the imagecoords
- the position of this camera in the scenepublic Mat4 getScreenTransform(int width, int height)
width
- the image width in pixelsheight
- the image height in pixelspublic void getRayFromCamera(double x, double y, double dof1, double dof2, Vec3 origin, Vec3 direction)
x
- the x coordinate of the point in the plane z=1 through which the ray passesy
- the y coordinate of the point in the plane z=1 through which the ray passesdof1
- this is used for simulating depth of field. dof1 and dof2 are independent values uniformly distributed
between 0 and 1. Together, they select the point on the camera which should serve as the ray's origin.origin
- on exit, this contains the ray origindirection
- on exit, this contains the normalized ray directionpublic SceneCamera 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 boolean canSetTexture()
Object3D
canSetTexture
in class Object3D
public WireframeMesh getWireframeMesh()
Object3D
getWireframeMesh
in class Object3D
public Camera createCamera(int width, int height, CoordinateSystem coords)
width
- the width of the image viewed through the Cameraheight
- the height of the image viewed through the Cameracoords
- the CoordinateSystem of this SceneCamera
public ComplexImage renderScene(Scene theScene, int width, int height, Renderer rend, CoordinateSystem cameraPos)
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
Object3D
writeToFile
in class Object3D
java.io.IOException
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 Keyframe getPoseKeyframe()
Object3D
getPoseKeyframe
in class Object3D
public void applyPoseKeyframe(Keyframe k)
Object3D
applyPoseKeyframe
in class Object3D
public void configurePoseTrack(PoseTrack track)
configurePoseTrack
in class Object3D
public void editKeyframe(EditingWindow parent, Keyframe k, ObjectInfo info)
Object3D
editKeyframe
in class Object3D
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |