Description
Describe the bug
The CameraControls component includes several useful methods (e.g., fitToBox, moveTo, etc.), as seen in the source code. However, these methods are not documented in the official documentation, making it difficult for users to discover and utilize them effectively.
Suggested Action
Please update the documentation to:
List all public methods/properties of CameraControls.
Add usage examples for critical methods (e.g., fitToBox, moveTo).
Clarify parameters, return types, and edge-case behaviors.
Example Documentation Addition
markdown
Methods
-
fitToBox(box: Box3, padding?: number, duration?: number)
Frames the camera to fit the specifiedBox3
bounding box.box
: Three.jsBox3
object defining the target area.padding
: Optional margin (default:0.2
).duration
: Animation duration in seconds (default:1
).
-
moveTo(position: Vector3, duration?: number)
Smoothly moves the camera to a new position.position
: TargetVector3
coordinates.duration
: Animation time in seconds (default:1
).
// ... (other methods like rotateTo
, setPosition
, etc.)
Why This Matters
Undocumented features:
Reduce developer productivity (users dig through source code).
Increase the risk of misuse due to unclear parameter expectations.
Limit adoption of otherwise powerful controls.
Thank you for considering this enhancement! 🙏
Reproduction
https://cientos.tresjs.org/guide/controls/camera-controls.html
Steps to reproduce
No response
System Info
Used Package Manager
npm
Code of Conduct
- I agree to follow this project's Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.