| 133 | } |
| 134 | |
| 135 | initializeState() { |
| 136 | const attributeManager = this.getAttributeManager()!; |
| 137 | |
| 138 | attributeManager.remove(['instancePickingColors']); |
| 139 | const noAlloc = true; |
| 140 | |
| 141 | attributeManager.add({ |
| 142 | indices: { |
| 143 | size: 1, |
| 144 | isIndexed: true, |
| 145 | update: attribute => (attribute.value = this.state.mesh.indices), |
| 146 | noAlloc |
| 147 | }, |
| 148 | positions: { |
| 149 | size: 3, |
| 150 | type: 'float64', |
| 151 | fp64: this.use64bitPositions(), |
| 152 | update: attribute => (attribute.value = this.state.mesh.positions), |
| 153 | noAlloc |
| 154 | }, |
| 155 | texCoords: { |
| 156 | size: 2, |
| 157 | update: attribute => (attribute.value = this.state.mesh.texCoords), |
| 158 | noAlloc |
| 159 | } |
| 160 | }); |
| 161 | } |
| 162 | |
| 163 | updateState({props, oldProps, changeFlags}: UpdateParameters<this>): void { |
| 164 | // setup model first |