Skip to content

CalcSlabEndPoints - Struct by reference needed #74

Description

@Lanboost

If you use the vector definition by SharpNav.Geometry.Vector2 as a STRUCT, the method

class NavTile {
public static void CalcSlabEndPoints(Vector3 va, Vector3 vb, Vector2 bmin, Vector2 bmax, BoundarySide side)
}

The "output" bmin and bmax will always be "(0,0)" (outside of the function, this is because structs are passed by value)

https://stackoverflow.com/questions/9251608/are-structs-pass-by-value

Correct method should be

public static void CalcSlabEndPoints(Vector3 va, Vector3 vb, ref Vector2 bmin, ref Vector2 bmax, BoundarySide side)

This only affects creation of ConnectExtLinks between tiles to my knowledge

BR /Lan

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions