gpt4 book ai didi

c# - 为什么 Box2D/Farseer EdgeShape 定义了 4 个顶点?

转载 作者:行者123 更新时间:2023-11-28 06:58:16 25 4
gpt4 key购买 nike

当您创建 Farseer(或 Box2D)边缘 Fixture 时,您编写:

FixtureFactory.AttachEdge(start, end, bodyToAttachTheFixtureTo);

这是有道理的 - 你需要 startend 点来定义一条边。

当您想读取Fixture 时,让我感到困扰的是。假设 fixture 是我们读取的 Fixture:

  • ((EdgeShape) fixture.Shape).Vertex1
  • ((EdgeShape) fixture.Shape).Vertex2

应该是唯一的选择。但是我们也得到了 Vertex3Vertex4。为什么?它们是什么意思?

最佳答案

最有可能的顶点 1 和 4 是“幽灵顶点”:http://www.iforce2d.net/b2dtut/ghost-vertices

如果您正在寻找创建边时提供的两个原始顶点,您可能需要顶点 2 和 3。

关于c# - 为什么 Box2D/Farseer EdgeShape 定义了 4 个顶点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22883835/

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