2D Toolkit Forum

2D Toolkit => Support => Topic started by: pan_henryk on June 10, 2014, 11:48:18 am

Title: Mesh.Optimize tk2dStaticSpriteBatcher's MeshCollider?
Post by: pan_henryk on June 10, 2014, 11:48:18 am
I am experimenting with tk2dStaticSpriteBatcher for objects with colliders. I wonder if it makes sense to call Mesh.Optimize for MeshCollider generated by batcher from series of Box Colliders?

Title: Re: Mesh.Optimize tk2dStaticSpriteBatcher's MeshCollider?
Post by: unikronsoftware on June 10, 2014, 11:53:20 am
mesh optimize optimizes for rendering. Don't think it'll help at all for mesh colliders.
Title: Re: Mesh.Optimize tk2dStaticSpriteBatcher's MeshCollider?
Post by: pan_henryk on June 10, 2014, 06:15:15 pm
I see. Thanks!
Now I need to check what optimization could be applied to mesh collider, as (in my case) it is often built of adjacent box coliders.
Title: Re: Mesh.Optimize tk2dStaticSpriteBatcher's MeshCollider?
Post by: unikronsoftware on June 10, 2014, 10:34:05 pm
Nothing that is readily available. The tilemap editor does some optimizations that will reduce adjacent boxes to one edge collider but that will not directly apply to the static sprite batcher. You do have the code available if you're feeling like you want to get your hands dirty..