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

Moved face_index field in 3D RayResult to end of struct #82403

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions misc/extension_api_validation/4.1-stable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,10 @@ GH-80410
Validate extension JSON: Error: Field 'classes/RichTextLabel/methods/add_image/arguments': size changed value in new API, from 6 to 10.

Added optional argument. Compatibility method registered.


GH-82403
--------
Validate extension JSON: Error: Field 'native_structures/PhysicsServer3DExtensionRayResult': format changed value in new API, from "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object *collider;int shape" to "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object *collider;int shape;int face_index".

Added/moved face_index field (introduced in GH-71233) to end of struct. Should still be compatible with 4.1.
2 changes: 1 addition & 1 deletion servers/physics_server_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ class PhysicsDirectSpaceState3D : public Object {
struct RayResult {
Vector3 position;
Vector3 normal;
int face_index = -1;
RID rid;
ObjectID collider_id;
Object *collider = nullptr;
int shape = 0;
int face_index = -1;
};

virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) = 0;
Expand Down
2 changes: 1 addition & 1 deletion servers/register_server_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void register_server_types() {
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState3DExtension)
GDREGISTER_VIRTUAL_CLASS(PhysicsServer3DRenderingServerHandler)

GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionRayResult, "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object *collider;int shape");
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionRayResult, "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object *collider;int shape;int face_index");
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeResult, "RID rid;ObjectID collider_id;Object *collider;int shape");
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeRestInfo, "Vector3 point;Vector3 normal;RID rid;ObjectID collider_id;int shape;Vector3 linear_velocity");
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionCollision, "Vector3 position;Vector3 normal;Vector3 collider_velocity;Vector3 collider_angular_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape");
Expand Down
Loading