chandlerprall / Physijs

Physics plugin for Three.js
MIT License
2.77k stars 455 forks source link

changing material properties in runtime #257

Closed speculees closed 8 years ago

speculees commented 8 years ago

Hello, nice work with Physijs. I was wondering is it possible to change material properties in runtime, such as friction, mass and restitution. I tried changing the material object attribute values, and creating a new object. Everything looks okay in inspector. The object attributes have correct values, however the Physijs seems to ignore them. Also, I noticed that gravity has strange behavior. Vector(0,0,0) works as expected, but when y is negative the amount makes no difference. It can be -9.81 or -9810000... I will set up example soon.

peterjwest commented 8 years ago

Gravity works perfectly for me.

speculees commented 8 years ago

@peterjwest , you are right. It does work. I noticed that when I switched to a better PC. It was just difficult to notice such subtle changes on low end hardware. Thanks for the reply.

speculees commented 8 years ago

Changing the whole physics mesh instead of material worked for me. First I remove the meshes from scene and load them again with different material attributes, Marking this as closed.