tres icon indicating copy to clipboard operation
tres copied to clipboard

Hope to provide complete documentation for CameraControls component

Open daLeiStrive opened this issue 6 months ago • 0 comments

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 specified Box3 bounding box.

    • box: Three.js Box3 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: Target Vector3 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

daLeiStrive avatar Jul 11 '25 07:07 daLeiStrive