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

Position not getting what is set #124

Open
stevedekorte opened this issue Nov 9, 2022 · 0 comments
Open

Position not getting what is set #124

stevedekorte opened this issue Nov 9, 2022 · 0 comments

Comments

@stevedekorte
Copy link

stevedekorte commented Nov 9, 2022

CODE:

const a = [17.638363116197674, 7.483171863743657]
console.log("before:", a)
body.SetTransform(new Box2D.b2Vec2(a[0], a[1]), body.GetAngle())
const p2 = body.GetPosition();
console.log(" after:", [p2.get_x(), p2.get_y()])

OUTPUT:

before: [17.638363116197674, 7.483171863743657]
after: [17.638362884521484, 7.4831719398498535]

Why isn't the position the same as what was set? How can I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant