us.ihmc.yoVariables.variable.YoFrameVector3D.normalize()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中us.ihmc.yoVariables.variable.YoFrameVector3D.normalize()方法的一些代码示例,展示了YoFrameVector3D.normalize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoFrameVector3D.normalize()方法的具体详情如下:
包路径:us.ihmc.yoVariables.variable.YoFrameVector3D
类名称:YoFrameVector3D
方法名:normalize

YoFrameVector3D.normalize介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void computeCurrentDisturbanceForce()
{
 currentDisturbanceForce.setX(random.nextDouble());
 currentDisturbanceForce.setY(random.nextDouble());
 currentDisturbanceForce.setZ(random.nextDouble());
 currentDisturbanceForce.normalize();
 currentDisturbanceForce.scale(maximalDisturbanceMagnitude.getDoubleValue());
}

代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit

private void applyForce()
{
 double length = pushDirection.length();
 if (length > 1e-5)
 {
   pushForce.set(pushDirection);
   pushForce.normalize();
   pushForce.scale(pushForceMagnitude.getDoubleValue());
   if (pushCondition == null)
   {
    pushTimeSwitch.set(yoTime.getDoubleValue());
   }
 }
 else
 {
   pushForce.setToZero();
   pushTimeSwitch.set(Double.NEGATIVE_INFINITY);
 }
 pushNumber.increment();
}

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

public void applyForce(Vector3D direction, double magnitude, double duration)
  {
   PrintTools.info("\nPushing " + jointName + " direction: " + direction + " magnitude: " + magnitude + "(N) for " + duration + "(s)");
   
   pushDuration.set(duration);
   pushDelay.set(0.0);
   pushDirection.set(direction);
   pushMagnitude.set(magnitude);
   
   if (pushDirection.length() > 1e-5)
   {
     pushForce.set(pushDirection);
     pushForce.normalize();
     pushForce.scale(pushMagnitude.getDoubleValue());
     pushTimeSwitch.set(yoTime.getDoubleValue());
   }
   else
   {
     pushForce.setToZero();
     pushTimeSwitch.set(Double.NEGATIVE_INFINITY);
   }

   pushNumber.increment();
  }
}

相关文章