From 4516de6dc2b7a2f1439a876b9f6f0daf05deb7a6 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 24 Feb 2022 17:22:29 -0800 Subject: [PATCH 1/2] check null comp Signed-off-by: Ian Chen --- src/systems/lift_drag/LiftDrag.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/systems/lift_drag/LiftDrag.cc b/src/systems/lift_drag/LiftDrag.cc index 841858cc55..d40b99fb01 100644 --- a/src/systems/lift_drag/LiftDrag.cc +++ b/src/systems/lift_drag/LiftDrag.cc @@ -266,6 +266,9 @@ void LiftDragPrivate::Update(EntityComponentManager &_ecm) _ecm.Component(this->controlJointEntity); } + if (!controlJointPosition) + return; + if (!worldLinVel || !worldAngVel || !worldPose) return; From a0e3b89bd78a497ca30873cdee234674d9a33adf Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 24 Feb 2022 17:40:30 -0800 Subject: [PATCH 2/2] better fix Signed-off-by: Ian Chen --- src/systems/lift_drag/LiftDrag.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/systems/lift_drag/LiftDrag.cc b/src/systems/lift_drag/LiftDrag.cc index d40b99fb01..d809f2292c 100644 --- a/src/systems/lift_drag/LiftDrag.cc +++ b/src/systems/lift_drag/LiftDrag.cc @@ -266,9 +266,6 @@ void LiftDragPrivate::Update(EntityComponentManager &_ecm) _ecm.Component(this->controlJointEntity); } - if (!controlJointPosition) - return; - if (!worldLinVel || !worldAngVel || !worldPose) return; @@ -385,7 +382,7 @@ void LiftDragPrivate::Update(EntityComponentManager &_ecm) cl = this->cla * alpha * cosSweepAngle; // modify cl per control joint value - if (controlJointPosition) + if (controlJointPosition && !controlJointPosition->Data().empty()) { cl = cl + this->controlJointRadToCL * controlJointPosition->Data()[0]; /// \todo(anyone): also change cm and cd