8000 Hope to provide complete documentation for CameraControls component · Issue #633 · Tresjs/cientos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Hope to provide complete documentation for CameraControls component #633
Open
@daLeiStrive

Description

@daLeiStrive

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0