Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method to know if a vision or light source polygon could benefit from a fast triangulation was not working anymore. #7871

Closed
1 of 6 tasks
dev7355608 opened this issue Aug 19, 2022 · 0 comments
Assignees
Labels
bug Functionality which is not working as intended vision Issues related to Token vision and vision modes

Comments

@dev7355608
Copy link

What happened?

PointSource#_createPolygon/_createRestrictedPolygon doesn't have to return a ClockwiseSweepPolygon. If it doesn't, this.los.edges.size fails. los.edge seems to be always nonempty unless los.points is empty, which would mean that this check doesn't have any effect.

// LightSource#initialize

    // Compute the source polygon
    this.los = this._createPolygon();
    this._flags.renderSoftEdges &&= ((this.los.edges.size > 0) || (this.data.angle < 360));
// VisionSource#initialize

    // Compute the unrestricted line-of-sight polygon
    this.los = this._createPolygon();

    // Compute the constrained vision polygon
    this.fov = this._createRestrictedPolygon();

    // Render soft edges according to performances mode
    this._flags.renderSoftEdges = canvas.performance.lightSoftEdges
      && ((this.fov.edges.size > 0) || (this.data.angle < 360));

(_createRestrictedPolygon's return type should be PointSourcePolygon | PIXI.Polygon: the same as _createPolygon.)

What ways of accessing Foundry can you encounter this issue in?

  • Native App (Electron)
  • Chrome
  • Firefox
  • Safari
  • Other

Reproduction Steps

.

What core version are you reporting this for?

Version 10 Testing 4 (build 278)

Relevant log output

No response

Bug Checklist

  • The issue occurs while all Modules are disabled
@dev7355608 dev7355608 added the bug Functionality which is not working as intended label Aug 19, 2022
@Fyorl Fyorl added this to the Version 10 - Testing 5 milestone Aug 22, 2022
@Fyorl Fyorl added the vision Issues related to Token vision and vision modes label Aug 22, 2022
@Feu-Secret Feu-Secret self-assigned this Aug 29, 2022
@Feu-Secret Feu-Secret changed the title LightSource/VisionSource#initialize breaks if los is not a ClockwiseSweepPolygon The method to know if a vision or light source polygon could benefit from a fast triangulation was not working anymore. Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended vision Issues related to Token vision and vision modes
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants