@math.gl/culling
Advanced tools
Comparing version 3.6.3 to 4.0.0-alpha.1
import { Matrix3 } from '@math.gl/core'; | ||
export declare type EigenDecomposition = { | ||
export type EigenDecomposition = { | ||
unitary: Matrix3; | ||
@@ -4,0 +4,0 @@ diagonal: Matrix3; |
@@ -1,2 +0,2 @@ | ||
import { Vector3, Matrix3, Matrix4, Quaternion } from '@math.gl/core'; | ||
import { Vector3, Matrix3, Matrix4, Quaternion, NumericArray } from '@math.gl/core'; | ||
import type { BoundingVolume } from './bounding-volume'; | ||
@@ -18,3 +18,3 @@ import BoundingSphere from './bounding-sphere'; | ||
*/ | ||
constructor(center?: readonly number[], halfAxes?: readonly number[]); | ||
constructor(center?: Readonly<NumericArray>, halfAxes?: Readonly<NumericArray>); | ||
/** Returns an array with three halfSizes for the bounding box */ | ||
@@ -21,0 +21,0 @@ get halfSize(): number[]; |
import { Matrix4, NumericArray, Vector2 } from '@math.gl/core'; | ||
import CullingVolume from './culling-volume'; | ||
declare type PerspectiveFrustumOptions = { | ||
type PerspectiveFrustumOptions = { | ||
/** The angle of the field of view (FOV), in radians. */ | ||
@@ -5,0 +5,0 @@ fov?: number; |
import { Vector2, Matrix4, NumericArray } from '@math.gl/core'; | ||
import CullingVolume from './culling-volume'; | ||
declare type PerspectiveOffCenterFrustumOptions = { | ||
type PerspectiveOffCenterFrustumOptions = { | ||
left?: number; | ||
@@ -5,0 +5,0 @@ right?: number; |
@@ -5,6 +5,7 @@ { | ||
"license": "MIT", | ||
"type": "module", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"version": "3.6.3", | ||
"version": "4.0.0-alpha.1", | ||
"keywords": [ | ||
@@ -31,4 +32,4 @@ "webgl", | ||
"types": "dist/index.d.ts", | ||
"main": "dist/es5/index.js", | ||
"module": "dist/esm/index.js", | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.js", | ||
"files": [ | ||
@@ -40,6 +41,6 @@ "dist", | ||
"@babel/runtime": "^7.12.0", | ||
"@math.gl/core": "3.6.3", | ||
"gl-matrix": "^3.4.0" | ||
"@math.gl/core": "4.0.0-alpha.1", | ||
"gl-matrix": "^3.4.3" | ||
}, | ||
"gitHead": "0efab394df9babad7ed93027c1003f30528b2090" | ||
"gitHead": "66f872ea615a3ef81431595727cdf58dcadf3670" | ||
} |
@@ -20,3 +20,3 @@ // This file is derived from the Cesium math library under Apache 2 license | ||
const fromPointsNaiveCenterScratch = new Vector3(); | ||
const volumeConstant = (4.0 / 3.0) * Math.PI; | ||
// const volumeConstant = (4.0 / 3.0) * Math.PI; | ||
@@ -23,0 +23,0 @@ /** |
@@ -5,3 +5,5 @@ // This file is derived from the Cesium math library under Apache 2 license | ||
import {NumericArray, Vector3} from '@math.gl/core'; | ||
// @ts-ignore gl-matrix typings... | ||
import * as mat4 from 'gl-matrix/mat4'; | ||
import {INTERSECTION} from '../../constants'; | ||
@@ -8,0 +10,0 @@ import {BoundingVolume} from './bounding-volume'; |
@@ -1,2 +0,2 @@ | ||
import {INTERSECTION} from '../../constants'; | ||
// import {INTERSECTION} from '../../constants'; | ||
import Plane from '../plane'; | ||
@@ -3,0 +3,0 @@ |
@@ -44,4 +44,7 @@ // This file is derived from the Cesium math library under Apache 2 license | ||
*/ | ||
constructor(center?: readonly number[], halfAxes?: readonly number[]); | ||
constructor(center: Readonly<NumericArray> = [0, 0, 0], halfAxes = [0, 0, 0, 0, 0, 0, 0, 0, 0]) { | ||
constructor(center?: Readonly<NumericArray>, halfAxes?: Readonly<NumericArray>); | ||
constructor( | ||
center: Readonly<NumericArray> = [0, 0, 0], | ||
halfAxes: Readonly<NumericArray> = [0, 0, 0, 0, 0, 0, 0, 0, 0] | ||
) { | ||
this.center = new Vector3().from(center); | ||
@@ -48,0 +51,0 @@ this.halfAxes = new Matrix3(halfAxes); |
@@ -16,3 +16,3 @@ // This file is derived from the Cesium math library under Apache 2 license | ||
const scratchPlaneNormal = new Vector3(); | ||
const scratchPlane = new Plane(new Vector3(1.0, 0.0, 0.0), 0.0); | ||
// const scratchPlane = new Plane(new Vector3(1.0, 0.0, 0.0), 0.0); | ||
@@ -74,3 +74,3 @@ /** A culling volume defined by planes. */ | ||
const plane0Center = scratchPlaneCenter.copy(faceNormal).scale(-radius).add(center); | ||
const plane0Distance = -faceNormal.dot(plane0Center); | ||
// const plane0Distance = -faceNormal.dot(plane0Center); | ||
@@ -83,3 +83,3 @@ plane0.fromPointNormal(plane0Center, faceNormal); | ||
const plane1Distance = -negatedFaceNormal.dot(plane1Center); | ||
// const plane1Distance = -negatedFaceNormal.dot(plane1Center); | ||
@@ -86,0 +86,0 @@ plane1.fromPointNormal(plane1Center, negatedFaceNormal); |
@@ -12,3 +12,3 @@ // This file is derived from the Cesium math library under Apache 2 license | ||
const defined = (val) => val !== null && typeof val !== 'undefined'; | ||
const defined = (val: unknown) => val !== null && typeof val !== 'undefined'; | ||
@@ -15,0 +15,0 @@ type PerspectiveFrustumOptions = { |
@@ -77,10 +77,10 @@ // This file is derived from the Cesium math library under Apache 2 license | ||
projectPointOntoPlane(point, result = [0, 0, 0]) { | ||
point = scratchPosition.from(point); | ||
projectPointOntoPlane(point: Readonly<NumericArray>, result = [0, 0, 0]) { | ||
const scratchPoint = scratchPosition.from(point); | ||
// projectedPoint = point - (normal.point + scale) * normal | ||
const pointDistance = this.getPointDistance(point); | ||
const pointDistance = this.getPointDistance(scratchPoint); | ||
const scaledNormal = scratchNormal.copy(this.normal).scale(pointDistance); | ||
return point.subtract(scaledNormal).to(result); | ||
return scratchPoint.subtract(scaledNormal).to(result); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
317703
69
4514
2
+ Added@math.gl/core@4.0.0-alpha.1(transitive)
+ Added@math.gl/types@4.0.0-alpha.1(transitive)
- Removed@math.gl/core@3.6.3(transitive)
- Removed@math.gl/types@3.6.3(transitive)
Updated@math.gl/core@4.0.0-alpha.1
Updatedgl-matrix@^3.4.3