Forum

Possible Physics Bug

12 June 2017 20:15
In this thread, we were talking about a shooting ball demo.
What happens is the ball shoots and starts rotating as it hits the ground or other things. Once physics are disabled and the ball is reset, the rotation is somehow 'remembered' by the ball so when you shoot again, it rotates according to the last physics simulation.
function throwBall(inParams,outParams) {
	m_constr.remove(inParams[0]);
	m_physics.enable_simulation(inParams[0]);
	
	m_physics.apply_velocity(inParams[0],0,20,0);
}

function resetBall(inParams,outParams) { 

	m_physics.disable_simulation(inParams[0]);
	m_trans.set_rotation_v(inParams[0],m_quat.create());
	m_trans.set_translation_v(inParams[0],m_trans.get_translation(inParams[1]));
	m_constr.append_stiff_trans_rot(inParams[0], inParams[1], m_vec3.create()); 
}

This is a logic node + JavaScript project. Project attached.
13 June 2017 16:26
Hello Will,
Thanks for the report. The point of issue is that we do not reset forces, torques, velocities and angular velocities when disable_simulation is called.
We are going to change this situation
 
Please register or log in to leave a reply.