Rope for Unity

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
switch
Posts: 2
Joined: Tue Dec 18, 2018 9:47 am

Rope for Unity

Post by switch » Tue Dec 18, 2018 9:53 am

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->setTotalMass(0.1f);

	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;

	getSoftDynamicsWorld()->addSoftBody(softBodyRope0);
}
:?: :?: :?:

User avatar
Erwin Coumans
Site Admin
Posts: 4177
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Rope for Unity

Post by Erwin Coumans » Fri Dec 21, 2018 3:05 am

That code hasn't been exposed through the C-API yet. We may improve soft body support in PyBullet next year.

switch
Posts: 2
Joined: Tue Dec 18, 2018 9:47 am

Re: Rope for Unity

Post by switch » Mon Dec 24, 2018 6:24 am

Thank's for answer Erwin Coumans and and good luck in your develop! :)

Post Reply