Use RequiredParam/RequiredResult in some high value places

This commit is contained in:
David Snopek
2025-11-27 13:09:16 -06:00
parent 3a97723ff2
commit fc92ce3e7f
79 changed files with 372 additions and 321 deletions

View File

@@ -244,7 +244,7 @@ Vector3 GodotPhysicsDirectBodyState3D::get_contact_collider_velocity_at_position
return body->contacts[p_contact_idx].collider_velocity_at_pos;
}
PhysicsDirectSpaceState3D *GodotPhysicsDirectBodyState3D::get_space_state() {
RequiredResult<PhysicsDirectSpaceState3D> GodotPhysicsDirectBodyState3D::get_space_state() {
return body->get_space()->get_direct_state();
}

View File

@@ -104,7 +104,7 @@ public:
virtual int get_contact_collider_shape(int p_contact_idx) const override;
virtual Vector3 get_contact_collider_velocity_at_position(int p_contact_idx) const override;
virtual PhysicsDirectSpaceState3D *get_space_state() override;
virtual RequiredResult<PhysicsDirectSpaceState3D> get_space_state() override;
virtual real_t get_step() const override;
};

View File

@@ -976,9 +976,10 @@ RID GodotPhysicsServer3D::soft_body_create() {
return rid;
}
void GodotPhysicsServer3D::soft_body_update_rendering_server(RID p_body, PhysicsServer3DRenderingServerHandler *p_rendering_server_handler) {
void GodotPhysicsServer3D::soft_body_update_rendering_server(RID p_body, RequiredParam<PhysicsServer3DRenderingServerHandler> rp_rendering_server_handler) {
GodotSoftBody3D *soft_body = soft_body_owner.get_or_null(p_body);
ERR_FAIL_NULL(soft_body);
EXTRACT_PARAM_OR_FAIL(p_rendering_server_handler, rp_rendering_server_handler);
soft_body->update_rendering_server(p_rendering_server_handler);
}

View File

@@ -263,7 +263,7 @@ public:
virtual RID soft_body_create() override;
virtual void soft_body_update_rendering_server(RID p_body, PhysicsServer3DRenderingServerHandler *p_rendering_server_handler) override;
virtual void soft_body_update_rendering_server(RID p_body, RequiredParam<PhysicsServer3DRenderingServerHandler> p_rendering_server_handler) override;
virtual void soft_body_set_space(RID p_body, RID p_space) override;
virtual RID soft_body_get_space(RID p_body) const override;