QTextureMaterial Class

class Qt3DExtras ::QTextureMaterial

The QTextureMaterial provides a default implementation of a simple unlit texture material. 更多...

头: #include <QTextureMaterial>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
继承: Qt3DRender::QMaterial

特性

公共函数

QTextureMaterial (Qt3DCore::QNode * parent = nullptr)
virtual ~QTextureMaterial ()
bool isAlphaBlendingEnabled () const
Qt3DRender::QAbstractTexture * texture () const
QVector2D textureOffset () const
QMatrix3x3 textureTransform () const

公共槽

void setAlphaBlendingEnabled (bool enabled )
void setTexture (Qt3DRender::QAbstractTexture * texture )
void setTextureOffset (QVector2D textureOffset )
void setTextureTransform (const QMatrix3x3 & matrix )

信号

void alphaBlendingEnabledChanged (bool enabled )
void textureChanged (Qt3DRender::QAbstractTexture * texture )
void textureOffsetChanged (QVector2D textureOffset )
void textureTransformChanged (const QMatrix3x3 & textureTransform )

详细描述

This material uses an effect with a single render pass approach. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2.

特性文档编制

alphaBlending : bool

Indicates if the alpha information coming from the diffuse property will be taken into account during rendering. Defaults to false.

访问函数:

bool isAlphaBlendingEnabled () const
void setAlphaBlendingEnabled (bool enabled )

通知程序信号:

void alphaBlendingEnabledChanged (bool enabled )

texture : Qt3DRender::QAbstractTexture *

Holds the current texture used by the material.

访问函数:

Qt3DRender::QAbstractTexture * texture () const
void setTexture (Qt3DRender::QAbstractTexture * texture )

通知程序信号:

void textureChanged (Qt3DRender::QAbstractTexture * texture )

textureOffset : QVector2D

This is a utility property. It sets the translation component of the general texture transform matrix

访问函数:

QVector2D textureOffset () const
void setTextureOffset (QVector2D textureOffset )

通知程序信号:

void textureOffsetChanged (QVector2D textureOffset )

textureTransform : QMatrix3x3

Holds the current texture transform. It is applied to texture coordinates at render time. Defaults to identity matrix.

访问函数:

QMatrix3x3 textureTransform () const
void setTextureTransform (const QMatrix3x3 & matrix )

通知程序信号:

void textureTransformChanged (const QMatrix3x3 & textureTransform )

成员函数文档编制

[explicit] QTextureMaterial:: QTextureMaterial ( Qt3DCore::QNode * parent = nullptr)

Constructs a new QTextureMaterial instance with parent object parent .

[virtual noexcept] QTextureMaterial:: ~QTextureMaterial ()

销毁 QTextureMaterial 实例。