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

Terrain objects #280

Draft
wants to merge 56 commits into
base: terrain_chunks
Choose a base branch
from
Draft

Terrain objects #280

wants to merge 56 commits into from

Conversation

Dgzt
Copy link
Collaborator

@Dgzt Dgzt commented Nov 25, 2023

This is a long running PR.

This feature will allow to add objects (like trees, rocks, etc) to Terrain with brush tool.

UI:
1

2

3

Structure:
This feature will add 2 new asset type:

  • Terrain Object Layer - This contains the objects list
  • Terrain Objects - This contains the positions, scale, rotation and object id (from Terrain Object Layer) parameters

For backward compatibility Mundus Editor at startup checks every terrain that contains these new asset. If not then the Editor creates a Terrain Object Layer asset for all Terrain and a Terrain Objects asset for each Terrain.

Examples:

Terrain Object Layer ( .terraobjectlayer )

[
  "05847be2bd2e48ec8790e45e0ecfcb63",
  ...
]

List of model asset IDs.

Terrain Objects ( .terraobjects )

[
  {
     "id": "15847be2bd2e48ec8790e45e0ecfcb64",
     "layerPos": 0,
     "position": {
         "x": 250.34,
         "y": 23.12,
         "z": 654.32
      },
      "rotation": {
         "x": 0,
         "y": 10.0,
         "z": 0
      },
      "scale": {
         "x": 1.0,
         "y": 1.0,
         "z": 1.0
      }
  },
  ...
]
  • id: The ID of terrain object
  • layerPos: The model position in Terrain Object Layer
  • position: The position on terrain chunk
  • rotation: The rotation values on x,y and z coordinates
  • scale: The scale values on x,y and z coordinates

TODO list:

  • Terrain Object Layer and Terrain Objects assets create at startup for already terrains
  • Terrain Object Layer and Terrain Objects assets create at new Terrain creation
  • New object adding to Terrain Object Layer
  • Object removing from Terrain Object Layer
  • Object changing in Terrain object Layer
  • Change Terrain Object Layer on Object tab on Terrain
  • Duplicate Terrain Object Layer on Object tab on Terrain
  • Undo/Redo for objects
    • Undo/Redo for added/removed terrain objects
    • Undo/Redo for modified terrain
  • Adding object to Terrain via new brush tool
  • Removing object from Terrain via new brush tool
  • Rendering terrain objects
  • Updating terrain objects position at terrain modifying
  • Updating terrain objects position at terrain moving/scaling/rotating
  • Saving 2 new assets at project saving
  • Loading 2 new assets at project loading
  • Use ModelCache to render terrain objects
  • Use model thumbnail in model grid view
  • Instanced rendering (WIP: Instanced rendering Dgzt/Mundus#1 )
  • Test on HTML

This feature based on terrain system (terrain chunks) branch.

@Dgzt Dgzt added the enhancement New feature or request label Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant