MCPcopy
hub / github.com/CesiumGS/cesium / transformPlane

Function transformPlane

packages/engine/Source/Scene/VoxelBoundsCollection.js:315–347  ·  view source on GitHub ↗
(plane, transform, result)

Source from the content-addressed store, hash-verified

313const scratchTransformedNormal = new Cartesian3();
314
315function 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
349function computeTextureResolution(pixelsNeeded, result) {
350 result.x = Math.min(pixelsNeeded, ContextLimits.maximumTextureSize);

Callers 1

transformAndPackPlanesFunction · 0.85

Calls 6

objectMethod · 0.80
fromCartesian4Method · 0.80
fromElementsMethod · 0.45
multiplyByVectorMethod · 0.45
divideByScalarMethod · 0.45
magnitudeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…