Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Better explain bounding volumes. #832

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions types/three/src/core/BufferGeometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,16 @@ export class BufferGeometry<
setFromPoints(points: Vector3[] | Vector2[]): this;

/**
* Computes bounding box of the geometry, updating {@link boundingBox | .boundingBox} attribute.
* @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
* Computes the bounding box of the geometry, and updates the {@link .boundingBox} attribute. The bounding box is
* not computed by the engine; it must be computed by your app. You may need to recompute the bounding box if the
* geometry vertices are modified.
*/
computeBoundingBox(): void;

/**
* Computes bounding sphere of the geometry, updating {@link boundingSphere | .boundingSphere} attribute.
* @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
* Computes the bounding sphere of the geometry, and updates the {@link .boundingSphere} attribute. The engine
* automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling. You
* may need to recompute the bounding sphere if the geometry vertices are modified.
*/
computeBoundingSphere(): void;

Expand Down
10 changes: 6 additions & 4 deletions types/three/src/objects/InstancedMesh.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ export class InstancedMesh<
morphTexture: DataTexture | null;

/**
* Computes bounding box of the all instances, updating {@link boundingBox | .boundingBox} attribute.
* @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
* Computes the bounding box of the instanced mesh, and updates the {@link .boundingBox} attribute. The bounding box
* is not computed by the engine; it must be computed by your app. You may need to recompute the bounding box if an
* instance is transformed via {@link .setMatrixAt()}.
*/
computeBoundingBox(): void;

/**
* Computes bounding sphere of the all instances, updating {@link boundingSphere | .boundingSphere} attribute.
* @remarks bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
* Computes the bounding sphere of the instanced mesh, and updates the {@link .boundingSphere} attribute. The engine
* automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling. You
* may need to recompute the bounding sphere if an instance is transformed via [page:.setMatrixAt]().
*/
computeBoundingSphere(): void;

Expand Down
15 changes: 6 additions & 9 deletions types/three/src/objects/SkinnedMesh.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,16 @@ export class SkinnedMesh<
bind(skeleton: Skeleton, bindMatrix?: Matrix4): void;

/**
* Computes the bounding box, updating {@link boundingBox | .boundingBox} attribute.
* @remarks
* Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`. If an
* instance of SkinnedMesh is animated, this method should be called per frame to compute a correct bounding box.
* Computes the bounding box of the skinned mesh, and updates the {@link .boundingBox} attribute. The bounding box
* is not computed by the engine; it must be computed by your app. If the skinned mesh is animated, the bounding box
* should be recomputed per frame.
*/
computeBoundingBox(): void;

/**
* Computes the bounding sphere, updating {@link boundingSphere | .boundingSphere} attribute.
* @remarks
* Bounding spheres aren't computed by default. They need to be explicitly computed, otherwise they are `null`. If
* an instance of SkinnedMesh is animated, this method should be called per frame to compute a correct bounding
* sphere.
* Computes the bounding sphere of the skinned mesh, and updates the {@link .boundingSphere} attribute. The bounding
* sphere is automatically computed by the engine when it is needed, e.g., for ray casting and view frustum culling.
* If the skinned mesh is animated, the bounding sphere should be recomputed per frame.
*/
computeBoundingSphere(): void;

Expand Down
Loading