dgCollisionCapsule bad height

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

dgCollisionCapsule bad height

Postby 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

Re: dgCollisionCapsule bad height

Postby 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
Untitled.png (12.61 KiB) Viewed 3581 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
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: dgCollisionCapsule bad height

Postby arkeon » Tue Sep 23, 2014 10:02 am

ok thanks.
arkeon
 
Posts: 261
Joined: Sat Sep 13, 2014 5:25 pm

Re: dgCollisionCapsule bad height

Postby manny » Tue Sep 23, 2014 11:13 am

solved + locked.
http://www.instaLOD.io - InstaLOD - State of the art 3D optimization
manny
Site Admin
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 4 guests

cron