Class TextureInfo

Class Documentation

class TextureInfo

Data class which represents a texture.

Public Functions

TextureInfo()

Default constructor with SourceType set to ETextureResourceType::ImageAsset by default.

TextureInfo(const csp::common::String &AssetCollectionId, const csp::common::String &AssetId)

Constructor which associates a texture with an asset, using ETextureResourceType::ImageAsset as it’s source type.

Parameters
  • AssetCollectionId – const csp::common::String& : The asset collection where the texture info is stored

  • AssetId – const csp::common::String& : The asset where the texture info is stored

TextureInfo(const csp::common::String &ComponentId)

Constructor which associates a texture with a media component, using ETextureResourceType::Component as it’s source type.

Parameters

ComponentId – const csp::common::String& : The component id used as the texture data source

void SetCollectionAndAssetId(const csp::common::String &AssetCollectionId, const csp::common::String &AssetId)

Sets the textures asset collection id and asset id Uses ETextureResourceType::ImageAsset as it’s source type.

Parameters
  • AssetCollectionId – const csp::common::String& : The asset collection where the texture info is stored

  • AssetId – const csp::common::String& : The asset where the texture info is stored

const csp::common::String &GetAssetCollectionId() const

Gets the asset collection id for the texture.

Returns

csp::common::String&

const csp::common::String &GetAssetId() const

Gets the asset id for the texture.

Returns

csp::common::String&

void SetEntityComponentId(const csp::common::String &ComponentId)

Sets the textures entity component id Format: {entity.id}-{component.id} This can be obtained from ComponentBase::GetUniqueComponentId.

Parameters

ComponentId – const csp::common::String&

const csp::common::String &GetEntityComponentId() const

Gets the entity component id.

Returns

csp::common::String&

ETextureResourceType GetSourceType() const

Gets the source type of this texture This is set internally by constructors and SetCollectionAndAssetId/SetEntityComponentId.

Returns

ETextureResourceType

void SetUVOffset(csp::common::Vector2 Offset)

Sets the uv offset of the texture.

Parameters

Offsetcsp::common::Vector2

csp::common::Vector2 GetUVOffset() const

Gets the uv offset of the texture.

Returns

csp::common::Vector2

void SetUVRotation(float Rotation)

Gets the uv rotation of the texture.

Parameters

Rotation – float

float GetUVRotation() const

Gets the uv rotation of the texture.

Returns

float

void SetUVScale(csp::common::Vector2 Scale)

Sets the uv scale of the texture.

Parameters

Scalecsp::common::Vector2

csp::common::Vector2 GetUVScale() const

Gets the uv scale of the texture.

Returns

csp::common::Vector2

void SetTexCoord(int Coord)

Sets The set index of texture’s TEXCOORD attribute used for texture coordinate mapping.

Parameters

Coord – int

int GetTexCoord() const

Gets the index of texture’s TEXCOORD attribute.

Returns

int

bool IsSet() const

True if this texture has been set for the current material.

Returns

bool

void SetTexture(bool Value)

Sets if this texture is active for the current material This is true by default when a new texture is created.

Parameters

Value – bool