-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Use parameter classes instead of arguments for all physics queries #54573
Conversation
6285ef4
to
fd62ebc
Compare
servers/physics_server_2d.cpp
Outdated
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position"); | ||
ADD_PROPERTY(PropertyInfo(Variant::INT, "canvas_instance_id", PROPERTY_HINT_OBJECT_ID), "set_canvas_instance_id", "get_canvas_instance_id"); | ||
ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_collision_mask", "get_collision_mask"); | ||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "exclude", PROPERTY_HINT_NONE, itos(Variant::RID) + ":"), "set_exclude", "get_exclude"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for info, could you explain to me what does this itos(Variant::RID) + ":"
in the PropertyInfo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks! I had just copied these lines from PhysicsShapeQueryParameters and I have no idea what it's supposed to do :D
It looks like it's the only case in the engine where an Array of a specific type is done this way, so I'm going to change it to the proper syntax, which seems to be PROPERTY_HINT_ARRAY_TYPE, "RID"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(there is the same syntax in the 3D file and 2 occurrences on both files)
fd62ebc
to
dc940a0
Compare
Updated from @fabriceci's comment and made a couple more fixes around |
Same as what is already done for shape queries, applied to point and ray queries. Easier to document and more flexible to add more parameters. Also expose intersect_point method to script in 3D. Remove intersect_point_on_canvas in 2D, replaced with a parameter.
dc940a0
to
acbd24e
Compare
And I've pushed one last fix to add the missing Should be good to go now :) |
Thanks! |
Same as what is already done for shape queries, applied to point and ray queries. Easier to document and more flexible to add more parameters.
Also expose
intersect_point
method to script in 3D.(closes godotengine/godot-proposals#3262 for 4.0)
Remove
intersect_point_on_canvas
in 2D, replaced with a parameter.