Physics Interpolation 2D - change transform API to use const ref

This commit is contained in:
lawnjelly 2024-03-16 16:50:47 +00:00 committed by Relintai
parent 85146c2646
commit bb9cd55575
5 changed files with 15 additions and 15 deletions

View File

@ -1676,7 +1676,7 @@ void RenderingServerCanvas::canvas_item_set_skeleton_relative_xform(RID p_item,
}
// Useful especially for origin shifting.
void RenderingServerCanvas::canvas_item_transform_physics_interpolation(RID p_item, Transform2D p_transform) {
void RenderingServerCanvas::canvas_item_transform_physics_interpolation(RID p_item, const Transform2D &p_transform) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
canvas_item->xform_prev = p_transform * canvas_item->xform_prev;
@ -1707,7 +1707,7 @@ void RenderingServerCanvas::canvas_light_reset_physics_interpolation(RID p_light
clight->xform_prev = clight->xform_curr;
}
void RenderingServerCanvas::canvas_light_transform_physics_interpolation(RID p_light, Transform2D p_transform) {
void RenderingServerCanvas::canvas_light_transform_physics_interpolation(RID p_light, const Transform2D &p_transform) {
RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light);
ERR_FAIL_COND(!clight);
clight->xform_prev = p_transform * clight->xform_prev;
@ -1726,7 +1726,7 @@ void RenderingServerCanvas::canvas_light_occluder_reset_physics_interpolation(RI
occluder->xform_prev = occluder->xform_curr;
}
void RenderingServerCanvas::canvas_light_occluder_transform_physics_interpolation(RID p_occluder, Transform2D p_transform) {
void RenderingServerCanvas::canvas_light_occluder_transform_physics_interpolation(RID p_occluder, const Transform2D &p_transform) {
RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder);
ERR_FAIL_COND(!occluder);
occluder->xform_prev = p_transform * occluder->xform_prev;

View File

@ -268,7 +268,7 @@ public:
void canvas_item_set_interpolated(RID p_item, bool p_interpolated);
void canvas_item_reset_physics_interpolation(RID p_item);
void canvas_item_transform_physics_interpolation(RID p_item, Transform2D p_transform);
void canvas_item_transform_physics_interpolation(RID p_item, const Transform2D &p_transform);
void _canvas_item_invalidate_local_bound(RID p_item);
void _canvas_item_remove_references(RID p_item, RID p_rid);
@ -297,7 +297,7 @@ public:
void canvas_light_set_interpolated(RID p_light, bool p_interpolated);
void canvas_light_reset_physics_interpolation(RID p_light);
void canvas_light_transform_physics_interpolation(RID p_light, Transform2D p_transform);
void canvas_light_transform_physics_interpolation(RID p_light, const Transform2D &p_transform);
RID canvas_light_occluder_create();
void canvas_light_occluder_attach_to_canvas(RID p_occluder, RID p_canvas);
@ -308,7 +308,7 @@ public:
void canvas_light_occluder_set_interpolated(RID p_occluder, bool p_interpolated);
void canvas_light_occluder_reset_physics_interpolation(RID p_occluder);
void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, Transform2D p_transform);
void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, const Transform2D &p_transform);
RID canvas_occluder_polygon_create();
void canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const PoolVector<Vector2> &p_shape, bool p_closed);

View File

@ -632,7 +632,7 @@ public:
BIND2(canvas_item_set_interpolated, RID, bool)
BIND1(canvas_item_reset_physics_interpolation, RID)
BIND2(canvas_item_transform_physics_interpolation, RID, Transform2D)
BIND2(canvas_item_transform_physics_interpolation, RID, const Transform2D &)
BIND0R(RID, canvas_light_create)
BIND2(canvas_light_attach_to_canvas, RID, RID)
@ -660,7 +660,7 @@ public:
BIND2(canvas_light_set_interpolated, RID, bool)
BIND1(canvas_light_reset_physics_interpolation, RID)
BIND2(canvas_light_transform_physics_interpolation, RID, Transform2D)
BIND2(canvas_light_transform_physics_interpolation, RID, const Transform2D &)
BIND0R(RID, canvas_light_occluder_create)
BIND2(canvas_light_occluder_attach_to_canvas, RID, RID)
@ -671,7 +671,7 @@ public:
BIND2(canvas_light_occluder_set_interpolated, RID, bool)
BIND1(canvas_light_occluder_reset_physics_interpolation, RID)
BIND2(canvas_light_occluder_transform_physics_interpolation, RID, Transform2D)
BIND2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &)
BIND0R(RID, canvas_occluder_polygon_create)
BIND3(canvas_occluder_polygon_set_shape, RID, const PoolVector<Vector2> &, bool)

View File

@ -539,7 +539,7 @@ public:
FUNC2(canvas_item_set_interpolated, RID, bool)
FUNC1(canvas_item_reset_physics_interpolation, RID)
FUNC2(canvas_item_transform_physics_interpolation, RID, Transform2D)
FUNC2(canvas_item_transform_physics_interpolation, RID, const Transform2D &)
FUNC0R(RID, canvas_light_create)
FUNC2(canvas_light_attach_to_canvas, RID, RID)
@ -567,7 +567,7 @@ public:
FUNC2(canvas_light_set_interpolated, RID, bool)
FUNC1(canvas_light_reset_physics_interpolation, RID)
FUNC2(canvas_light_transform_physics_interpolation, RID, Transform2D)
FUNC2(canvas_light_transform_physics_interpolation, RID, const Transform2D &)
FUNCRID(canvas_light_occluder)
FUNC2(canvas_light_occluder_attach_to_canvas, RID, RID)
@ -578,7 +578,7 @@ public:
FUNC2(canvas_light_occluder_set_interpolated, RID, bool)
FUNC1(canvas_light_occluder_reset_physics_interpolation, RID)
FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, Transform2D)
FUNC2(canvas_light_occluder_transform_physics_interpolation, RID, const Transform2D &)
FUNCRID(canvas_occluder_polygon)
FUNC3(canvas_occluder_polygon_set_shape, RID, const PoolVector<Vector2> &, bool)

View File

@ -972,7 +972,7 @@ public:
virtual void canvas_item_set_interpolated(RID p_item, bool p_interpolated) = 0;
virtual void canvas_item_reset_physics_interpolation(RID p_item) = 0;
virtual void canvas_item_transform_physics_interpolation(RID p_item, Transform2D p_transform) = 0;
virtual void canvas_item_transform_physics_interpolation(RID p_item, const Transform2D &p_transform) = 0;
virtual RID canvas_light_create() = 0;
virtual void canvas_light_attach_to_canvas(RID p_light, RID p_canvas) = 0;
@ -991,7 +991,7 @@ public:
virtual void canvas_light_set_interpolated(RID p_light, bool p_interpolated) = 0;
virtual void canvas_light_reset_physics_interpolation(RID p_light) = 0;
virtual void canvas_light_transform_physics_interpolation(RID p_light, Transform2D p_transform) = 0;
virtual void canvas_light_transform_physics_interpolation(RID p_light, const Transform2D &p_transform) = 0;
enum CanvasLightMode {
CANVAS_LIGHT_MODE_ADD,
@ -1027,7 +1027,7 @@ public:
virtual void canvas_light_occluder_set_interpolated(RID p_occluder, bool p_interpolated) = 0;
virtual void canvas_light_occluder_reset_physics_interpolation(RID p_occluder) = 0;
virtual void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, Transform2D p_transform) = 0;
virtual void canvas_light_occluder_transform_physics_interpolation(RID p_occluder, const Transform2D &p_transform) = 0;
virtual RID canvas_occluder_polygon_create() = 0;
virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const PoolVector<Vector2> &p_shape, bool p_closed) = 0;