FMOD Engine User Manual 2.03
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
);
FMOD_RESULT FMOD_Geometry_AddPolygon(
FMOD_GEOMETRY *geometry,
float directocclusion,
float reverbocclusion,
FMOD_BOOL doublesided,
int numvertices,
const FMOD_VECTOR *vertices,
int *polygonindex
);
RESULT Geometry.addPolygon(
float directocclusion,
float reverbocclusion,
bool doublesided,
int numvertices,
VECTOR[] vertices,
out int polygonindex
);
Currently not supported for JavaScript.
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
);
FMOD_RESULT FMOD_Geometry_GetActive(
FMOD_GEOMETRY *geometry,
FMOD_BOOL *active
);
RESULT Geometry.getActive(
out bool active
);
Geometry.getActive(
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
);
FMOD_RESULT FMOD_Geometry_GetMaxPolygons(
FMOD_GEOMETRY *geometry,
int *maxpolygons,
int *maxvertices
);
RESULT Geometry.getMaxPolygons(
out int maxpolygons,
out int maxvertices
);
Geometry.getMaxPolygons(
maxpolygons,
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
);
FMOD_RESULT FMOD_Geometry_GetNumPolygons(
FMOD_GEOMETRY *geometry,
int *numpolygons
);
RESULT Geometry.getNumPolygons(
out int numpolygons
);
Geometry.getNumPolygons(
numpolygons
);
See Also: Geometry::AddPolygon
Retrieves the attributes for a polygon.
FMOD_RESULT Geometry::getPolygonAttributes(
int index,
float *directocclusion,
float *reverbocclusion,
bool *doublesided
);
FMOD_RESULT FMOD_Geometry_GetPolygonAttributes(
FMOD_GEOMETRY *geometry,
int index,
float *directocclusion,
float *reverbocclusion,
FMOD_BOOL *doublesided
);
RESULT Geometry.getPolygonAttributes(
int index,
out float directocclusion,
out float reverbocclusion,
out bool doublesided
);
Geometry.getPolygonAttributes(
index,
directocclusion,
reverbocclusion,
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
);
FMOD_RESULT FMOD_Geometry_GetPolygonNumVertices(
FMOD_GEOMETRY *geometry,
int index,
int *numvertices
);
RESULT Geometry.getPolygonNumVertices(
int index,
out int numvertices
);
Geometry.getPolygonNumVertices(
index,
numvertices
);
Polygon index.
Retrieves the position of a vertex.
FMOD_RESULT Geometry::getPolygonVertex(
int index,
int vertexindex,
FMOD_VECTOR *vertex
);
FMOD_RESULT FMOD_Geometry_GetPolygonVertex(
FMOD_GEOMETRY *geometry,
int index,
int vertexindex,
FMOD_VECTOR *vertex
);
RESULT Geometry.getPolygonVertex(
int index,
int vertexindex,
out VECTOR vertex
);
Geometry.getPolygonVertex(
index,
vertexindex,
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
);
FMOD_RESULT FMOD_Geometry_GetPosition(
FMOD_GEOMETRY *geometry,
FMOD_VECTOR *position
);
RESULT Geometry.getPosition(
out VECTOR position
);
Geometry.getPosition(
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
);
FMOD_RESULT FMOD_Geometry_GetRotation(
FMOD_GEOMETRY *geometry,
FMOD_VECTOR *forward,
FMOD_VECTOR *up
);
RESULT Geometry.getRotation(
out VECTOR forward,
out VECTOR up
);
Geometry.getRotation(
forward,
up
);
See Also: Geometry::setRotation
Retrieves the 3D scale of the object.
FMOD_RESULT Geometry::getScale(
FMOD_VECTOR *scale
);
FMOD_RESULT FMOD_Geometry_GetScale(
FMOD_GEOMETRY *geometry,
FMOD_VECTOR *scale
);
RESULT Geometry.getScale(
out VECTOR scale
);
Geometry.getScale(
scale
);
Scale value. (FMOD_VECTOR)
See Also: Geometry::setScale
Retrieves a user value associated with this object.
FMOD_RESULT Geometry::getUserData(
void **userdata
);
FMOD_RESULT FMOD_Geometry_GetUserData(
FMOD_GEOMETRY *geometry,
void **userdata
);
RESULT Geometry.getUserData(
out IntPtr userdata
);
Geometry.getUserData(
userdata
);
This function allows arbitrary user data to be retrieved from this object. See the User Data section of the glossary for an example of how to get and set user data.
Frees a geometry object and releases its memory.
FMOD_RESULT Geometry::release();
FMOD_RESULT FMOD_Geometry_Release(FMOD_GEOMETRY *geometry);
RESULT Geometry.release();
Geometry.release();
Saves the geometry object as a serialized binary block to a user memory buffer.
FMOD_RESULT Geometry::save(
void *data,
int *datasize
);
FMOD_RESULT FMOD_Geometry_Save(
FMOD_GEOMETRY *geometry,
void *data,
int *datasize
);
RESULT Geometry.save(
IntPtr data,
out int datasize
);
Currently not supported for JavaScript.
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
);
FMOD_RESULT FMOD_Geometry_SetActive(
FMOD_GEOMETRY *geometry,
FMOD_BOOL active
);
RESULT Geometry.setActive(
bool active
);
Geometry.setActive(
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
);
FMOD_RESULT FMOD_Geometry_SetPolygonAttributes(
FMOD_GEOMETRY *geometry,
int index,
float directocclusion,
float reverbocclusion,
FMOD_BOOL doublesided
);
RESULT Geometry.setPolygonAttributes(
int index,
float directocclusion,
float reverbocclusion,
bool doublesided
);
Geometry.setPolygonAttributes(
index,
directocclusion,
reverbocclusion,
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
);
FMOD_RESULT FMOD_Geometry_SetPolygonVertex(
FMOD_GEOMETRY *geometry,
int index,
int vertexindex,
const FMOD_VECTOR *vertex
);
RESULT Geometry.setPolygonVertex(
int index,
int vertexindex,
ref VECTOR vertex
);
Geometry.setPolygonVertex(
index,
vertexindex,
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
);
FMOD_RESULT FMOD_Geometry_SetPosition(
FMOD_GEOMETRY *geometry,
const FMOD_VECTOR *position
);
RESULT Geometry.setPosition(
ref VECTOR position
);
Geometry.setPosition(
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
);
FMOD_RESULT FMOD_Geometry_SetRotation(
FMOD_GEOMETRY *geometry,
const FMOD_VECTOR *forward,
const FMOD_VECTOR *up
);
RESULT Geometry.setRotation(
ref VECTOR forward,
ref VECTOR up
);
Geometry.setRotation(
forward,
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
);
FMOD_RESULT FMOD_Geometry_SetScale(
FMOD_GEOMETRY *geometry,
const FMOD_VECTOR *scale
);
RESULT Geometry.setScale(
ref VECTOR scale
);
Geometry.setScale(
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
);
FMOD_RESULT FMOD_Geometry_SetUserData(
FMOD_GEOMETRY *geometry,
void *userdata
);
RESULT Geometry.setUserData(
IntPtr userdata
);
Geometry.setUserData(
userdata
);
This function allows arbitrary user data to be attached to this object. See the User Data section of the glossary for an example of how to get and set user data.
See Also: Geometry::getUserData