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에 자식을 추가하여 인스턴스 속성을 채울 수도 있습니다. 다음 예제는 이전 예제와 동일합니다:
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 |
이 읽기 전용 프로퍼티에는 목록에 있는 인스턴스 수가 포함됩니다.
이 프로퍼티는 Qt 6.3에 도입되었습니다.
instances : List<QtQuick3D::InstanceListEntry> |
이 프로퍼티에는 인스턴스 정의 목록이 포함됩니다. 이 목록 또는 그 요소를 수정하면 인스턴스 테이블이 업데이트됩니다.
© 2025 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.