gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 22:56:40 28 4
gpt4 key购买 nike

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

YoFrameConvexPolygon2D.getMaxNumberOfVertices介绍

[英]Gets the maximum size that this polygon can reach.

This value is immutable.
[中]

代码示例

代码示例来源:origin: us.ihmc/ihmc-graphics-description

@Override
public YoVariable<?>[] getVariables()
{
 YoVariable<?>[] vars = new YoVariable[1 + 2 * convexPolygon.getMaxNumberOfVertices()];
 int i = 0;
 vars[i++] = convexPolygon.getYoNumberOfVertices();
 for (YoFramePoint2D p : convexPolygon.getVertexBuffer())
 {
   vars[i++] = p.getYoX();
   vars[i++] = p.getYoY();
 }
 return vars;
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

private YoGraphicPolygon(String name, YoVariable<?>[] yoVariables, double[] constants, AppearanceDefinition appearance)
{
 /*
  * 2 * (int) constants[1] + 1 => constants[1] is the size of the 2D vertex
  * buffer so we have 2 * YoVariables, the "+ 1" is for the YoInteger that
  * keeps track of the actual polygon size.
  */
 super(name, Arrays.copyOfRange(yoVariables, 2 * (int) constants[1] + 1, yoVariables.length), constants[0]);
 int constantIndex = 1; // 0 corresponds to the scale factor
 int vertexBufferSize = (int) constants[constantIndex++];
 // Ensuring backward compatibility
 this.height = constants.length == 3 ? constants[constantIndex++] : DEFAULT_HEIGHT;
 int yoIndex = 0;
 YoInteger numberOfVertices = (YoInteger) yoVariables[yoIndex++];
 List<YoFramePoint2D> yoFrameVertices = new ArrayList<>();
 while (yoFrameVertices.size() < vertexBufferSize)
 {
   YoDouble xVariable = (YoDouble) yoVariables[yoIndex++];
   YoDouble yVariable = (YoDouble) yoVariables[yoIndex++];
   yoFrameVertices.add(new YoFramePoint2D(xVariable, yVariable, worldFrame));
 }
 yoFrameConvexPolygon2d = new YoFrameConvexPolygon2D(yoFrameVertices, numberOfVertices, worldFrame);
 verticesToDisplay = new ArrayList<>(yoFrameConvexPolygon2d.getMaxNumberOfVertices());
 this.appearance = appearance;
 graphics3dObject = new Graphics3DObject();
 graphics3dObject.setChangeable(true);
 MeshDataHolder meshDataHolder = MeshDataGenerator.ExtrudedPolygon(yoFrameConvexPolygon2d, height);
 instruction = new Graphics3DAddMeshDataInstruction(meshDataHolder, appearance);
 graphics3dObject.addInstruction(instruction);
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

@Override
public YoVariable<?>[] getVariables()
{
 //poly + framePoint + frameOrientation
 YoVariable<?>[] superYoVariables = super.getVariables();
 YoVariable<?>[] yoVariables = new YoVariable[1 + 2 * yoFrameConvexPolygon2d.getMaxNumberOfVertices() + superYoVariables.length];
 int i = 0;
 yoVariables[i++] = yoFrameConvexPolygon2d.getYoNumberOfVertices();
 for (YoFramePoint2D p : yoFrameConvexPolygon2d.getVertexBuffer())
 {
   yoVariables[i++] = p.getYoX();
   yoVariables[i++] = p.getYoY();
 }
 for (YoVariable<?> superYoVariable : superYoVariables)
 {
   yoVariables[i++] = superYoVariable;
 }
 return yoVariables;
}

代码示例来源:origin: us.ihmc/ihmc-graphics-description

private YoGraphicPolygon(String name, YoFrameConvexPolygon2D yoFrameConvexPolygon2d, YoFramePoint3D framePoint, YoFrameYawPitchRoll yawPitchRoll,
            YoFrameQuaternion quaternion, double scale, double height, AppearanceDefinition appearance)
{
 super(name, framePoint, yawPitchRoll, quaternion, scale);
 if (yoFrameConvexPolygon2d.getNumberOfVertices() <= 0)
   yoFrameConvexPolygon2d.set(Vertex2DSupplier.emptyVertex2DSupplier());
 this.yoFrameConvexPolygon2d = yoFrameConvexPolygon2d;
 this.appearance = appearance;
 this.height = height;
 verticesToDisplay = new ArrayList<>(yoFrameConvexPolygon2d.getMaxNumberOfVertices());
 graphics3dObject = new Graphics3DObject();
 graphics3dObject.setChangeable(true);
 MeshDataHolder meshDataHolder = MeshDataGenerator.ExtrudedPolygon(yoFrameConvexPolygon2d, height);
 instruction = new Graphics3DAddMeshDataInstruction(meshDataHolder, appearance);
 graphics3dObject.addInstruction(instruction);
}

代码示例来源:origin: us.ihmc/ihmc-path-planning-test

if (planarRegion.getConvexHull().getNumberOfVertices() > visiblePolygons.get(polygonIdx).getMaxNumberOfVertices())

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

if (planarRegion.getConvexHull().getNumberOfVertices() > visiblePolygons.get(polygonIdx).getMaxNumberOfVertices())

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com