------------------------------------------------------------------------------
| 235 | |
| 236 | //------------------------------------------------------------------------------ |
| 237 | bool vtkWebGPUActor::UpdateKeyMatrices() |
| 238 | { |
| 239 | auto& internals = (*this->Internals); |
| 240 | vtkMTimeType rwTime = 0; |
| 241 | if (this->CoordinateSystem != WORLD && this->CoordinateSystemRenderer) |
| 242 | { |
| 243 | rwTime = this->CoordinateSystemRenderer->GetVTKWindow()->GetMTime(); |
| 244 | } |
| 245 | |
| 246 | // has the actor changed or is in device coords? |
| 247 | if (this->GetMTime() > internals.ModelTransformsLastUpdated || |
| 248 | rwTime > internals.ModelTransformsLastUpdated || this->CoordinateSystem == DEVICE) |
| 249 | { |
| 250 | this->GetModelToWorldMatrix(internals.MCWCMatrix); |
| 251 | |
| 252 | internals.MCWCMatrix->Transpose(); |
| 253 | |
| 254 | if (this->GetIsIdentity()) |
| 255 | { |
| 256 | internals.NormalMatrix->Identity(); |
| 257 | } |
| 258 | else |
| 259 | { |
| 260 | internals.NormalTransform->SetMatrix(this->Matrix); |
| 261 | vtkMatrix4x4* mat4 = internals.NormalTransform->GetMatrix(); |
| 262 | for (int i = 0; i < 3; ++i) |
| 263 | { |
| 264 | for (int j = 0; j < 3; ++j) |
| 265 | { |
| 266 | internals.NormalMatrix->SetElement(i, j, mat4->GetElement(i, j)); |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | internals.NormalMatrix->Invert(); |
| 271 | internals.ModelTransformsLastUpdated.Modified(); |
| 272 | return true; |
| 273 | } |
| 274 | return false; |
| 275 | } |
| 276 | |
| 277 | //------------------------------------------------------------------------------ |
| 278 | const void* vtkWebGPUActor::GetCachedActorInformation() |
no test coverage detected