(plane, transform, result)
| 313 | const scratchTransformedNormal = new Cartesian3(); |
| 314 | |
| 315 | function transformPlane(plane, transform, result) { |
| 316 | //>>includeStart('debug', pragmas.debug); |
| 317 | Check.typeOf.object("plane", plane); |
| 318 | Check.typeOf.object("transform", transform); |
| 319 | //>>includeEnd('debug'); |
| 320 | |
| 321 | const { normal, distance } = plane; |
| 322 | const planeAsCartesian4 = Cartesian4.fromElements( |
| 323 | normal.x, |
| 324 | normal.y, |
| 325 | normal.z, |
| 326 | distance, |
| 327 | scratchPlaneCartesian4, |
| 328 | ); |
| 329 | let transformedPlane = Matrix4.multiplyByVector( |
| 330 | transform, |
| 331 | planeAsCartesian4, |
| 332 | scratchPlaneCartesian4, |
| 333 | ); |
| 334 | |
| 335 | // Convert the transformed plane to Hessian Normal Form |
| 336 | const transformedNormal = Cartesian3.fromCartesian4( |
| 337 | transformedPlane, |
| 338 | scratchTransformedNormal, |
| 339 | ); |
| 340 | transformedPlane = Cartesian4.divideByScalar( |
| 341 | transformedPlane, |
| 342 | Cartesian3.magnitude(transformedNormal), |
| 343 | scratchPlaneCartesian4, |
| 344 | ); |
| 345 | |
| 346 | return Plane.fromCartesian4(transformedPlane, result); |
| 347 | } |
| 348 | |
| 349 | function computeTextureResolution(pixelsNeeded, result) { |
| 350 | result.x = Math.min(pixelsNeeded, ContextLimits.maximumTextureSize); |
no test coverage detected
searching dependent graphs…