3

HeightfieldTerrainShapeJBullet 物理ライブラリからの使い方を見つけるのに苦労しています。ご覧のとおり、2 つのコンストラクターが利用可能です。

public HeightfieldTerrainShape(int heightStickWidth, int heightStickLength, byte[] heightfieldData,
            float heightScale, float minHeight, float maxHeight, int upAxis, PHY_ScalarType heightDataType,
            boolean flipQuadEdges)

public HeightfieldTerrainShape(int heightStickWidth, int heightStickLength, byte[] heightfieldData,
        float maxHeight, int upAxis, boolean useFloatData, boolean flipQuadEdges)

heightScaleminHeightmaxHeightおよびupAxisは自明です。しかし、「heightStick」とは正確には何ですか? また、幅と長さはどのように決定すればよいですか? heightfieldData にはどのような形式が期待されますか? これはフロートの単なるバイトバッファだと思いますか?

4

1 に答える 1

3

最初の機能

public HeightfieldTerrainShape(int heightStickWidth, int heightStickLength, byte[] heightfieldData, float heightScale, float minHeight, float maxHeight, int upAxis, PHY_ScalarType heightDataType, boolean flipQuadEdges)

ドキュメントhttps://pybullet.org/Bullet/BulletFull/classbtHeightfieldTerrainShape.html#a90d823ba5f44871a0bcfce0174177223に従って優先されます。

ドキュメント (および cpp コード) を見ると、定義しているサーフェス (地形) を表す原子長方形サーフェスの長方形サイズのようです。

たとえば、幅と高さが 1 で地形が 10 x 10 (x と y) の場合、地形を表す 10 x 10 = 100 個の長方形が存在します。

于 2019-05-24T01:45:52.743 に答える