diff options
Diffstat (limited to 'src/bulletphysics/qrigidbody.cpp')
-rw-r--r-- | src/bulletphysics/qrigidbody.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/bulletphysics/qrigidbody.cpp b/src/bulletphysics/qrigidbody.cpp index 5039acc10..bd6198af4 100644 --- a/src/bulletphysics/qrigidbody.cpp +++ b/src/bulletphysics/qrigidbody.cpp @@ -65,23 +65,18 @@ QRigidBody::QRigidBody(QRigidBodyPrivate &dd, Qt3D::QNode *parent) { } -void QRigidBody::copy(const QNode *ref) +void QRigidBodyPrivate::copy(const QNodePrivate *ref) { - Q_D(QRigidBody); - QComponent::copy(ref); - const QRigidBody *other = qobject_cast<const QRigidBody *>(ref); - if (other != Q_NULLPTR) { - const QRigidBodyPrivate *d_other = other->d_func(); - d->m_mass = d_other->m_mass; - d->m_centerOfMass = d_other->m_centerOfMass; - } + QRigidBodyPrivate::copy(ref); + const QRigidBodyPrivate *other = static_cast<const QRigidBodyPrivate *>(ref); + m_mass = other->m_mass; + m_centerOfMass = other->m_centerOfMass; } -QRigidBody *QRigidBody::doClone(bool isClone) const +QRigidBody *QRigidBody::doClone() const { QRigidBody *clone = new QRigidBody(); - clone->copy(this); - clone->d_func()->m_isClone = isClone; + clone->d_func()->copy(d_func()); return clone; } |