void solver_t::remove_rigid_body(rigid_body_t::pointer& rb) { if(rb) { if(m_rigid_bodies.find(rb) != m_rigid_bodies.end()) { m_impl->remove_rigid_body(rb->impl()); m_rigid_bodies.erase(rb); } } }
//add/remove from world void solver_t::add_rigid_body(rigid_body_t::pointer& rb) { if(rb) { if(m_rigid_bodies.find(rb) == m_rigid_bodies.end()) { m_rigid_bodies.insert(rb); m_impl->add_rigid_body(rb->impl()); } } }
hinge_constraint_t::pointer solver_t::create_hinge_constraint(rigid_body_t::pointer& rb, vec3f const& pivot, quatf const& rot) { return hinge_constraint_t::pointer(new hinge_constraint_t(m_impl->create_hinge_constraint(rb->impl(), pivot, rot), rb)); }
nail_constraint_t::pointer solver_t::create_nail_constraint(rigid_body_t::pointer& rbA, rigid_body_t::pointer& rbB, vec3f const& pivotInA, vec3f const& pivotInB) { return nail_constraint_t::pointer(new nail_constraint_t(m_impl->create_nail_constraint(rbA->impl(), rbB->impl(), pivotInA, pivotInB), rbA, rbB)); }
nail_constraint_t::pointer solver_t::create_nail_constraint(rigid_body_t::pointer& rb, vec3f const& pivot) { return nail_constraint_t::pointer(new nail_constraint_t(m_impl->create_nail_constraint(rb->impl(), pivot), rb)); }
sixdof_constraint_t::pointer solver_t::create_sixdof_constraint(rigid_body_t::pointer& rbA, vec3f const& pivotA, quatf const& rotA, rigid_body_t::pointer& rbB, vec3f const& pivotB, quatf const& rotB) { return sixdof_constraint_t::pointer(new sixdof_constraint_t(m_impl->create_sixdof_constraint(rbA->impl(), pivotA, rotA, rbB->impl(), pivotB, rotB), rbA, rbB)); }