-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Physics, Intersection and Editor Plugins #8963
Comments
The
Quite extreme, the physics engine does a lot of tracking of objects moving, intersecting each other, etc. which isn't needed in the editor, but takes a lot of processing I haven't dug into the ways the editor simulates these things without the physics engine but I suspect doing ray casting is much easier than shapes, and might not require some of the backing data structures A lot can be done with just ray-casts, it's how the "snap to floor" method in the editor works for example |
Okay. That's good to know.
Fair enough. Is there a case for an editor-available API for non-moving intersections?
In my use-case I need to know whether a volume (say an AABB) is empty or not. That's why |
Not at the present as far as I know, I'd say if there was it'd be in there The question here for evaluation and investigation is what ways the current system handles this, and what would be needed to add this, for example the use of the BSP system and space processing, this isn't cheap though, and would be largely limited in use, so it's not necessarily worth it generally I will dig into the physics of the editor when I find the time and see how it accomplishes this feature Edit: |
The functions that AThousandShips linked are basically the API to query the visual rendering scenario for its spatial info. E.g. what visuals with a position are inside some convex plane shape, what intersects with a raycast. Not using the physics engine that only has information about physics shapes, but the rendering that only has information about visual geometry and other render objects like lights. With the ids returned those ids can be used with the ObjectDB / GlobalScope.instance_from_id () to get the actual SceneTree object behind that id, e.g. the node. It is not something that should be done at runtime, hence the "Use physics for in-game" hint, because it forces stalls and updates on the RenderingServer. For inside the Editor that performance is not much of a concern as long as you do not fire those functions every single frame like mad. |
Thanks for that info. I will look into it. Perhaps we could add something like what smix8 and AThousandShips just posted to the docs so that other plugin devs don't take the wrong turn into state.intersect_etc. |
I have run into a problem with ETA - new issue here: |
If it's a bug, please open an issue on the main Godot repository. See also godotengine/godot#39197. |
Describe the project you are working on
Advised to open a proposal here by godotengine/godot#87429 (comment)
Hope I did it right (this time!)
Overview
Can we have a conversation about support for "intersect_X" in editor plugins?
For example, in my "Dabber" plugin, I need to send rays down to mesh surfaces to pick points where I will place a transform to go into a multimesh. I need to know where other things are before I place a new thing. In
Related to #7811 I asked about whether Godot has an API for spacial queries (in plugins). I only realized recently that the
state.intersect_shape()
method is pretty much already that; hence my bewilderment at it not working in the editor.Describe the problem or limitation you are having in your project
I wish to use the
intersects
functions in thePhysicsDirectSpaceState3D
class while in a plugin/toolintersect_shape()
which currently does not work.intersect_ray()
which does work but I am now not at all sure it's even supposed to, nor how long it will.Examples of use
What use is terrain if one cannot populate it? The reality is that some physics needs to be accessible from Godot plugins.
Physics is disabled in the editor
Quote from @smix8 at godotengine/godot#87429 (comment)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Replying to some of that quote
@smix8
What if a plugin could have a "Go" button which then:
So it need not be on all the time; only while doing a user-initiated job.
@smix8
Picture this:
Now, please explain how with trig and Geometry3D you can distribute points across all of that such that:
And that's just to start. I do not believe that it's as simple as the quoted. And, if it is, why can that not be wrapped in an API and made available to users of Godot?
Also, what is the difference between this "simple" approach and what Godot physics is already doing?
Paths to progress
Thanks.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I have nothing for this section
If this enhancement will not be used often, can it be worked around with a few lines of script?
It seems not. The Editor seems to be the nub of the problem.
Is there a reason why this should be core and not an add-on in the asset library?
I am not qualified to know.
The text was updated successfully, but these errors were encountered: