schteppe / p2.js

JavaScript 2D physics library
Other
2.64k stars 330 forks source link

Custom body id #161

Closed lgick closed 9 years ago

lgick commented 9 years ago

Hi!

I can use my ID with body instance?

Example:

        var body = new Body({
            mass: 1,
            position: [0, 0],
            angle: 0,
            velocity: [0, 0],
            angularVelocity: 0
        });

   body.id = 'myPersonalID';

this code will work?

schteppe commented 9 years ago

Probably no. I'd suggest you to use some other property name. The id needs to be a unique integer, and you should not change it while the body is in the world.

lgick commented 9 years ago

Thank you!