Vuo
1.2.2
|
A 3D Object: visible (mesh), or virtual (group, light, camera).
Classes | |
struct | VuoSceneObject |
A 3D Object: visible (mesh), or virtual (group, light, camera). More... | |
Typedefs | |
typedef struct VuoSceneObject | VuoSceneObject |
A 3D Object: visible (mesh), or virtual (group, light, camera). | |
Enumerations | |
enum | VuoSceneObjectType { VuoSceneObjectType_Empty, VuoSceneObjectType_Group, VuoSceneObjectType_Mesh, VuoSceneObjectType_PerspectiveCamera, VuoSceneObjectType_StereoCamera, VuoSceneObjectType_OrthographicCamera, VuoSceneObjectType_FisheyeCamera, VuoSceneObjectType_AmbientLight, VuoSceneObjectType_PointLight, VuoSceneObjectType_Spotlight, VuoSceneObjectType_Text } |
How this scene object should be rendered or how it should affect other scene objects. More... | |
Functions | |
bool | VuoSceneObject_get (VuoText sceneURL, VuoSceneObject *scene, bool center, bool fit, bool hasLeftHandedCoordinates) |
Retrieves the scene at the specified sceneURL, creates a VuoSceneObject from it, and stores it in scene. | |
VuoReal | VuoReal_makeFromJson (json_object *js) |
Decodes the JSON object js , expected to contain a double, to create a new value. | |
VuoSceneObject | VuoSceneObject_makeAmbientLight (VuoColor color, float brightness) |
Returns an ambient light with the specified color and brightness (typically between 0 and 1). | |
VuoSceneObject | VuoSceneObject_makePointLight (VuoColor color, float brightness, VuoPoint3d position, float range, float sharpness) |
Returns a point light (uniform emission in all directions). | |
VuoSceneObject | VuoSceneObject_makeSpotlight (VuoColor color, float brightness, VuoTransform transform, float cone, float range, float sharpness) |
Returns a spot light (emists only in the specified direction). | |
VuoSceneObject | VuoSceneObject_makeEmpty (void) |
Creates a new, empty scene object. | |
VuoSceneObject | VuoSceneObject_makeGroup (VuoList_VuoSceneObject childObjects, VuoTransform transform) |
Creates a new scene object that can contain (and transform) other scene objects, but doesn't render anything itself. | |
VuoSceneObject | VuoSceneObject_make (VuoMesh mesh, VuoShader shader, VuoTransform transform, VuoList_VuoSceneObject childObjects) |
Creates a visible (mesh) scene object. | |
VuoSceneObject | VuoSceneObject_makeQuad (VuoShader shader, VuoPoint3d center, VuoPoint3d rotation, VuoReal width, VuoReal height) |
Returns a scene object that renders a quad with the specified shader. | |
VuoSceneObject | VuoSceneObject_makeQuadWithNormals (VuoShader shader, VuoPoint3d center, VuoPoint3d rotation, VuoReal width, VuoReal height) |
Returns a scene object that renders a quad with the specified shader. | |
VuoSceneObject | VuoSceneObject_makeImage (VuoImage image, VuoPoint3d center, VuoPoint3d rotation, VuoReal width, VuoReal alpha) |
Returns an unlit scene object with the specified image . | |
VuoSceneObject | VuoSceneObject_makeLitImage (VuoImage image, VuoPoint3d center, VuoPoint3d rotation, VuoReal width, VuoReal alpha, VuoColor highlightColor, VuoReal shininess) |
Returns a lit scene object with the specified image . | |
VuoSceneObject | VuoSceneObject_makeCube (VuoTransform transform, VuoShader frontShader, VuoShader leftShader, VuoShader rightShader, VuoShader backShader, VuoShader topShader, VuoShader bottomShader) |
Returns a scene object consisting of 6 child objects (square quads), each with its own shader. | |
VuoSceneObject | VuoSceneObject_makeText (VuoText text, VuoFont font) |
Returns a scene object representing deferred-rendered text. | |
VuoSceneObject | VuoSceneObject_makePerspectiveCamera (VuoText name, VuoTransform transform, float fieldOfView, float distanceMin, float distanceMax) |
Returns a perspective camera having the position and negative-rotation specified by transform (its scale is ignored). | |
VuoSceneObject | VuoSceneObject_makeStereoCamera (VuoText name, VuoTransform transform, VuoReal fieldOfView, VuoReal distanceMin, VuoReal distanceMax, VuoReal confocalDistance, VuoReal intraocularDistance) |
Returns a stereoscopic camera having the position and negative-rotation specified by transform (its scale is ignored). | |
VuoSceneObject | VuoSceneObject_makeOrthographicCamera (VuoText name, VuoTransform transform, float width, float distanceMin, float distanceMax) |
Returns an orthographic camera having the position and negative-rotation specified by transform (its scale is ignored). | |
VuoSceneObject | VuoSceneObject_makeFisheyeCamera (VuoText name, VuoTransform transform, VuoReal fieldOfView, VuoReal vignetteWidth, VuoReal vignetteSharpness) |
Returns a fisheye camera having the position and negative-rotation specified by transform (its scale is ignored). | |
VuoSceneObject | VuoSceneObject_makeDefaultCamera (void) |
Returns a perspective camera at (0,0,1), facing along -z, 90 degree FOV, and clip planes at 0.1 and 10.0. | |
bool | VuoSceneObject_find (VuoSceneObject so, VuoText nameToMatch, VuoList_VuoSceneObject parentObjects, VuoSceneObject *foundObject) |
Searches the scenegraph (depth-first) for a scene object with the given name. | |
bool | VuoSceneObject_findCamera (VuoSceneObject so, VuoText nameToMatch, VuoSceneObject *foundCamera) |
Performs a depth-first search of the scenegraph. | |
bool | VuoSceneObject_isPopulated (VuoSceneObject so) |
Performs a depth-first search of the scenegraph. | |
void | VuoSceneObject_findLights (VuoSceneObject so, VuoColor *ambientColor, float *ambientBrightness, VuoList_VuoSceneObject *pointLights, VuoList_VuoSceneObject *spotLights) |
Finds and returns all the lights in the scene. | |
void | VuoSceneObject_visit (VuoSceneObject object, void(^function)(VuoSceneObject currentObject)) |
Applies function to object and its child objects, without preserving changes to objects. | |
void | VuoSceneObject_apply (VuoSceneObject *object, void(^function)(VuoSceneObject *currentObject, float modelviewMatrix[16])) |
Applies function to object and its child objects, and outputs the modified object . | |
void | VuoSceneObject_setFaceCullingMode (VuoSceneObject *object, unsigned int faceCullingMode) |
Sets the faceCullingMode on object and its child objects. | |
void | VuoSceneObject_setBlendMode (VuoSceneObject *object, VuoBlendMode blendMode) |
Sets the blendMode on object and its child objects. | |
VuoSceneObject | VuoSceneObject_copy (const VuoSceneObject object) |
Makes a deep copy of object . | |
VuoSceneObject | VuoSceneObject_makeFromJson (struct json_object *js) |
Decodes the JSON object js to create a new value. | |
struct json_object * | VuoSceneObject_getJson (const VuoSceneObject value) |
Encodes value as a JSON object. | |
char * | VuoSceneObject_getSummary (const VuoSceneObject value) |
Produces a brief human-readable summary of value . | |
VuoBox | VuoSceneObject_bounds (const VuoSceneObject so) |
Get the axis aligned bounding box of this sceneobject and it's children. | |
bool | VuoSceneObject_meshBounds (const VuoSceneObject so, VuoBox *bounds, float matrix[16]) |
Bounding box of the vertices for this SceneObject (taking into account transform). | |
void | VuoSceneObject_normalize (VuoSceneObject *so) |
Change the root sceneobject's transform such that the entire scenegraph renders within a 1x1x1 axis-aligned cube. | |
void | VuoSceneObject_center (VuoSceneObject *so) |
Make the bounds center of all vertices == {0,0,0}. | |
void | VuoSceneObject_dump (const VuoSceneObject so) |
Outputs information about the sceneobject (and its descendants). | |
unsigned long | VuoSceneObject_getVertexCount (const VuoSceneObject value) |
Returns the total number of vertices in the scene object (but not its descendants). | |
VuoSceneObject | VuoSceneObject_makeFromString (const char *str) |
Automatically generated function. | |
char * | VuoSceneObject_getString (const VuoSceneObject value) |
Automatically generated function. | |
void | VuoSceneObject_retain (VuoSceneObject value) |
Automatically generated function. | |
void | VuoSceneObject_release (VuoSceneObject value) |
Automatically generated function. | |
struct VuoSceneObject |
Class Members | ||
---|---|---|
VuoBlendMode | blendMode | |
float | cameraConfocalDistance | Distance from camera to stereoscopic confocal plane. |
float | cameraDistanceMax | Distance from camera to far clip plane. |
float | cameraDistanceMin | Distance from camera to near clip plane. |
float | cameraFieldOfView | Perspective and fisheye FOV, in degrees. |
float | cameraIntraocularDistance | Distance between the stereoscopic camera pair. |
float | cameraVignetteSharpness | Fisheye only. Distance that the vignette gradient covers. |
float | cameraVignetteWidth | Fisheye only. Distance from the center of the viewport to the center of the vignette. |
float | cameraWidth | Orthographic width, in scene coordinates. |
VuoList_VuoSceneObject | childObjects | |
VuoFont | font | |
bool | isRealSize | If the object is real-size, it ignores rotations and scales, and is sized to match the shader's first image. |
float | lightBrightness | |
VuoColor | lightColor | |
float | lightCone | Size (in radians) of the light's cone. Affects spotlights. |
float | lightRange | Distance (in local coordinates) the light reaches. Affects point lights and spotlights. |
float | lightSharpness | Sharpness of the light's distance/cone falloff. 0 means the light starts fading at distance/angle 0 and ends at 2*lightRange or 2*lightCone. 1 means the falloff is instant. |
VuoMesh | mesh | |
VuoText | name | |
VuoShader | shader | |
VuoText | text | |
VuoTransform | transform | |
VuoSceneObjectType | type |
typedef struct VuoSceneObject VuoSceneObject |
A 3D Object: visible (mesh), or virtual (group, light, camera).
enum VuoSceneObjectType |
How this scene object should be rendered or how it should affect other scene objects.
VuoReal VuoReal_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
, expected to contain a double, to create a new value.
void VuoSceneObject_apply | ( | VuoSceneObject * | object, |
void(^)(VuoSceneObject *currentObject, float modelviewMatrix[16]) | function | ||
) |
Applies function
to object
and its child objects, and outputs the modified object
.
The value modelviewMatrix
(which VuoSceneObject_apply
passes to function
) is the cumulative transformation matrix (from object
down to the currentObject
).
VuoBox VuoSceneObject_bounds | ( | const VuoSceneObject | so | ) |
Get the axis aligned bounding box of this sceneobject and it's children.
void VuoSceneObject_center | ( | VuoSceneObject * | so | ) |
Make the bounds center of all vertices == {0,0,0}.
VuoSceneObject VuoSceneObject_copy | ( | const VuoSceneObject | object | ) |
Makes a deep copy of object
.
Each mesh is copied (see VuoMesh_copy), and each child object is copied.
You can change attributes on the copy without affecting the original.
void VuoSceneObject_dump | ( | const VuoSceneObject | so | ) |
Outputs information about the sceneobject (and its descendants).
bool VuoSceneObject_find | ( | VuoSceneObject | so, |
VuoText | nameToMatch, | ||
VuoList_VuoSceneObject | ancestorObjects, | ||
VuoSceneObject * | foundObject | ||
) |
Searches the scenegraph (depth-first) for a scene object with the given name.
so | The root object of the scenegraph to search. | |
nameToMatch | The name to search for. | |
[out] | ancestorObjects | The ancestors of foundObject, starting with the root of the scenegraph. |
[out] | foundObject | The first matching scene object found. |
bool VuoSceneObject_findCamera | ( | VuoSceneObject | so, |
VuoText | nameToMatch, | ||
VuoSceneObject * | foundCamera | ||
) |
Performs a depth-first search of the scenegraph.
Returns (via foundCamera
) the first camera whose name contains nameToMatch
(or, if nameToMatch
is emptystring or NULL, just returns the first camera), with its transform altered to incorporate the transforms of its ancestor objects. The returned boolean indicates whether a camera was found. If no camera was found, foundCamera
is unaltered.
void VuoSceneObject_findLights | ( | VuoSceneObject | so, |
VuoColor * | ambientColor, | ||
float * | ambientBrightness, | ||
VuoList_VuoSceneObject * | pointLights, | ||
VuoList_VuoSceneObject * | spotLights | ||
) |
Finds and returns all the lights in the scene.
If there are multiple ambient lights, returns the weighted (by alpha) average color and summed brightness.
If there are no lights in the scene, returns some default lights.
bool VuoSceneObject_get | ( | VuoText | sceneURL, |
VuoSceneObject * | scene, | ||
bool | center, | ||
bool | fit, | ||
bool | hasLeftHandedCoordinates | ||
) |
Retrieves the scene at the specified sceneURL, creates a VuoSceneObject
from it, and stores it in scene.
Returns false if the scene could not be loaded.
|
read |
Encodes value
as a JSON object.
char* VuoSceneObject_getString | ( | const VuoSceneObject | value | ) |
Automatically generated function.
char* VuoSceneObject_getSummary | ( | const VuoSceneObject | value | ) |
Produces a brief human-readable summary of value
.
unsigned long VuoSceneObject_getVertexCount | ( | const VuoSceneObject | value | ) |
Returns the total number of vertices in the scene object (but not its descendants).
bool VuoSceneObject_isPopulated | ( | VuoSceneObject | so | ) |
Performs a depth-first search of the scenegraph.
Returns true if the scene object or any of its children have a non-empty type.
VuoSceneObject VuoSceneObject_make | ( | VuoMesh | mesh, |
VuoShader | shader, | ||
VuoTransform | transform, | ||
VuoList_VuoSceneObject | childObjects | ||
) |
Creates a visible (mesh) scene object.
VuoSceneObject VuoSceneObject_makeAmbientLight | ( | VuoColor | color, |
float | brightness | ||
) |
Returns an ambient light with the specified color
and brightness
(typically between 0 and 1).
VuoSceneObject VuoSceneObject_makeCube | ( | VuoTransform | transform, |
VuoShader | frontShader, | ||
VuoShader | leftShader, | ||
VuoShader | rightShader, | ||
VuoShader | backShader, | ||
VuoShader | topShader, | ||
VuoShader | bottomShader | ||
) |
Returns a scene object consisting of 6 child objects (square quads), each with its own shader.
VuoSceneObject VuoSceneObject_makeDefaultCamera | ( | void | ) |
Returns a perspective camera at (0,0,1), facing along -z, 90 degree FOV, and clip planes at 0.1 and 10.0.
VuoSceneObject VuoSceneObject_makeEmpty | ( | void | ) |
Creates a new, empty scene object.
VuoSceneObject VuoSceneObject_makeFisheyeCamera | ( | VuoText | name, |
VuoTransform | transform, | ||
VuoReal | fieldOfView, | ||
VuoReal | vignetteWidth, | ||
VuoReal | vignetteSharpness | ||
) |
Returns a fisheye camera having the position and negative-rotation specified by transform
(its scale is ignored).
VuoSceneObject VuoSceneObject_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
VuoSceneObject VuoSceneObject_makeFromString | ( | const char * | str | ) |
Automatically generated function.
VuoSceneObject VuoSceneObject_makeGroup | ( | VuoList_VuoSceneObject | childObjects, |
VuoTransform | transform | ||
) |
Creates a new scene object that can contain (and transform) other scene objects, but doesn't render anything itself.
VuoSceneObject VuoSceneObject_makeImage | ( | VuoImage | image, |
VuoPoint3d | center, | ||
VuoPoint3d | rotation, | ||
VuoReal | width, | ||
VuoReal | alpha | ||
) |
Returns an unlit scene object with the specified image
.
This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)
VuoSceneObject VuoSceneObject_makeLitImage | ( | VuoImage | image, |
VuoPoint3d | center, | ||
VuoPoint3d | rotation, | ||
VuoReal | width, | ||
VuoReal | alpha, | ||
VuoColor | highlightColor, | ||
VuoReal | shininess | ||
) |
Returns a lit scene object with the specified image
.
This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)
VuoSceneObject VuoSceneObject_makeOrthographicCamera | ( | VuoText | name, |
VuoTransform | transform, | ||
float | width, | ||
float | distanceMin, | ||
float | distanceMax | ||
) |
Returns an orthographic camera having the position and negative-rotation specified by transform
(its scale is ignored).
VuoSceneObject VuoSceneObject_makePerspectiveCamera | ( | VuoText | name, |
VuoTransform | transform, | ||
float | fieldOfView, | ||
float | distanceMin, | ||
float | distanceMax | ||
) |
Returns a perspective camera having the position and negative-rotation specified by transform
(its scale is ignored).
VuoSceneObject VuoSceneObject_makePointLight | ( | VuoColor | color, |
float | brightness, | ||
VuoPoint3d | position, | ||
float | range, | ||
float | sharpness | ||
) |
Returns a point light (uniform emission in all directions).
color | The light's color. |
brightness | The light's brightness multiplier (typically between 0 and 1). |
position | The light's position. |
range | The distance (in local coordinates) the light reaches. |
sharpness | The sharpness of the light's distance falloff. 0 means the light starts fading at distance 0 and ends at 2*lightRange. 1 means the falloff is instant. |
VuoSceneObject VuoSceneObject_makeQuad | ( | VuoShader | shader, |
VuoPoint3d | center, | ||
VuoPoint3d | rotation, | ||
VuoReal | width, | ||
VuoReal | height | ||
) |
Returns a scene object that renders a quad with the specified shader.
The quad does not include normals, tangents, or bitangents.
shader | The shader used to render the object. |
center | The object's center, specified in scene coordinates. |
rotation | The object's rotation, specified in degrees. |
width | The object's width, specified in scene coordinates. |
height | The object's height, specified in scene coordinates. |
This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)
VuoSceneObject VuoSceneObject_makeQuadWithNormals | ( | VuoShader | shader, |
VuoPoint3d | center, | ||
VuoPoint3d | rotation, | ||
VuoReal | width, | ||
VuoReal | height | ||
) |
Returns a scene object that renders a quad with the specified shader.
The quad includes normals, tangents, or bitangents.
shader | The shader used to render the object. |
center | The object's center, specified in scene coordinates. |
rotation | The object's rotation, specified in degrees. |
width | The object's width, specified in scene coordinates. |
height | The object's height, specified in scene coordinates. |
This function may be called from any thread. (However, the caller is responsible for ensuring that the GL context is not used simultaneously on multiple threads.)
VuoSceneObject VuoSceneObject_makeSpotlight | ( | VuoColor | color, |
float | brightness, | ||
VuoTransform | transform, | ||
float | cone, | ||
float | range, | ||
float | sharpness | ||
) |
Returns a spot light (emists only in the specified direction).
color | The light's color. |
brightness | The light's brightness multiplier (typically between 0 and 1). |
transform | The position and direction of the light. (The transform's scale is ignored.) |
cone | Width (in radians) of the light's cone. |
range | The distance (in local coordinates) the light reaches. |
sharpness | The sharpness of the light's distance/cone falloff. 0 means the light starts fading at distance/angle 0 and ends at 2*range or 2*cone. 1 means the falloff is instant. |
VuoSceneObject VuoSceneObject_makeStereoCamera | ( | VuoText | name, |
VuoTransform | transform, | ||
VuoReal | fieldOfView, | ||
VuoReal | distanceMin, | ||
VuoReal | distanceMax, | ||
VuoReal | confocalDistance, | ||
VuoReal | intraocularDistance | ||
) |
Returns a stereoscopic camera having the position and negative-rotation specified by transform
(its scale is ignored).
VuoSceneObject VuoSceneObject_makeText | ( | VuoText | text, |
VuoFont | font | ||
) |
Returns a scene object representing deferred-rendered text.
This function may be called from any thread.
bool VuoSceneObject_meshBounds | ( | const VuoSceneObject | so, |
VuoBox * | bounds, | ||
float | matrix[16] | ||
) |
Bounding box of the vertices for this SceneObject (taking into account transform).
void VuoSceneObject_normalize | ( | VuoSceneObject * | so | ) |
Change the root sceneobject's transform such that the entire scenegraph renders within a 1x1x1 axis-aligned cube.
If the scenegraph has zero size (e.g., if it is empty, or if it consists entirely of Real Size Layers), the transform is left unchanged.
void VuoSceneObject_release | ( | VuoSceneObject | value | ) |
Automatically generated function.
void VuoSceneObject_retain | ( | VuoSceneObject | value | ) |
Automatically generated function.
void VuoSceneObject_setBlendMode | ( | VuoSceneObject * | object, |
VuoBlendMode | blendMode | ||
) |
Sets the blendMode
on object
and its child objects.
Only the following VuoBlendModes are supported:
void VuoSceneObject_setFaceCullingMode | ( | VuoSceneObject * | object, |
unsigned int | faceCullingMode | ||
) |
Sets the faceCullingMode
on object
and its child objects.
faceCullingMode
can be GL_NONE
(show both front and back faces), GL_BACK
(show only front faces), or GL_FRONT
(show only back faces).
void VuoSceneObject_visit | ( | VuoSceneObject | object, |
void(^)(VuoSceneObject currentObject) | function | ||
) |
Applies function
to object
and its child objects, without preserving changes to objects.