feat: add glTF shape geometry and culling - #100
Draft
ibgreen wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@math.gl/geometrypackage with typed-arrayGeometrystorage, indexed unpacking, and tessellators for the glTF box, capsule, cylinder, plane, and sphere shapesBoxShape,CapsuleShape,CylinderShape,PlaneShape, andSphereShapeanalytic volumes to@math.gl/cullingSemantics and scope
The defaults and coordinate conventions follow the active glTF 2.1 draft at KhronosGroup/glTF@726e078.
The geometry package is CPU-only and uses glTF attribute semantics (
POSITION,NORMAL,TEXCOORD_0); it has no luma.gl/GPU dependency.PlaneGeometryrequires finite dimensions because an infinite surface cannot be tessellated.The culling shapes support point containment/distance, plane and
CullingVolumeclassification, nearest ray hits, invertible affine transforms, AABBs, and conservative bounding spheres.PlaneShapepreserves the glTF negative-Y inside half-space and supports finite, partially infinite, or infinite surface extents. Distance is exact for rigid/uniform transforms and estimated for non-uniform scale or shear. Pairwise shape-vs-shape collision and glTF JSON parsing are intentionally out of scope.Verification
yarn buildyarn lintyarn test node— 3,205 assertions passingyarn --cwd website buildTests cover defaults and validation, tapered/contained capsules, finite and partially infinite planes, point/distance/ray/plane/frustum queries, affine transforms, bounds, 16/32-bit indices, attribute finiteness, winding, and tessellated-mesh parity with analytic shapes.