Skip to content

How to handle local coordinates? #24

@KKzLEO

Description

@KKzLEO

Hi, thanks for creating this library, it's awesome.
I encountered an issue is that my coordinate system is based on container, so the structure will be like
image

the coordinate of my graphics object is a local coordinate(relative to the parent container), and I wanna do culling so I add the children of the container to cull object, it will be like

const collectChildren = (viewport: Viewport) => {
  return _flatten((viewport.children as Container[]).map(({ children }) => children));
};

cull.addList(collectChildren(viewport));
cull.cull(viewport.getVisibleBounds());

seems the cull method is to use the x and y of the object directly instead of worldTransforms.x to do a comparison, it will cull some objects that are still in my view unexpectedly, is there any direction I can try?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions