| 12345678 |
- import assert from 'node:assert/strict'
- import { Cartesian3, Matrix3, OrientedBoundingBox } from 'cesium'
- const box = new OrientedBoundingBox(new Cartesian3(0, 0, 0), Matrix3.fromArray([10, 0, 0, 0, 20, 0, 0, 0, 2]))
- assert.equal(Math.sqrt(box.distanceSquaredTo(new Cartesian3(0, 0, 0))), 0)
- assert.equal(Math.sqrt(box.distanceSquaredTo(new Cartesian3(30, 0, 0))), 20)
- assert.equal(Math.sqrt(box.distanceSquaredTo(new Cartesian3(0, 30, 0))), 10)
- assert.equal(Math.sqrt(box.distanceSquaredTo(new Cartesian3(0, 0, 7))), 5)
- console.log('T35 OBB distance: 4 cases passed')
|