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

[3.x] Physics Interpolation: Add support for CPUParticles2D #80176

Merged
merged 1 commit into from
Aug 8, 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
18 changes: 18 additions & 0 deletions scene/2d/canvas_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,24 @@ int CanvasItem::get_light_mask() const {
return light_mask;
}

void CanvasItem::set_canvas_item_use_identity_transform(bool p_enable) {
// Prevent sending item transforms to VisualServer when using global coords.
_set_use_identity_transform(p_enable);

// Let VisualServer know not to concatenate the parent transform during the render.
VisualServer::get_singleton()->canvas_item_set_ignore_parent_transform(get_canvas_item(), p_enable);

if (is_inside_tree()) {
if (p_enable) {
// Make sure item is using identity transform in server.
VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), Transform2D());
} else {
// Make sure item transform is up to date in server if switching identity transform off.
VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), get_transform());
}
}
}

void CanvasItem::item_rect_changed(bool p_size_changed) {
if (p_size_changed) {
update();
Expand Down
1 change: 1 addition & 0 deletions scene/2d/canvas_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class CanvasItem : public Node {
}

void item_rect_changed(bool p_size_changed = true);
void set_canvas_item_use_identity_transform(bool p_enable);

void _notification(int p_what);
static void _bind_methods();
Expand Down
Loading