Skip to content

Hashing algorithm is slow #2

@gamemachine

Description

@gamemachine

Performance can be greatly increased here. I just pulled a few lines of C# code here from my own implementation, it is based on http://www.cs.ucf.edu/~jmesit/publications/scsc%202005.pdf

ConvFactor = 1.0f / CellSize;
Width = (int)(Max / CellSize);

int Hash(float x, float z)
{
     return (int)((x * ConvFactor)) + (int)((z * ConvFactor)) * Width;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions