Giter VIP home page Giter VIP logo

Comments (5)

HaraldCsaszar avatar HaraldCsaszar commented on June 4, 2024

I assume you are referring to the MeshGenerator in the spine-unity runtime. By default it scales the Z component as well, however the commented line is there in case you want to customize the runtime and only scale the X and Y components.

If I misunderstood what you mean, please explain in more detail what you would like to know.

from spine-runtimes.

prefectover avatar prefectover commented on June 4, 2024

In Unity, vbi [i] *=scale; Will generate GC, while the rest will not

from spine-runtimes.

HaraldCsaszar avatar HaraldCsaszar commented on June 4, 2024

@prefectover How did you get to the assumption that this would cause any GC-relevant allocations?

from spine-runtimes.

prefectover avatar prefectover commented on June 4, 2024

In Unity, the Vector2 data is multiplied by the following method

        public static Vector2 operator *(Vector2 a, float d)
        {
            return new Vector2(a.x * d, a.y * d);
        }

Use vbi[i].x *= scale; vbi[i].y *= scale; Not 'new Vector2()'

from spine-runtimes.

HaraldCsaszar avatar HaraldCsaszar commented on June 4, 2024

@prefectover Thanks for sharing your thoughts. The question persists, how do you get the impression that this new Vector2(), which BTW is a Vector3, will be allocated on the heap?

from spine-runtimes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.