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

Helper lines #146

Merged
merged 29 commits into from
Apr 24, 2023
Merged

Helper lines #146

merged 29 commits into from
Apr 24, 2023

Conversation

Dgzt
Copy link
Collaborator

@Dgzt Dgzt commented Apr 8, 2023

I've created helper line option into editor.

It can be enabled in the Debug render options dialog:
image

Rectangle helper lines:
image

Hexagon helper lines:
image

If the user change the map with a tool it will affect the helper lines also.

@Dgzt Dgzt requested a review from JamesTKhan April 8, 2023 16:24
@Dgzt Dgzt added the enhancement New feature or request label Apr 8, 2023
@Dgzt
Copy link
Collaborator Author

Dgzt commented Apr 8, 2023

I want to migrate my tiled based map into mundus based map and I think it is useful feature.

@Dgzt
Copy link
Collaborator Author

Dgzt commented Apr 13, 2023

Renamed HelperLineObject to HelperLineShape. Maybe it is better name.

@Dgzt
Copy link
Collaborator Author

Dgzt commented Apr 15, 2023

I've found that the not full hexagons not visible correctly at end of map. I've fixed it.

Before fix:
image

After fix:
image

@JamesTKhan
Copy link
Owner

Looks like you put alot into this one, it looks neat in the editor. How do you use this for your game though? Just as a visual aid to help place items on the terrain? Just trying to understand its function.

Side note: I do not see the wireframe shader any more when clicking on the terrain on this branch. Does this replace that?

@Dgzt
Copy link
Collaborator Author

Dgzt commented Apr 19, 2023

Looks like you put alot into this one, it looks neat in the editor. How do you use this for your game though? Just as a visual aid to help place items on the terrain? Just trying to understand its function.

It is just a visual aid to help in Editor to create hill, mountain, city, river and/or forest in a rectangle/hexagon tile. Like in Panzer Corps game just in 3D.

I'm developing a game what currently uses Tiled based 2D hexagon map and I'm migrating to Mundus based 3D map. While I'm creating mountains, hills, cities, etc on the map I must to know where are "tiles" on the map, where are end of tiles, because a tile contains only mountain or city or hill or something else.

I've already implemented that to show where is the mouse on the map, on which tile. It is visible next to the camera position on status bar:
pos
But this PR is too big and I want to put another PR after this merged.

Side note: I do not see the wireframe shader any more when clicking on the terrain on this branch. Does this replace that?

No, this branch was not up-to-date and didn't contain this fix. I updated with the latest master and now the wireframe shader works.

@antzGames
Copy link
Collaborator

Sorry for the late input, but would it be a lot of work to draw the NORMAL vector for both rectangle and hex modes?

The normal vector can get retrieved from the existing getNormalAtWordCoordinate() in the Terrain class. It is just a matter of drawing it. If it is too late I can wait till the PR is merged and then add it later.

@Dgzt
Copy link
Collaborator Author

Dgzt commented Apr 22, 2023

Sorry for the late input, but would it be a lot of work to draw the NORMAL vector for both rectangle and hex modes?

The normal vector can get retrieved from the existing getNormalAtWordCoordinate() in the Terrain class. It is just a matter of drawing it. If it is too late I can wait till the PR is merged and then add it later.

Sorry, but it is not clear for me how can I use normal vectors in this case when the width can be 2 or more.

@antzGames
Copy link
Collaborator

So usually the normal is drawn at the center of the cube/rectangle/triangle of the terrain mesh. Ignore this request as I can try to implement after this PR is merged.

image

Copy link
Owner

@JamesTKhan JamesTKhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how useful this will be for most users but since it's only affecting the editor for debug drawing I approve it.

@JamesTKhan JamesTKhan merged commit 6956e4d into JamesTKhan:master Apr 24, 2023
@Dgzt Dgzt deleted the helper-lines branch April 24, 2023 13:56
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.

3 participants