diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-13 11:37:37 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-13 12:37:45 +0100 |
commit | 54ac8eaba661a599983ae4774113d1a15cfa461a (patch) | |
tree | 6f302875ff4008d0f4a51a91fea59933a2a73eea /modules/bullet | |
parent | f1ac2920847eafb7e89a27dcb98ecd4ee68b9750 (diff) |
Remove more deprecated methods and code
Diffstat (limited to 'modules/bullet')
-rw-r--r-- | modules/bullet/cone_twist_joint_bullet.cpp | 10 | ||||
-rw-r--r-- | modules/bullet/generic_6dof_joint_bullet.cpp | 22 | ||||
-rw-r--r-- | modules/bullet/hinge_joint_bullet.cpp | 15 | ||||
-rw-r--r-- | modules/bullet/pin_joint_bullet.cpp | 5 |
4 files changed, 32 insertions, 20 deletions
diff --git a/modules/bullet/cone_twist_joint_bullet.cpp b/modules/bullet/cone_twist_joint_bullet.cpp index afeafcc356..23eb39fe7e 100644 --- a/modules/bullet/cone_twist_joint_bullet.cpp +++ b/modules/bullet/cone_twist_joint_bullet.cpp @@ -82,8 +82,8 @@ void ConeTwistJointBullet::set_param(PhysicsServer::ConeTwistJointParam p_param, case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: coneConstraint->setLimit(coneConstraint->getSwingSpan1(), coneConstraint->getSwingSpan2(), coneConstraint->getTwistSpan(), coneConstraint->getLimitSoftness(), coneConstraint->getBiasFactor(), p_value); break; - default: - WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::CONE_TWIST_MAX: + // Internal size value, nothing to do. break; } } @@ -100,8 +100,10 @@ real_t ConeTwistJointBullet::get_param(PhysicsServer::ConeTwistJointParam p_para return coneConstraint->getLimitSoftness(); case PhysicsServer::CONE_TWIST_JOINT_RELAXATION: return coneConstraint->getRelaxationFactor(); - default: - WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::CONE_TWIST_MAX: + // Internal size value, nothing to do. return 0; } + // Compiler doesn't seem to notice that all code paths are fulfilled... + return 0; } diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp index 86bedd6c45..45ab3d3bb2 100644 --- a/modules/bullet/generic_6dof_joint_bullet.cpp +++ b/modules/bullet/generic_6dof_joint_bullet.cpp @@ -173,6 +173,9 @@ void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer::G6DO case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint = p_value; break; + case PhysicsServer::G6DOF_JOINT_MAX: + // Internal size value, nothing to do. + break; default: WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); break; @@ -214,6 +217,9 @@ real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer::G6 return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_springDamping; case PhysicsServer::G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT: return sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_equilibriumPoint; + case PhysicsServer::G6DOF_JOINT_MAX: + // Internal size value, nothing to do. + return 0; default: WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); return 0; @@ -240,20 +246,20 @@ void Generic6DOFJointBullet::set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOF sixDOFConstraint->setLimit(p_axis + 3, 0, -1); // Free } break; + case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: + sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableSpring = p_value; + break; + case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: + sixDOFConstraint->getTranslationalLimitMotor()->m_enableSpring[p_axis] = p_value; + break; case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR: sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableMotor = flags[p_axis][p_flag]; break; case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: sixDOFConstraint->getTranslationalLimitMotor()->m_enableMotor[p_axis] = flags[p_axis][p_flag]; break; - case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING: - sixDOFConstraint->getTranslationalLimitMotor()->m_enableSpring[p_axis] = p_value; - break; - case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING: - sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableSpring = p_value; - break; - default: - WARN_DEPRECATED_MSG("The flag " + itos(p_flag) + " is deprecated."); + case PhysicsServer::G6DOF_JOINT_FLAG_MAX: + // Internal size value, nothing to do. break; } } diff --git a/modules/bullet/hinge_joint_bullet.cpp b/modules/bullet/hinge_joint_bullet.cpp index 49e67bfbc1..970732688a 100644 --- a/modules/bullet/hinge_joint_bullet.cpp +++ b/modules/bullet/hinge_joint_bullet.cpp @@ -95,6 +95,9 @@ real_t HingeJointBullet::get_hinge_angle() { void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t p_value) { switch (p_param) { + case PhysicsServer::HINGE_JOINT_BIAS: + WARN_DEPRECATED_MSG("The HingeJoint parameter \"bias\" is deprecated."); + break; case PhysicsServer::HINGE_JOINT_LIMIT_UPPER: hingeConstraint->setLimit(hingeConstraint->getLowerLimit(), p_value, hingeConstraint->getLimitSoftness(), hingeConstraint->getLimitBiasFactor(), hingeConstraint->getLimitRelaxationFactor()); break; @@ -116,8 +119,8 @@ void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: hingeConstraint->setMaxMotorImpulse(p_value); break; - default: - WARN_DEPRECATED_MSG("The HingeJoint parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::HINGE_JOINT_MAX: + // Internal size value, nothing to do. break; } } @@ -125,8 +128,8 @@ void HingeJointBullet::set_param(PhysicsServer::HingeJointParam p_param, real_t real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const { switch (p_param) { case PhysicsServer::HINGE_JOINT_BIAS: + WARN_DEPRECATED_MSG("The HingeJoint parameter \"bias\" is deprecated."); return 0; - break; case PhysicsServer::HINGE_JOINT_LIMIT_UPPER: return hingeConstraint->getUpperLimit(); case PhysicsServer::HINGE_JOINT_LIMIT_LOWER: @@ -141,10 +144,12 @@ real_t HingeJointBullet::get_param(PhysicsServer::HingeJointParam p_param) const return hingeConstraint->getMotorTargetVelocity(); case PhysicsServer::HINGE_JOINT_MOTOR_MAX_IMPULSE: return hingeConstraint->getMaxMotorImpulse(); - default: - WARN_DEPRECATED_MSG("The HingeJoint parameter " + itos(p_param) + " is deprecated."); + case PhysicsServer::HINGE_JOINT_MAX: + // Internal size value, nothing to do. return 0; } + // Compiler doesn't seem to notice that all code paths are fulfilled... + return 0; } void HingeJointBullet::set_flag(PhysicsServer::HingeJointFlag p_flag, bool p_value) { diff --git a/modules/bullet/pin_joint_bullet.cpp b/modules/bullet/pin_joint_bullet.cpp index 1c2e5e65cc..8d109f1866 100644 --- a/modules/bullet/pin_joint_bullet.cpp +++ b/modules/bullet/pin_joint_bullet.cpp @@ -84,10 +84,9 @@ real_t PinJointBullet::get_param(PhysicsServer::PinJointParam p_param) const { return p2pConstraint->m_setting.m_damping; case PhysicsServer::PIN_JOINT_IMPULSE_CLAMP: return p2pConstraint->m_setting.m_impulseClamp; - default: - WARN_DEPRECATED_MSG("The parameter " + itos(p_param) + " is deprecated."); - return 0; } + // Compiler doesn't seem to notice that all code paths are fulfilled... + return 0; } void PinJointBullet::setPivotInA(const Vector3 &p_pos) { |