Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hey, I'd like to access dtCrowdAgent::neis i.e. the neighbours of a crowd agent.

For example, it is useful to know if another agent is in close proximity.

Can I open a PR?

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

Oops, this is already available:

// neighbourIndex in [0...agent.raw.nneis - 1]
agent.raw.neis(neighbourIndex)
You must be logged in to vote
1 reply
@isaac-mason
Comment options

Hey @rob-myers! It may be good to add a helper to the CrowdAgent class. eg a similar helper was added for corners

  corners(): Vector3[] {
    const points: Vector3[] = [];

    for (let i = 0; i < this.raw.ncorners; i++) {
      points.push({
        x: this.raw.get_cornerVerts(i * 3),
        y: this.raw.get_cornerVerts(i * 3 + 1),
        z: this.raw.get_cornerVerts(i * 3 + 2),
      });
    }

    return points;
  }

Feel free to open a PR for this :) otherwise I'll do this sometime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.