Page 1 of 1

Rope for Unity

Posted: Tue Dec 18, 2018 9:53 am
by switch
Hi guys!
I've got a question by pybullet in Unity:
How can i realise a next code in unity (using NativeMethods)?
i don't understand how can i use btSoftBodyHelpers from NativeMethods.

Code: Select all

void NewtonsRopeCradleExample::connectWithRope(btRigidBody* body1, btRigidBody* body2)
	btSoftBody* softBodyRope0 = btSoftBodyHelpers::CreateRope(softBodyWorldInfo, body1->getWorldTransform().getOrigin(), 
                                                                                                    body2->getWorldTransform().getOrigin(), gRopeResolution, 0);

	softBodyRope0->appendAnchor(0, body1);
	softBodyRope0->appendAnchor(softBodyRope0->m_nodes.size() - 1, body2);

	softBodyRope0->m_cfg.piterations = 5;
	softBodyRope0->m_cfg.kDP = 0.005f;
	softBodyRope0->m_cfg.kSHR = 1;
	softBodyRope0->m_cfg.kCHR = 1;
	softBodyRope0->m_cfg.kKHR = 1;

:?: :?: :?:

Re: Rope for Unity

Posted: Fri Dec 21, 2018 3:05 am
by Erwin Coumans
That code hasn't been exposed through the C-API yet. We may improve soft body support in PyBullet next year.

Re: Rope for Unity

Posted: Mon Dec 24, 2018 6:24 am
by switch
Thank's for answer Erwin Coumans and and good luck in your develop! :)