Skip to content

Position not getting what is set #124

@stevedekorte

Description

@stevedekorte

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions