From 3c0394acf67ce16564b6b46211840d47a856cc72 Mon Sep 17 00:00:00 2001 From: Eray Zesen Date: Wed, 22 Jan 2025 07:01:50 +0300 Subject: [PATCH] Solved ParticleObject problems of QSpringObject --- src/qmesh_node.cpp | 5 +++++ src/qspring_object.h | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qmesh_node.cpp b/src/qmesh_node.cpp index cb1ea6f..ef6446d 100644 --- a/src/qmesh_node.cpp +++ b/src/qmesh_node.cpp @@ -632,6 +632,11 @@ void QMeshNode::on_post_enter_tree() { } for(int i=0;iGetSpringCount();i++ ){ //springs Ref s=memnew( QSpringObject(meshObject->GetSpringAt(i)) ); + Ref pA=get_particle_object_with_particle(meshObject->GetSpringAt(i)->GetParticleA() ); + Ref pB=get_particle_object_with_particle(meshObject->GetSpringAt(i)->GetParticleB() ); + s->pA=pA; + s->pB=pB; + springObjects.push_back(s); } diff --git a/src/qspring_object.h b/src/qspring_object.h index d2f728a..2cf260e 100644 --- a/src/qspring_object.h +++ b/src/qspring_object.h @@ -70,8 +70,6 @@ class QSpringObject: public RefCounted{ return this; } - pA=particle_object_a; - pB=particle_object_b; set_particle_a(particle_object_a); set_particle_b(particle_object_b); @@ -87,8 +85,6 @@ class QSpringObject: public RefCounted{ return Ref(this); } - pA=particle_object_a; - pB=particle_object_b; set_particle_a(particle_object_a); set_particle_b(particle_object_b);