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

Ability to convert a CollisionShape2D's visual representation to an OccluderPolygon2D #564

Open
Tracked by #15
Bluenix2 opened this issue Mar 6, 2020 · 2 comments

Comments

@Bluenix2
Copy link

Bluenix2 commented Mar 6, 2020

Describe the project you are working on:
A simple arcade game. It uses light and collisionshapes.

Describe the problem or limitation you are having in your project:
Currently, it's hard to make a circle or other polygon with a OccluderPolygon2d

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
I think either a setting to use the collisionshape of the parent node as a lightoccluder, or you can in the drop-down let users specify an already existing collisionshape (sibling-nodes)

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
So far it doesn't make sense to have any code or any API for it.
image
In the red circle another option "From CollisionShape2d". There you can later specify a collision shape out of all the sibling nodes.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
There is currently no way that this could be recreated in a simple manor.

Is there a reason why this should be core and not an add-on in the asset library?:
This could be such a broadly used feature. And very convenient for most cases when working with lightning.

@Calinou
Copy link
Member

Calinou commented Mar 7, 2020

Related to godotengine/godot#6750.

Note that CollisionShape2Ds may be more precise than their visual representation suggests. Therefore, their visual representation would have to be used as a base for the LightOccluder2D as it needs to have a finite amount of polygons.

@Bluenix2
Copy link
Author

Bluenix2 commented Mar 7, 2020

Yes, the visual representation was what i had in mind and it would not be a problem since a LightOccluder2D doesn't need to be as precise as a CollisionShape2D needs to be.

@Calinou Calinou changed the title Specify OccluderPolygon2d from CollisionShape2d Ability to convert a CollisionShape2D's visual representation to an OccluderPolygon2D Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants