Game Development Community

[Solved]Bug in Linkpoint Offset?

by Matthew Hoesterey · in Torque X 2D · 09/29/2010 (3:23 am) · 1 replies

Hi, I just wanted to verify that this is a bug.


I was going to move all my particle systems over to use the mount system. Currently I use a custom component to manually set the position of the particles and I figured the mount system would be more efficient now that it is supposed to work.

Trying to set an offset from the link point I found that any offset would cause the particle to go way off screen.

In this method:
public Vector2 GetWorldLinkPosition(Vector2 linkPos, float linkRot, Vector2 offset)

I found this line:
Vector2 pos = halfSize * (linkPos + offset);

it turns out that the offset is multiplying half the size of the sprite by the offset. is this intended for some reason I'm missing?


If not I can just add the offset rather then multiply. I'm really just looking to offset a particle x pixels from the object.

Thanks. :)


#1
09/29/2010 (3:28 am)
Never mind. They did this so when you re-size an object the mount moves accordingly. Just have to do the math to figure the percentage amount compared to the overall size of the object I want to offset the particle by. Ga I hate math :(

I'll have to change out all my fx math but hopefully cutting out all those components will be worth it.