Skip to content

Index out of bounds when running Example_08_SPHFluidParticles. #201

@freg-unity

Description

@freg-unity

Hi,

When running this sample: Scenes > Examples > Example_08_SPHFluidParticles I get an "IndexOutOfRangeException: Index was outside the bounds of the array" coming from here:

        m_sofaMeshAPI.GetRawPositions(m_vertexBuffer);
        for (int i = 0; i < m_nbVertices; ++i)
        {
            if (m_meshDim > 2)

-> m_unityVertices[i] = new Vector3(-m_vertexBuffer[i * m_meshDim], m_vertexBuffer[i * m_meshDim + 1], m_vertexBuffer[i * m_meshDim + 2]);

I believe this is caused by m_vertexBuffer in SofaMesh.cs not being updated properly for the NO_TOPOLOGY case. What do you think?

Fredrik.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions