Report any bugs here and we'll post fixes
Moderators: Sascha Willems, Thomas
by arkeon » Tue Sep 23, 2014 5:54 am
You use (height * 0.5 - radius) to compute the shape signature, but you forgot to apply the same in the dgCollisionCapsule::Init function
here the corrected code
- Code: Select all
void dgCollisionCapsule::Init (dgFloat32 radius, dgFloat32 height)
{
m_rtti |= dgCollisionCapsule_RTTI;
dgInt32 i0 = 0;
dgInt32 i1 = DG_CAPSULE_SEGMENTS * DG_CAP_SEGMENTS * 2;
m_radius = dgAbsf (radius);
m_height = dgAbsf (height * dgFloat32 (0.5f) - m_radius); // remove radius
-
arkeon
-
- Posts: 261
- Joined: Sat Sep 13, 2014 5:25 pm
by Julio Jerez » Tue Sep 23, 2014 9:31 am
not that will be wrong, you are still using newton 300 as if is was newton 200
this is how a capsules and chamfered cylinders are defined in new 300
- Untitled.png (12.61 KiB) Viewed 3601 times
you did discovered a legacy problem, I am still calculation the wrong, but that twill be harmless because the signature is just the key for funding the cache shapes in the shape cash.
Also I still have the pin number in the cache which was the way shape where single out in Newton 200
but with instance pin number is not longer necessary.
I will change that however the Init function is correct. you just need to pass the proper input values
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by arkeon » Tue Sep 23, 2014 10:02 am
ok thanks.
-
arkeon
-
- Posts: 261
- Joined: Sat Sep 13, 2014 5:25 pm
by manny » Tue Sep 23, 2014 11:13 am
solved + locked.
-
manny
- Site Admin
-
- Posts: 131
- Joined: Tue Feb 11, 2014 6:49 pm
Return to Bugs and Fixes
Who is online
Users browsing this forum: No registered users and 2 guests