#include <FormItCoreTypes.h>
|
FORMIT_CORE_EXPORT | MaterialData (WSM::Color const &color=WSM::Color(255, 255, 255, 255), 1::vector< char > const &aTextureData={}, WSM::Vector2d const &scale={ 1.0, 1.0 }, bool bUseBitmapAlpha=true, 1::string const &sMaterialName={}, 1::string const &sMaterialIdentifier={}, 1::string const &sTextureName={}, 1::vector< AdditionalMaterialAttibute > const &aAttributes={}, 1::vector< AdditionalMaterialTexture > const &aTextures={}) |
|
FORMIT_CORE_EXPORT | MaterialData (const MaterialData &) |
|
FORMIT_CORE_EXPORT float | GetAttribute (AttributeType attributeType) const |
| Get the value of an attribute in the additional attributes.
|
|
FORMIT_CORE_EXPORT bool | SetAttribute (AttributeType attributeType, float value) |
| Set the value of an attribute in the additional attributes.
|
|
FORMIT_CORE_EXPORT const ::vector< char > & | GetMap (MapType mapType) const |
| Get the map from the additional textures.
|
|
FORMIT_CORE_EXPORT void | SetMap (MapType mapType, const 1::vector< char > &map) |
| Set the map int the additional attributes.
|
|
FORMIT_CORE_EXPORT bool | GetPreviewImage (1::vector< unsigned char > &previewImage, size_t &res, bool jpg=false) |
| Create the material preview.
|
|
◆ MaterialData() [1/2]
FORMIT_CORE_EXPORT FormIt::Materials::MaterialData::MaterialData |
( |
WSM::Color const & |
color = WSM::Color(255, 255, 255, 255) , |
|
|
1::vector< char > const & |
aTextureData = {} , |
|
|
WSM::Vector2d const & |
scale = { 1.0, 1.0 } , |
|
|
bool |
bUseBitmapAlpha = true , |
|
|
1::string const & |
sMaterialName = {} , |
|
|
1::string const & |
sMaterialIdentifier = {} , |
|
|
1::string const & |
sTextureName = {} , |
|
|
1::vector< AdditionalMaterialAttibute > const & |
aAttributes = {} , |
|
|
1::vector< AdditionalMaterialTexture > const & |
aTextures = {} |
|
) |
| |
◆ MaterialData() [2/2]
◆ GetAttribute()
Get the value of an attribute in the additional attributes.
The value returned is in the range 0.0 ... 1.0
- Parameters
-
◆ GetMap()
Get the map from the additional textures.
Returns an empty vector if the map does not exist.
- Parameters
-
◆ GetPreviewImage()
FORMIT_CORE_EXPORT bool FormIt::Materials::MaterialData::GetPreviewImage |
( |
1::vector< unsigned char > & |
previewImage, |
|
|
size_t & |
res, |
|
|
bool |
jpg = false |
|
) |
| |
Create the material preview.
The returned vector contains png or jpg formatted rgb pixel values. The preview image is square with a resolution of kMaterialPreviewSize, which is returned via the res argument. Returns true on success.
- Parameters
-
[out] | previewImage |
|
[out] | res |
|
[in] | jpg |
|
◆ SetAttribute()
Set the value of an attribute in the additional attributes.
The value passed in must be in the range 0.0 ... 1.0 Returns false if an value is passed
- Parameters
-
[in] | attributeType |
|
[in] | value |
|
◆ SetMap()
Set the map int the additional attributes.
To delete the map, an empty vector is passed in.
- Parameters
-
◆ m_aAttributes
◆ m_aTextureData
::vector<char> FormIt::Materials::MaterialData::m_aTextureData |
◆ m_aTextures
◆ m_bUseBitmapAlpha
bool FormIt::Materials::MaterialData::m_bUseBitmapAlpha = true |
◆ m_color
WSM::Color FormIt::Materials::MaterialData::m_color |
◆ m_scale
◆ m_sMaterialIdentifier
::string FormIt::Materials::MaterialData::m_sMaterialIdentifier |
◆ m_sMaterialName
::string FormIt::Materials::MaterialData::m_sMaterialName |
◆ m_sTextureName
::string FormIt::Materials::MaterialData::m_sTextureName |
The documentation for this struct was generated from the following file: