FMOD API User Manual 2.00
An interface that allows the setup and modification of geometry for occlusion
Polygons:
Object Spatialization:
Object General:
Adds a polygon.
FMOD_RESULT Geometry::addPolygon(
float directocclusion,
float reverbocclusion,
bool doublesided,
int numvertices,
const FMOD_VECTOR *vertices,
int *polygonindex
);
Occlusion factor of the polygon for the direct path where 0 represents no occlusion and 1 represents full occlusion.
Occlusion factor of the polygon for the reverb path where 0 represents no occlusion and 1 represents full occlusion.
True: Polygon is double sided.
False: Polygon is single sided, and the winding of the polygon (which determines the polygon's normal) determines which side of the polygon will cause occlusion.
All vertices must lay in the same plane otherwise behavior may be unpredictable. The polygon is assumed to be convex. A non convex polygon will produce unpredictable behavior. Polygons with zero area will be ignored.
Polygons cannot be added if already at the maximum number of polygons or if the addition of their verticies would result in exceeding the maximum number of vertices.
Vertices of an object are in object space, not world space, and so are relative to the position, or center of the object. See Geometry::setPosition.
See Also: Geometry::setPolygonAttributes, Geometry::getNumPolygons, Geometry::getMaxPolygons
Retrieves whether an object is processed by the geometry engine.
FMOD_RESULT Geometry::getActive(
bool *active
);
Object is allowed to be processed by the geometry engine.
See Also: Geometry::setActive
Retrieves the maximum number of polygons and vertices allocatable for this object.
FMOD_RESULT Geometry::getMaxPolygons(
int *maxpolygons,
int *maxvertices
);
The maximum number was set with System::createGeometry.
See Also: System::loadGeometry
Retrieves the number of polygons in this object.
FMOD_RESULT Geometry::getNumPolygons(
int *numpolygons
);
See Also: Geometry::AddPolygon
Retrieves the attributes for a polygon.
FMOD_RESULT Geometry::getPolygonAttributes(
int index,
float *directocclusion,
float *reverbocclusion,
bool *doublesided
);
Polygon index.
Occlusion factor for the direct path where 0 represents no occlusion and 1 represents full occlusion.
Occlusion factor for the reverb path where 0 represents no occlusion and 1 represents full occlusion.
True: Polygon is double sided.
False: Polygon is single sided, and the winding of the polygon (which determines the polygon's normal) determines which side of the polygon will cause occlusion.
See Also: Geometry::setPolygonAttributes
Gets the number of vertices in a polygon.
FMOD_RESULT Geometry::getPolygonNumVertices(
int index,
int *numvertices
);
Polygon index.
Retrieves the position of a vertex.
FMOD_RESULT Geometry::getPolygonVertex(
int index,
int vertexindex,
FMOD_VECTOR *vertex
);
Polygon index.
Polygon vertex index.
3D Position of the vertex. (FMOD_VECTOR)
Vertices are relative to the position of the object. See Geometry::setPosition.
See Also: Geometry::setPolygonVertex
Retrieves the 3D position of the object.
FMOD_RESULT Geometry::getPosition(
FMOD_VECTOR *position
);
3D position. (FMOD_VECTOR)
Position is in world space.
See Also: Geometry::setPosition
Retrieves the 3D orientation of the object.
FMOD_RESULT Geometry::getRotation(
FMOD_VECTOR *forward,
FMOD_VECTOR *up
);
See Also: Geometry::setRotation
Retrieves the 3D scale of the object.
FMOD_RESULT Geometry::getScale(
FMOD_VECTOR *scale
);
Scale value. (FMOD_VECTOR)
See Also: Geometry::setScale
Retrieves a user value associated with this object.
FMOD_RESULT Geometry::getUserData(
void **userdata
);
See Also: Geometry::setUserData
Frees a geometry object and releases its memory.
FMOD_RESULT Geometry::release();
Saves the geometry object as a serialized binary block to a user memory buffer.
FMOD_RESULT Geometry::save(
void *data,
int *datasize
);
Size required to save this object when 'data' parameter is null. Otherwise ignored.
Typical usage of this function is to call it twice - once to get the size of the data, then again to write the data to your pointer.
The data can be saved to a file if required and loaded later with System::loadGeometry.
See Also: System::createGeometry
Sets whether an object is processed by the geometry engine.
FMOD_RESULT Geometry::setActive(
bool active
);
Allow object to be processed by the geometry engine.
See Also: Geometry::getActive
Sets individual attributes for a polygon inside a geometry object.
FMOD_RESULT Geometry::setPolygonAttributes(
int index,
float directocclusion,
float reverbocclusion,
bool doublesided
);
Polygon index.
Occlusion factor of the polygon for the direct path where 0 represents no occlusion and 1 represents full occlusion.
Occlusion factor of the polygon for the reverb path where 0 represents no occlusion and 1 represents full occlusion.
True: Polygon is double sided.
False: Polygon is single sided, and the winding of the polygon (which determines the polygon's normal) determines which side of the polygon will cause occlusion.
See Also: Geometry::getPolygonAttributes, Geometry::getNumPolygons
Alters the position of a polygon's vertex inside a geometry object.
FMOD_RESULT Geometry::setPolygonVertex(
int index,
int vertexindex,
const FMOD_VECTOR *vertex
);
Polygon index.
Polygon vertex index.
3D Position of the vertex. (FMOD_VECTOR)
Vertices are relative to the position of the object. See Geometry::setPosition.
There may be some significant overhead with this function as it may cause some reconfiguration of internal data structures used to speed up sound-ray testing.
You may get better results if you want to modify your object by using Geometry::setPosition, Geometry::setScale and Geometry::setRotation.
See Also: Geometry::getPolygonNumVertices, Geometry::getPolygonNumVertices, Geometry::getNumPolygons
Sets the 3D position of the object.
FMOD_RESULT Geometry::setPosition(
const FMOD_VECTOR *position
);
3D position. (FMOD_VECTOR)
Position is in world space.
See Also: Geometry::getPosition, Geometry::setRotation, Geometry::setScale
Sets the 3D orientation of the object.
FMOD_RESULT Geometry::setRotation(
const FMOD_VECTOR *forward,
const FMOD_VECTOR *up
);
Forwards orientation. This vector must be of unit length and perpendicular to the up vector. (FMOD_VECTOR)
Upwards orientation. This vector must be of unit length and perpendicular to the forwards vector. (FMOD_VECTOR)
See remarks in System::set3DListenerAttributes for more description on forward and up vectors.
See Also: Geometry::getRotation, Geometry::setPosition, Geometry::setScale
Sets the 3D scale of the object.
FMOD_RESULT Geometry::setScale(
const FMOD_VECTOR *scale
);
Scale value. (FMOD_VECTOR)
An object can be scaled/warped in all 3 dimensions separately using this function without having to modify polygon data.
See Also: Geometry::getScale, Geometry::setPosition, Geometry::setRotation
Sets a user value associated with this object.
FMOD_RESULT Geometry::setUserData(
void *userdata
);
Associates some data with this object to give it context, it will be passed back via callbacks but otherwise remain untouched.
See Also: Geometry::getUserData