-
-
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
Add support for hullcasting #72
Comments
Please check if https://docs.godotengine.org/en/3.1/classes/class_physicsdirectspacestate.html#class-physicsdirectspacestate-method-cast-motion this does what you want? Edited: |
Good trick, I used to use an Area2D, and then was disappointed with how it was impossible to tell the relative position where the contact occurred, and went back to using a ton of raycasting. @fire: how exactly is that used? Can I assign any shape or does it need to be the shape of the body's collider, for instance? |
Nice to know those exist. I suppose my request would be that this is adapted to function similarly to a RayCast node. |
So to clarify, what would you expect from a hullcasting? Also could the proposal be renamed to shape casting perhaps? That's where I misunderstood the initial proposal. Unity seems to have dedicated individual classes for elementary shapes like |
IIRC hullcasting and shape casting are the same. |
I've managed to implement node-based shape casting in 2D. Editor viewInspectorAPIDescription / Proposed implementationThe implementation is based on
Contributing considerations
|
I have created my own proposal regarding this, because I have some specific implementation details which might be worth discussing separately: #710. |
I would recommend just renaming the raycast nodes to shapecast and then allowing them to take a shape or ray (ray possibly being a shape type?) if this gets added it would make rays able to be drawn. |
Note that RayShape and RayCast are different, the former is used as separation shape rather, created proposal for renaming: #711.
See my response there godotengine/godot#6750 (comment). |
This was implemented by godotengine/godot#54803 and godotengine/godot#63161, closing. |
Describe the project you are working on:
I'm working on a simple C# game that makes use of RayCast2D a lot.
Describe how this feature / enhancement will help your project:
Currently i'm simply using a hacky solution of using multiple raycasts to simulate a hullcast.
I can see a hullcast feature being very useful in other ways. If you can assign the hull any shape, you could do sphere hullcasts, capsule hullcasts, etc.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Not really needed. Similar to how RayCast and RayCast2D exist, there would be HullCast and HullCast2D nodes.
Describe implementation detail for your proposal (in code), if possible:
A hullcast object really only needs to know how far to cast, and what shape to cast from start point to end point. Maybe have a nice preview in the editor to make it easier to visualize how the hullcast will work.
Is there a reason why this should be core and not an add-on in the asset library?:
In general i think this sort of thing should be part of the core feature set. It has applications in many different game settings.
The text was updated successfully, but these errors were encountered: