Convex hull modifer ignores original collision matrix

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Convex hull modifer ignores original collision matrix

Postby agi_shi » Sat Sep 05, 2009 12:06 pm

I made a cylinder and a capsule using a collision matrix so that they are aligned upwards instead of the default sideways (a simple -90 degree rotation on Z). This works correctly unless I made a convex hull modifier out of said cylinders/capsules, which is when their are reset to their default sideways orientation. This seems like a simple bug (or is it intended behavior?), yet it's a bit annoying since I make convex hull modifiers out of everything without knowing whether it's a cylinder or capsule that needs to be rotated.
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: Convex hull modifer ignores original collision matrix

Postby Julio Jerez » Sat Sep 05, 2009 1:10 pm

are you saying that the offset matrix of a shape is ingored if you make that shape a child of a modifier?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Convex hull modifer ignores original collision matrix

Postby Julio Jerez » Sat Sep 05, 2009 2:06 pm

I see you are right, the is a bug
The code was not mutiplyin teh sca;e matrix by teh offset.
basicall it was I was no usin a similtar tranformation.

I fix it and it work very well now,
I just replaced the bugus scale transform wich was
Code: Select all
m = Scalematrix *  BodyMatrox

wich is wrong and only worka when offsetMatrix is identity,
Now I replaced with this:
Code: Select all
m = (offsetMatrix * ScaleMatrix * inv (offsetMatrix))  * offsetMatrix * BodyMatrox

wich lead to the correct tranform with scale
Code: Select all
m = offsetMatrix * ScaleMatrix * BodyMatrix


and now it work the way it is suppose to work
I owe you have two bug fixes,
I will try to put beta 2009 tonight or tomorrow morning.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Convex hull modifer ignores original collision matrix

Postby agi_shi » Sat Sep 05, 2009 3:16 pm

Cool, thanks :)
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 45 guests