   Question regarding Tokamak object rotation values
  Hi,I've just started using Tokamak to handle physics calculations for a small game I'm making, and I wondered if anyone has any knowledge of Tokamak that could help me (The documentation is useless, as it only describes the functions, not the neQ and neM3 structs and what they represent, and the header files are no use either)...Basically it's an incredibly simple arcade car driving game, so I don't need totally realistic driving, however:I'm using ApplyTwist() around the Y axis in order to steer the car (based on keyboard keys) and this works fine. But I'm trying to use ApplyImpulse() with a force vector in order to try to provide forward momentum, but this force vector applies to the fixed axis plane of the scene (so the object always moves along the X axis regardless of what direction it's facing).I'm trying to use sin and cos to work out the X and Z axis force vectors based on the direction the vehicle is pointing, but I can't work out what GetRotationQ() and GetRotationM3() primitive values return - I've tried all their X, Y, Z, W values, and nothing looks like an axis or rotation value in either radians or degrees, so I can't work out how to get the rotation of the object around the Y axis (the direction the car is pointing) from Tokamak.Does anyone know how to do this?Many thanks,Berkut   
  Is neM3 (the type returned by GetRotationM3()) a 3x3 matrix?If so, the vector you're looking for will be one of the rows or columns or this matrix. I don't know what notational convention Tokamak uses, nor which axis is considered 'forward' for your model, but there are only 6 possibilities, so it shouldn't be too hard to find the right one :)   ;  Thanks, but there are 12 of them (4x3), and I've looked at all of them (I'm outputting them to screen as I rotate the object manually), and none of them look like rotation values (they all stay within the bounds of around -1.1 to 1.0, and I'm assuming that given I'm rotating the object fully 360 deg around the Y axis, I should see close to 360 if it was degrees or close to 6 if radians...   ;Quote:Original post by berkut23Thanks, but there are 12 of them (4x3), and I've looked at all of them (I'm outputting them to screen as I rotate the object manually), and none of them look like rotation values (they all stay within the bounds of around -1.1 to 1.0, and I'm assuming that given I'm rotating the object fully 360 deg around the Y axis, I should see close to 360 if it was degrees or close to 6 if radians...No, read my post again:Quote:the vector you're looking for will be one of the rows or columns or this matrix [emphasis added]The values of the matrix do not represent rotation values in degrees or radians. Rather, the matrix represents (presumably) an affine transform consisting or a rotation and a translation.If the matrix is 4x3, then that implies that row-vector notation is being used. As such, the first three rows of the matrix are the basis vectors of the transform, and the last row is the translation. The vector you're looking for is one of the first three rows of the matrix (I don't know how your object is oriented in local space, so I can't tell you which one).Give it a try. Try setting the force vector to each of the first three rows in turn, and see if one of them gives you the results that you're after.   ;  Was the first one, thanks very much for the help!