Mack Posted December 31, 2018 Share Posted December 31, 2018 This topic is in response to this Job Board posting.Thanks to @JeffR for the assistance. These source code changes will enable xaxis/yaw mouse movement (look left/right/turn around) for mounted players. Previously the player was restricted to only yaxis/pitch (look up/down) movement.In PLAYER.CPP under Player::setPositionReplace the default isMounted code with the following: if (isMounted()) { // Use transform from mounted object - Thanks to Jeff Raab MatrixF zrot; mMount.object->getMountTransform( mMount.node, mMount.xfm, &mat ); zrot.set(EulerF(0.0f, 0.0f, rot.z)); mat.mul(zrot); } In PLAYER.CPP under Player::setRenderPositionReplace the default isMounted code with the following: if (isMounted()) { // Use transform from mounted object - Thanks to Jeff Raab MatrixF zrot; mMount.object->getRenderMountTransform( dt, mMount.node, mMount.xfm, &mat ); bool isSer = isServerObject(); S32 id = getId(); zrot.set(EulerF(0.0f, 0.0f, rot.z)); mat.mul(zrot); } In SHAPEBASE.CPP under ShapeBase::advanceTimeComment out the following: if (isMounted()) { //Standard Torque 3.9 code, commented out to fix jitter bug when enabling full mouse movement when mounted, thanks to Jeff Raab MatrixF mat; mMount.object->getRenderMountTransform( 0.0f, mMount.node, mMount.xfm, &mat ); Parent::setRenderTransform(mat); } Quote Link to comment Share on other sites More sharing options...
Duion Posted December 31, 2018 Share Posted December 31, 2018 You should consider adding this to the main repo, so not everyone has to bother implementing his own changes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.