Vuo  1.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Functions
VuoSceneObject.cc File Reference

Description

VuoSceneObject implementation.

Classes

struct  VuoSceneObject_treeState
 State for visiting an object at its particular place in the hierarchy. More...
 

Functions

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_makeCube1 (VuoTransform transform, VuoShader shader)
 Returns a cube scene object with a single shader applied to all 6 sides.
 
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 ancestorObjects, VuoSceneObject *foundObject)
 Searches the scenegraph (depth-first) for a scene object with the given name.
 
bool VuoSceneObject_findWithType (VuoSceneObject so, VuoSceneObjectSubType typeToMatch, VuoList_VuoSceneObject ancestorObjects, VuoSceneObject *foundObject)
 Searches the scenegraph (depth-first) for the first scene object with the specified type.
 
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.
 
static VuoSceneObjectSubType VuoSceneObject_typeFromCString (const char *typeString)
 Returns the VuoSceneObjectSubType corresponding with the typeString.
 
static const char * VuoSceneObject_cStringForType (VuoSceneObjectSubType type)
 Returns a string constant representing type.
 
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).
 
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 (const VuoSceneObject object, bool(^function)(const VuoSceneObject *currentObject, float modelviewMatrix[16]))
 Applies function to object and its child objects, without preserving changes to objects.
 
static void VuoSceneObject_applyInternal (VuoSceneObject *object, void(^function)(VuoSceneObject *currentObject, float modelviewMatrix[16]), float modelviewMatrix[16])
 Helper for VuoSceneObject_apply.
 
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.
 
VuoBox VuoSceneObject_bounds (const VuoSceneObject so)
 Get the axis aligned bounding box of this sceneobject and its children (and its children'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_center (VuoSceneObject *so)
 Make the bounds center of all vertices == {0,0,0}.
 
void VuoSceneObject_normalize (VuoSceneObject *so)
 Change the root sceneobject's transform such that the entire scenegraph renders within a 1x1x1 axis-aligned cube.
 
VuoSceneObject VuoSceneObject_makeFromJson (json_object *js)
 Decodes the JSON object js to create a new value.
 
json_objectVuoSceneObject_getJson (const VuoSceneObject value)
 Encodes value as a JSON object.
 
unsigned long VuoSceneObject_getVertexCount (const VuoSceneObject value)
 Returns the total number of vertices in the scene object (but not its descendants).
 
unsigned long VuoSceneObject_getElementCount (const VuoSceneObject value)
 Returns the total number of element in the scene object (but not its descendants).
 
static void VuoSceneObject_getStatistics (const VuoSceneObject value, unsigned long *descendantCount, unsigned long *totalVertexCount, unsigned long *totalElementCount)
 Traverses the specified scenegraph and returns statistics about it.
 
static VuoList_VuoText VuoSceneObject_findShaderNames (VuoSceneObject object)
 Returns a list of all unique shader names in the sceneobject and its descendants.
 
char * VuoSceneObject_getSummary (const VuoSceneObject value)
 Produces a brief human-readable summary of value.
 
static void VuoSceneObject_dump_internal (const VuoSceneObject so, unsigned int level)
 Outputs information about the sceneobject (and its descendants).
 
void VuoSceneObject_dump (const VuoSceneObject so)
 Outputs information about the sceneobject (and its descendants).
 
VuoSceneObject VuoSceneObject_flatten (const VuoSceneObject so, bool calculateTangents)
 Combines all meshes (including child objects) together into a single mesh.
 
static csgjs_model VuoSceneObject_getCsgjsModel (const VuoSceneObject so)
 Converts a VuoSceneObject to a csgjs_model.
 
static VuoSceneObject VuoSceneObject_makeFromCsgjsModel (const csgjs_model &cm)
 Converts a csgjs_model to a VuoSceneObject.
 
static float convertQualityToEpsilon (float quality)
 
VuoSceneObject VuoSceneObject_union (VuoList_VuoSceneObject objects, float quality)
 Returns the union of objects.
 
VuoSceneObject VuoSceneObject_subtract (const VuoSceneObject a, const VuoSceneObject b, float quality)
 Returns the boolean difference of a minus b.
 
VuoSceneObject VuoSceneObject_intersect (VuoList_VuoSceneObject objects, float quality)
 Returns the intersection of objects.
 

Class Documentation

struct VuoSceneObject_treeState
Class Members
float modelviewMatrix[16]
long objectCount
const VuoSceneObject * objects

Function Documentation

static float convertQualityToEpsilon ( float  quality)
static
  • quality 0 = epsilon 1
  • quality 1 = epsilon 0.00001
static void VuoSceneObject_applyInternal ( VuoSceneObject object,
void(^)(VuoSceneObject *currentObject, float modelviewMatrix[16])  function,
float  modelviewMatrix[16] 
)
static

Helper for VuoSceneObject_apply.

static const char* VuoSceneObject_cStringForType ( VuoSceneObjectSubType  type)
static

Returns a string constant representing type.

static void VuoSceneObject_dump_internal ( const VuoSceneObject  so,
unsigned int  level 
)
static

Outputs information about the sceneobject (and its descendants).

static VuoList_VuoText VuoSceneObject_findShaderNames ( VuoSceneObject  object)
static

Returns a list of all unique shader names in the sceneobject and its descendants.

bool VuoSceneObject_findWithType ( VuoSceneObject  so,
VuoSceneObjectSubType  typeToMatch,
VuoList_VuoSceneObject  ancestorObjects,
VuoSceneObject foundObject 
)

Searches the scenegraph (depth-first) for the first scene object with the specified type.

Parameters
soThe root object of the scenegraph to search.
typeToMatchThe sub-type to search for.
[out]ancestorObjectsThe ancestors of foundObject, starting with the root of the scenegraph.
[out]foundObjectThe first matching scene object found.
Returns
True if a matching scene object was found.
static csgjs_model VuoSceneObject_getCsgjsModel ( const VuoSceneObject  so)
static

Converts a VuoSceneObject to a csgjs_model.

unsigned long VuoSceneObject_getElementCount ( const VuoSceneObject  value)

Returns the total number of element in the scene object (but not its descendants).

static void VuoSceneObject_getStatistics ( const VuoSceneObject  value,
unsigned long *  descendantCount,
unsigned long *  totalVertexCount,
unsigned long *  totalElementCount 
)
static

Traverses the specified scenegraph and returns statistics about it.

static VuoSceneObject VuoSceneObject_makeFromCsgjsModel ( const csgjs_model &  cm)
static

Converts a csgjs_model to a VuoSceneObject.

static VuoSceneObjectSubType VuoSceneObject_typeFromCString ( const char *  typeString)
static

Returns the VuoSceneObjectSubType corresponding with the typeString.

If none matches, returns VuoSceneObjectSubType_Empty.