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

Feat/API for controlling scene #15

Merged
merged 23 commits into from
Mar 5, 2024

Conversation

hannojg
Copy link
Member

@hannojg hannojg commented Feb 29, 2024

Warning

Based on the following PR which should be merged first

Goal:

To provide an API from JS that can be used to setup the scene and control the transform of the elements.

(Most important) Changes:

  • Camera:

    • Renamed lookAt -> lookAtCameraManipulator Can be used to make camera look at camera manipulator
    • New lookAt function, which can be used to manually control the position, target and up vector of the camera
    • New setLensProjection & setProjection function to Control the lens configuration from JS
      • ⚠️ Note: @mrousavy The user would also need to call this when the surface size changes (as we need to pass the aspect ratio to this function). Lets discuss in a quick meeting how to solve this best
  • Engine:

    • Renamed createDefaultLight -> setIndirectLight, only sets the indirect light from an FilamentBuffer now (decouples the function from setting a default directional light, which can be now configured by the user)
    • New createLightEntity Function to create a light with the configuration you want
    • Exposed transformToUnitCube. Pass an asset and it will transform the asset to fit into a unit cube
    • New setEntityPosition, setEntityRotation and setEntityScale to set or update an entities transform
    • loadAsset now returns a FilamentAsset. The asset can be used for various operations in the scene.

@hannojg hannojg changed the base branch from main to feat/asset-loader February 29, 2024 08:49
@hannojg hannojg changed the title [🚧WIP] Feat/api for maintaining scene Feat/API for controlling scene Feb 29, 2024
@hannojg hannojg mentioned this pull request Feb 29, 2024
@mrousavy mrousavy merged commit 9dde746 into feat/asset-loader Mar 5, 2024
mrousavy added a commit that referenced this pull request Mar 5, 2024
mrousavy added a commit that referenced this pull request Mar 5, 2024
mrousavy added a commit that referenced this pull request Mar 5, 2024
>[!WARNING]
> Based on the following PR which should be merged first
> - #13

**Goal:**

To provide an API from JS that can be used to setup the scene and
control the transform of the elements.

(Most important) **Changes:**

- **Camera:**
- Renamed `lookAt` -> `lookAtCameraManipulator` Can be used to make
camera look at camera manipulator
- New `lookAt` function, which can be used to manually control the
position, target and up vector of the camera
- New `setLensProjection` & `setProjection` function to Control the lens
configuration from JS
- **⚠️ Note:** @mrousavy The user would also need to call this when the
surface size changes (as we need to pass the aspect ratio to this
function). Lets discuss in a quick meeting how to solve this best

- **Engine:**
- Renamed `createDefaultLight` -> `setIndirectLight`, only sets the
indirect light from an FilamentBuffer now (decouples the function from
setting a default directional light, which can be now configured by the
user)
- New `createLightEntity` Function to create a light with the
configuration you want
- Exposed `transformToUnitCube`. Pass an asset and it will transform the
asset to fit into a unit cube
- New `setEntityPosition`, `setEntityRotation` and `setEntityScale` to
set or update an entities transform
- `loadAsset` now returns a `FilamentAsset`. The asset can be used for
various operations in the scene.

---------

Co-authored-by: Marc Rousavy <me@mrousavy.com>
mrousavy added a commit that referenced this pull request Mar 5, 2024
>[!WARNING]
> Based on the following PR which should be merged first
> - #13

**Goal:**

To provide an API from JS that can be used to setup the scene and
control the transform of the elements.

(Most important) **Changes:**

- **Camera:**
- Renamed `lookAt` -> `lookAtCameraManipulator` Can be used to make
camera look at camera manipulator
- New `lookAt` function, which can be used to manually control the
position, target and up vector of the camera
- New `setLensProjection` & `setProjection` function to Control the lens
configuration from JS
- **⚠️ Note:** @mrousavy The user would also need to call this when the
surface size changes (as we need to pass the aspect ratio to this
function). Lets discuss in a quick meeting how to solve this best

- **Engine:**
- Renamed `createDefaultLight` -> `setIndirectLight`, only sets the
indirect light from an FilamentBuffer now (decouples the function from
setting a default directional light, which can be now configured by the
user)
- New `createLightEntity` Function to create a light with the
configuration you want
- Exposed `transformToUnitCube`. Pass an asset and it will transform the
asset to fit into a unit cube
- New `setEntityPosition`, `setEntityRotation` and `setEntityScale` to
set or update an entities transform
- `loadAsset` now returns a `FilamentAsset`. The asset can be used for
various operations in the scene.

---------

---------

Co-authored-by: Hanno J. Gödecke <hanno@margelo.io>
Co-authored-by: Hanno J. Gödecke <die.drei99@yahoo.de>
hannojg pushed a commit that referenced this pull request Jun 19, 2024
hannojg pushed a commit that referenced this pull request Jun 19, 2024
hannojg added a commit that referenced this pull request Jun 19, 2024
>[!WARNING]
> Based on the following PR which should be merged first
> - #13

**Goal:**

To provide an API from JS that can be used to setup the scene and
control the transform of the elements.

(Most important) **Changes:**

- **Camera:**
- Renamed `lookAt` -> `lookAtCameraManipulator` Can be used to make
camera look at camera manipulator
- New `lookAt` function, which can be used to manually control the
position, target and up vector of the camera
- New `setLensProjection` & `setProjection` function to Control the lens
configuration from JS
- **⚠️ Note:** @mrousavy The user would also need to call this when the
surface size changes (as we need to pass the aspect ratio to this
function). Lets discuss in a quick meeting how to solve this best

- **Engine:**
- Renamed `createDefaultLight` -> `setIndirectLight`, only sets the
indirect light from an FilamentBuffer now (decouples the function from
setting a default directional light, which can be now configured by the
user)
- New `createLightEntity` Function to create a light with the
configuration you want
- Exposed `transformToUnitCube`. Pass an asset and it will transform the
asset to fit into a unit cube
- New `setEntityPosition`, `setEntityRotation` and `setEntityScale` to
set or update an entities transform
- `loadAsset` now returns a `FilamentAsset`. The asset can be used for
various operations in the scene.

---------

Co-authored-by: Marc Rousavy <me@mrousavy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants