Adding meshes, materials and other methods

parent 66f62523
......@@ -526,6 +526,7 @@ public:
int iID; //!< ID
int iType;
std::string sName;
CVAStruct oParams;
std::vector< float > vfValues;
......
......@@ -116,6 +116,7 @@ public:
static const int VA_AURAMODE_DOPPLER = ( 1 << 9 ); //!< Doppler effects
static const int VA_AURAMODE_SPREADING_LOSS = ( 1 << 10 ); //!< Spherical spreading loss
static const int VA_AURAMODE_TRANSMISSION = ( 1 << 11 ); //!< Sound transmission
static const int VA_AURAMODE_ABSORPTION = ( 1 << 12 ); //!< Sound absorption
//! Default auralization mode (alias)
static const int VA_AURAMODE_DEFAULT = VA_AURAMODE_DIRECT_SOUND |
......@@ -123,7 +124,8 @@ public:
VA_AURAMODE_AIR_ABSORPTION |
VA_AURAMODE_DOPPLER |
VA_AURAMODE_SPREADING_LOSS |
VA_AURAMODE_TRANSMISSION;
VA_AURAMODE_TRANSMISSION |
VA_AURAMODE_ABSORPTION;
//! All auralization modes (mask)
static const int VA_AURAMODE_ALL = VA_AURAMODE_DIRECT_SOUND |
......@@ -137,7 +139,8 @@ public:
VA_AURAMODE_NEARFIELD |
VA_AURAMODE_DOPPLER |
VA_AURAMODE_SPREADING_LOSS |
VA_AURAMODE_TRANSMISSION;
VA_AURAMODE_TRANSMISSION |
VA_AURAMODE_ABSORPTION;
//! Destructor
......@@ -239,16 +242,16 @@ public:
//! Create a directivity from a file path
/**
* Loads a directivity from a file.
*
* \param sFilePath Filename
* \param sName Name (optional, e.g. "Trumpet")
*
* \return Directivity-ID
*
* \note Slashes and backslashed may safely be used.
* Paths are automatically converted into the system's convention.
*/
* Loads a directivity from a file.
*
* \param sFilePath Filename
* \param sName Name (optional, e.g. "Trumpet")
*
* \return Directivity-ID
*
* \note Slashes and backslashed may safely be used.
* Paths are automatically converted into the system's convention.
*/
inline int CreateDirectivityFromFile( const std::string& sFilePath, const std::string& sName = "" )
{
CVAStruct oParams;
......@@ -260,23 +263,60 @@ public:
//! Frees a directivity
/**
* Frees a directivity and releases its memory.
* This is only possible if the directivity is not in use.
* Otherwise the method will do nothing.
*
* \param iID Directivity-ID
*
* \return true, if the directivity was successfully freed.
* false, otherwise
*/
* Frees a directivity and releases its memory.
* This is only possible if the directivity is not in use.
* Otherwise the method will do nothing.
*
* \param iID Directivity-ID
*
* \return true, if the directivity was successfully freed.
* false, otherwise
*/
virtual bool DeleteDirectivity( const int iID ) = 0;
//! Retrieves information of a loaded directivity
virtual CVADirectivityInfo GetDirectivityInfo( int iID ) const = 0;
virtual CVADirectivityInfo GetDirectivityInfo( const int iID ) const = 0;
//! Retrieves information of all loaded directivities
virtual void GetDirectivityInfos( std::vector< CVADirectivityInfo >& voDest ) const = 0;
virtual void SetDirectivityParameters( const int iID, const CVAStruct& oParams ) = 0;
virtual CVAStruct GetDirectivityParameters( const int iID, const CVAStruct& oParams ) const = 0;
virtual int CreateAcousticMaterial( const CVAStruct& oParams, const std::string& sName = "" ) = 0;
//! Frees a material
virtual bool DeleteAcousticMaterial( const int iID ) = 0;
//! Retrieves information of a loaded directivity
virtual CVAAcousticMaterial GetAcousticMaterialInfo( const int iID ) const = 0;
//! Retrieves information of all loaded directivities
virtual void GetAcousticMaterialInfos( std::vector< CVAAcousticMaterial >& voDest ) const = 0;
virtual void SetAcousticMaterialParameters( const int iID, const CVAStruct& oParams ) = 0;
virtual CVAStruct GetAcousticMaterialParameters( const int iID, const CVAStruct& oParams ) const = 0;
virtual int CreateGeometryMesh( const CVAStruct& oParams, const std::string& sName = "" ) = 0;
//! Frees a material
virtual bool DeleteGeometryMesh( const int iID ) = 0;
//! Retrieves information of a loaded directivity
virtual CVAGeometryMesh GetGeometryMeshInfo( const int iID ) const = 0;
//! Retrieves information of all loaded directivities
virtual void GetGeometryMeshInfos( std::vector< CVAGeometryMesh >& voDest ) const = 0;
virtual void SetGeometryMeshParameters( const int iID, const CVAStruct& oParams ) = 0;
virtual CVAStruct GetGeometryMeshParameters( const int iID, const CVAStruct& oParams ) const = 0;
//! Creates an audiofile signal source
/**
* Creates a signal source which streams the samples of an audiofile.
......
......@@ -130,6 +130,7 @@ int ParseAuralizationModeToken( const std::string& t )
if( t == "DP" ) return IVACore::VA_AURAMODE_DOPPLER;
if( t == "SL" ) return IVACore::VA_AURAMODE_SPREADING_LOSS;
if( t == "TR" ) return IVACore::VA_AURAMODE_TRANSMISSION;
if( t == "AB" ) return IVACore::VA_AURAMODE_ABSORPTION;
return -1;
}
......@@ -305,7 +306,8 @@ std::string IVACore::GetAuralizationModeStr( const int iAuralizationMode, const
if( iAuralizationMode & VA_AURAMODE_NEARFIELD ) ss << "NF, ";
if( iAuralizationMode & VA_AURAMODE_DOPPLER ) ss << "DP, ";
if( iAuralizationMode & VA_AURAMODE_SPREADING_LOSS ) ss << "SL, ";
if( iAuralizationMode & VA_AURAMODE_TRANSMISSION ) ss << "TR, ";
if( iAuralizationMode & VA_AURAMODE_TRANSMISSION ) ss << "TR, ";
if( iAuralizationMode & VA_AURAMODE_ABSORPTION ) ss << "AB, ";
}
else
{
......@@ -323,6 +325,7 @@ std::string IVACore::GetAuralizationModeStr( const int iAuralizationMode, const
if( iAuralizationMode & VA_AURAMODE_DOPPLER ) ss << "doppler shifts, ";
if( iAuralizationMode & VA_AURAMODE_SPREADING_LOSS ) ss << "spherical spreading loss, ";
if( iAuralizationMode & VA_AURAMODE_TRANSMISSION ) ss << "transmission, ";
if( iAuralizationMode & VA_AURAMODE_ABSORPTION ) ss << "absorption, ";
}
// Remove last ,_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment