NewtonSetTransform callback

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

NewtonSetTransform callback

Postby wahmo » Sat Feb 12, 2011 9:07 pm

Hello,
I have a problem with the NewtonSetTransform callback. First i could not access the matrix array so i had to change const dFloat* matrix to
const float* matrix[][4]. Now since i am using Ogre for my rendering engine, i would do this to get an Ogre-compatible matrix to transform my objects:
Code: Select all
Ogre::Matrix4 mat(matrix[0][0], matrix[0][1], etc, etc...);

Except i get an error saying that it cannot convert float* to float in the constructor.
I've searched all over for a way to convert a pointer to a normal variable but can't find it. Does anyone know how i could do this? (or set the callback to use regular float?)
wahmo
 
Posts: 2
Joined: Fri Feb 11, 2011 7:53 pm

Re: NewtonSetTransform callback

Postby Julio Jerez » Sat Feb 12, 2011 9:39 pm

wahmo wrote:Hello,
I have a problem with the NewtonSetTransform callback. First i could not access the matrix array so i had to change const dFloat* matrix to

that is a mistake, you must copy the data from const dFloat* matrix using memcpy or a loop.
however as I undertand Oger is one of teh few engine that use the Matrix backward, so you need to make the transpose of the Matrix,
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron