Firelight Technologies FMOD Studio API

Geometry::addPolygon

Adds a polygon to an existing geometry object.

C++ Syntax

FMOD_RESULT Geometry::addPolygon(
  float directocclusion,
  float reverbocclusion,
  bool doublesided,
  int numvertices,
  const FMOD_VECTOR *vertices,
  int *polygonindex
);

C Syntax

FMOD_RESULT FMOD_Geometry_AddPolygon(
  FMOD_GEOMETRY *geometry,
  float directocclusion,
  float reverbocclusion,
  FMOD_BOOL doublesided,
  int numvertices,
  const FMOD_VECTOR *vertices,
  int *polygonindex
);

Parameters

directocclusion
Occlusion value from 0.0 to 1.0 which affects volume or audible frequencies. 0.0 = The polygon does not occlude volume or audible frequencies (sound will be fully audible), 1.0 = The polygon fully occludes (sound will be silent).
reverbocclusion
Occlusion value from 0.0 to 1.0 which affects the reverb mix. 0.0 = The polygon does not occlude reverb (reverb reflections still travel through this polygon), 1.0 = The polyfully fully occludes reverb (reverb reflections will be silent through this polygon).
doublesided
Description of polygon if it is double sided or single sided. 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.
numvertices
Number of vertices in this polygon. This must be at least 3. Polygons (more than 3 sides) are supported.
vertices
A pointer to an array of vertices located in object space, with the count being the number of vertices described using the numvertices parameter.
polygonindex
Address of a variable to receieve the polygon index for this object. This index can be used later with other per polygon based geometry functions.

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

Remarks

Note!

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




Version 1.03.06 Built on Apr 17, 2014