Newton 1.53 Converting Primitives to Convex Hulls

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Newton 1.53 Converting Primitives to Convex Hulls

Postby rabbit » Sat May 16, 2009 10:36 pm

I am not entirely sure if this is actually a bug or not but I will post incase. I am creating primitives such as cubes, cylinders and capsules with a matrix to offset their positions and rotations.

When I the convert the Newton body primitives to a convex hull, the convex hull isnt rotated, translated or scaled according to the offet I used when I made the NewtonBody. Infact the new convex hull appears as a primitive made with a null matrix offset.

Here is the code I am using:

matrix4 mat;
mat.setScale( vector3df(1.0f, 1.0f, 1.0f)* IrrToNewton );
mat.setTranslation( vector3df(0.0f, 0.0f, 0.0f) * IrrToNewton );
mat.setRotationDegrees( vector3df(45.0f, 0.0f, 0.0f) );

NewtonCollision* collisionFrame = NewtonCreateBox( pNewtonWorld, IrrToNewton*10, IrrToNewton*10, IrrToNewton*10, mat.pointer() );
pNewtonBody = NewtonCreateBody( pNewtonWorld, collisionFrame);
NewtonReleaseCollision( pNewtonWorld, collisionFrame );

//When I convert to a convex hull the offset data is lost and the primitive returns to its default position as if it had a null offset matrix upon creation
NewtonCollision* modifier = NewtonCreateConvexHullModifier( NewtonBodyGetWorld( pNewtonBody ), NewtonBodyGetCollision( pNewtonBody ) );
NewtonBodySetCollision( pNewtonBody, modifier);
NewtonReleaseCollision( pNewtonWorld, modifier);

I am actually trying to use a capsule for a player object in my game. With a universal PhysicsSetTransform callback. Problem is that callback makes the scene node rotation (scale and position) equal to that of the NewtonBody. As a result my character is standing up at rotation (0,0,0) but the capsule primitive is laying flat parralell with the x axis. Hence why I need the matrix offset for my convex hull.
rabbit
 
Posts: 18
Joined: Fri Mar 27, 2009 7:01 am

Re: Newton 1.53 Converting Primitives to Convex Hulls

Postby Julio Jerez » Sun May 17, 2009 11:00 am

wether it si a bug or not, not bug fixes for 1.53
you need to move to 2.0
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 3 guests

cron