Move Bone/Node transforms
by Nathan Bowhay - ESAL · in Torque 3D Professional · 08/15/2012 (4:04 pm) · 4 replies
I used www.garagegames.com/community/forums/viewthread/33391/1 and basically wrote my own client side only class that inherits from StaticShape.
You then make a call to attach an object to a node it stores a pointer to the object attached, and node/join/bone attached to and sets MaskNodeHandsOff on every node.
Then in process tick I simply loop through all the attached objects and set mNodeTransforms to the objects position. If I only set one of them the moment hands off is set the mesh melts. I am guessing because all the node positions are no longer being set to that of the animation. Is this why this is happening?
I am trying to back up the node positions and then set them again after hands of is set so it doesn't melt, but can seem to get that to work using mNodeTransforms. I also tried defaultRotations and getNodeWorldTransform. Nothing seems to work.
Anyone have any suggestions? Anyone tried this same thing and gotten the same issue?
You then make a call to attach an object to a node it stores a pointer to the object attached, and node/join/bone attached to and sets MaskNodeHandsOff on every node.
Then in process tick I simply loop through all the attached objects and set mNodeTransforms to the objects position. If I only set one of them the moment hands off is set the mesh melts. I am guessing because all the node positions are no longer being set to that of the animation. Is this why this is happening?
I am trying to back up the node positions and then set them again after hands of is set so it doesn't melt, but can seem to get that to work using mNodeTransforms. I also tried defaultRotations and getNodeWorldTransform. Nothing seems to work.
Anyone have any suggestions? Anyone tried this same thing and gotten the same issue?
#2
I sort of figured out the solution to this, it turns out I don't need to set MaskNodeHandsOff on the nodes. You can still move the bone/node position and it doesn't melt. Not sure why that old forum post said you needed to set that. Maybe something has changed since TGE. I could have sworn I tried just not setting it and the nodes didn't move, but who knows I have been trying so many things I can't keep it all straight.
Hopefully I won't run into any other issues because I am not setting that flag.
08/16/2012 (11:41 am)
Kevin, Yeah pretty much basically I am attacking a bunch of vehicles to a beam and I am making it warp/bend based on their movement. If they all move together I will be moving the actual object, if any of the move away from each other or slightly faster it will bend the beam.I sort of figured out the solution to this, it turns out I don't need to set MaskNodeHandsOff on the nodes. You can still move the bone/node position and it doesn't melt. Not sure why that old forum post said you needed to set that. Maybe something has changed since TGE. I could have sworn I tried just not setting it and the nodes didn't move, but who knows I have been trying so many things I can't keep it all straight.
Hopefully I won't run into any other issues because I am not setting that flag.
#3
08/16/2012 (12:46 pm)
Please explain this in more detail in a resource if you can. I have always wanted to affect nodes and animation in code, but do not quite understand how to do this. The closest I got was a turret I built, but it had strange networking issues even though the turret did work. I ended up using a Player object as a turret for my mockup.
#4
www.garagegames.com/community/resources/view/21833
08/16/2012 (3:43 pm)
Ok I threw it up real quick. like I stated in there I am doing much more with this and it is client side only so you may still run into network issues, but those shouldn't be too hard to get around. You just need to set a flag to tell it to update the other clients.www.garagegames.com/community/resources/view/21833
Torque Owner Kevin Mitchell
12 CatBlack Studios