Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PointQueryService

Index

Methods

Static addPointToQueryStruct

  • Adds a single point to the query structure. The point id is returned when the point is found. The id Entity does not have to be a valid entity, and can be treated as an integer id. The only disallowed id is the NONE entity, which is used internally.

    Parameters

    Returns void

Static buildPointQueryStruct

  • Explicitly build the query structure. Normally the query structure is built the first time the query runs, but you can call this function to help with timing or debugging.

    Parameters

    • world: WorldBase
    • eQuery: Entity

      Entity created via createPointQueryStruct

    Returns void

Static createPointQueryStruct

  • Creates a new entity that has a point query structure, and can be passed to other functions in this service.

    The created entity has an internal hidden component, and an external PointQueryStructTag component.

    To free the allocated memory used by the structure, destroy the entity.

    Parameters

    Returns Entity

Static queryClosestPoint

  • Query for the closest point to point in ps. Closeness is based on Euclidean distance. This query only considers points inside the hull around the point, which is described by maxDist (exclusive) and minDist (inclusive).

    Returns the id of the closest point as specified when it was added.

    Parameters

    • world: WorldBase
    • eQuery: Entity

      Entity created via createPointQueryStruct

    • point: Vector3
    • maxDist: number
    • minDist: number

    Returns Entity

Static queryClosestPointRef

  • Reference query for testing only. It yields the same results as queryClosestPoint, but takes much longer to execute. Avoid using it.

    Parameters

    • world: WorldBase
    • eQuery: Entity

      Entity created via createPointQueryStruct

    • point: Vector3
    • maxDist: number
    • minDist: number

    Returns Entity

Static queryNClosestPoints

  • Query for the n closest points to point in ps. Closeness is based on Euclidean distance. This query only considers points inside the hull around the point, which is described by maxDist (exclusive) and minDist (inclusive). Returns a list of ids and distances of the closest points, sorted by most distant first. This is slower than single-point queries. For best results, n should not be too large.

    Parameters

    • world: WorldBase
    • eQuery: Entity

      Entity created via createPointQueryStruct

    • point: Vector3
    • maxDist: number
    • minDist: number
    • n: number

    Returns PointQueryResults

Static queryNClosestPointsRef

  • Reference query for testing only. It yields the same results as queryNClosestPoints, but takes much longer to execute. Avoid using it.

    Parameters

    • world: WorldBase
    • eQuery: Entity

      Entity created via createPointQueryStruct

    • point: Vector3
    • maxDist: number
    • minDist: number
    • n: number

    Returns PointQueryResults

Static resetPointQueryStruct

  • resetPointQueryStruct(world: WorldBase, eQuery: Entity, numExpectedPoints: number): void
  • Prepares and resets a point query structure. You can use this to clear a query structure, or optimize allocations when the number of items is known ahead of time.

    Parameters

    • world: WorldBase
    • eQuery: Entity

      Entity created via createPointQueryStruct

    • numExpectedPoints: number

      Number of points expected. This is an optional hint for performance and does not need to match exactly.

    Returns void

Generated using TypeDoc