[ODE] [patch] Ball joint ERP and CFM
Adam Rotaru
adam_rotaru at yahoo.com
Mon Feb 10 02:24:01 2003
--0-1014688820-1044868988=:84943
Content-Type: text/plain; charset=us-ascii
Content-Id:
Content-Disposition: inline
What?
Allow setting ERP and CFM for each ball joint.
Against ode-0.035
How?
Similar how it is done for hinge joints.
Struct dxJointBall extended with:
dReal joint_erp,joint_cfm; // joint parameters
(erp,cfm)
Added function to set ball joint parameter:
void dJointSetBallParam (dJointID, int parameter,
dReal value);
Affected files:
include/ode/common.h
include/ode/objects.h
ode/src/joint.h
ode/src/joint.cpp
Patch file is attached (only 4KB).
cheers,
Adam R.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--0-1014688820-1044868988=:84943
Content-Type: application/octet-stream; name="adam_diff_BallERP_0.35.diff"
Content-Transfer-Encoding: base64
Content-Description: adam_diff_BallERP_0.35.diff
Content-Disposition: attachment; filename="adam_diff_BallERP_0.35.diff"
ZGlmZiAtdSAtciAtLWV4Y2x1ZGU9Q1ZTIC0tZXhjbHVkZT11c2VyLXNldHRp
bmdzIG9kZS0wLjAzNS9pbmNsdWRlL29kZS9jb21tb24uaCBvZGUtYWRhbS9p
bmNsdWRlL29kZS9jb21tb24uaAotLS0gb2RlLTAuMDM1L2luY2x1ZGUvb2Rl
L2NvbW1vbi5oCU1vbiBOb3YgMTEgMDE6MTE6MDUgMjAwMgorKysgb2RlLWFk
YW0vaW5jbHVkZS9vZGUvY29tbW9uLmgJVHVlIEphbiAyMSAyMTo0NTozNCAy
MDAzCkBAIC0yNDcsNiArMjQ3LDcgQEAKICAgZFBhcmFtRk1heCwgXAogICBk
UGFyYW1GdWRnZUZhY3RvciwgXAogICBkUGFyYW1Cb3VuY2UsIFwKKyAgZFBh
cmFtRVJQLCBcCiAgIGRQYXJhbUNGTSwgXAogICBkUGFyYW1TdG9wRVJQLCBc
CiAgIGRQYXJhbVN0b3BDRk0sIFwKQEAgLT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