{"push_id":674214455,"size":1,"distinct_size":1,"ref":"refs/heads/bodyType","head":"aff3c235b698b08e03caca22520a82b415ddee86","before":"504759a8b687d5e3dd6efd1ec851ade81fcae897","commits":[{"sha":"aff3c235b698b08e03caca22520a82b415ddee86","author":{"email":"16cb4ee8102a6bc95130d59750822c637afb4759@gmail.com","name":"Raco"},"message":"(#305) GameObject.bodyType & GameObject.dynamics\n\nbodyType:\n\n- new public variable \"currBodyType\".\n- RIGID_BODY to DYNAMIC: angular velocity is not canceled, therefore disable angular velocity.\n- NO_COLLISION to DYNAMIC: all forces and velocities applied while NO_COLLISION will be executed when DYNAMIC. You can do a simple test with a NO_COLLISION Sacky. Run the game and jump. Of course, nothing will happen. But when enabling dynamics without clearing forces, the jump is executed, which is unwanted behavior. Therefore, clear forces and disable velocities.\n- kinematic initialization hack: objects that are initially STATIC or SENSOR will have infinite mass. Therefore set mass to 1 (Blender default) when change to DYNAMIC or RIGID_BODY. A second issue is a weird bug with collisionflags for objects that are initially STATIC or SENSOR. When changed to DYNAMIC or RIGID_BODY the body is not activated properly. Anyway, changing to NO_COLLISION first, solves this issue. Luckily this will happen only once during the game, and only with objects that are initially STATIC or SENSOR.\n- fix in Bullet.makeBody() with CollisionFlags: STATIC objects were set to kinematic, whilst STATIC GHOST and SENSOR to static. Now those are set to kinematic too. (So CollisionFlags vary between 0, 2, 4 and 6. See Constant Field Values in jbullet docs).\n\ndynamics:\n\n- new private variable \"lastBodyType\" for temporal storage of the body type when disabling dynamics. By default \"DYNAMIC\" to be able to enable dynamics on objects that are initially STATIC or SENSOR.\n- dynamic -> dynamics name change: to avoid confusion with changing physics type to DYNAMIC; dynamics(true) will enable dynamics as dynamics(false) will disable dynamics. Naturally this won't work for NO_COLLISION objects, because those are not in the dynamics world.\n- dynamics(boolean) now uses bodyType getter and setter\n- dynamics() will only check for objects that are not kinematic, because BDX now doesn't have any static objects.\n\nreplaceModel:\n\n- the old method of making the body is replaced by only making the shape. This not only removes updates for velocities, ghost and body type, but also fixes a bug that only happened when the replaced model is visible.","distinct":true,"url":"https://api.github.com/repos/rafcolson/bdx/commits/aff3c235b698b08e03caca22520a82b415ddee86"}]}