InstanceList QML Type
QML에서 인스턴싱을 수동으로 지정할 수 있습니다. 더 보기...
| Import Statement: | import QtQuick3D |
| Inherits: |
속성
- instanceCount : int
(since 6.3) - instances : List<QtQuick3D::InstanceListEntry>
상세 설명
InstanceList 유형을 사용하면 QML에서 인스턴스 테이블을 수동으로 정의할 수 있습니다.
다음 예제는 두 개의 항목으로 구성된 인스턴스 테이블을 생성합니다:
InstanceList {
id: manualInstancing
instances: [
InstanceListEntry {
position: Qt.vector3d(0, 0, -60)
eulerRotation: Qt.vector3d(-10, 0, 30)
color: "red"
},
InstanceListEntry {
position: Qt.vector3d(50, 10, 100)
eulerRotation: Qt.vector3d(0, 180, 0)
color: "green"
}
]
}또한 InstanceList에 자식 요소를 추가하는 것만으로도 instances 속성을 채울 수 있습니다. 다음 예제는 앞의 예제와 동일합니다:
InstanceList {
id: manualInstancing
InstanceListEntry {
position: Qt.vector3d(0, 0, -60)
eulerRotation: Qt.vector3d(-10, 0, 30)
color: "red"
}
InstanceListEntry {
position: Qt.vector3d(50, 10, 100)
eulerRotation: Qt.vector3d(0, 180, 0)
color: "green"
}
}각 ` InstanceListEntry `는 속성 바인딩과 애니메이션을 가질 수 있는 객체입니다. 이는 뛰어난 유연성을 제공하지만, 동시에 메모리 오버헤드를 유발하기도 합니다. 따라서 수천 개(또는 수백만 개)의 인스턴스를 포함하는 절차적으로 생성된 테이블에는 InstanceList를 사용하지 않는 것이 좋습니다. 또한, 항목의 속성이 변경되면 전체 인스턴스 테이블이 재계산되어 GPU로 업로드됩니다.
RandomInstancing 및 QQuick3DInstancing도 참조하십시오 .
속성 문서
instanceCount : int [since 6.3]
이 읽기 전용 속성은 목록에 포함된 인스턴스의 개수를 나타냅니다.
이 속성은 Qt 6.3에서 도입되었습니다.
instances : List<QtQuick3D::InstanceListEntry> [default]
이 속성에는 인스턴스 정의 목록이 포함되어 있습니다. 이 목록이나 그 요소 중 하나를 수정하면 인스턴스 테이블이 업데이트됩니다.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.