Rotating mounted objects
by Samuel Cartwright · in Torque Game Builder · 04/25/2009 (1:50 am) · 4 replies
I have one object mounted to another.
I want the mounted object to rotate around the object it is mounted to, but I want both objects to keep their original orientation - ie, the sprite images don't rotate, but one object will move around the other.
At the moment I'm mounting one object to the other, and calling rotateTo on the parent. But I don't actually want both objects to rotate, I just want one to move around the other.
Perhaps I'm not using the right function, but I thought this might be the easiest way to get one object to move around another.
Can anyone give me some guidance?
Thanks,
Sam.
I want the mounted object to rotate around the object it is mounted to, but I want both objects to keep their original orientation - ie, the sprite images don't rotate, but one object will move around the other.
At the moment I'm mounting one object to the other, and calling rotateTo on the parent. But I don't actually want both objects to rotate, I just want one to move around the other.
Perhaps I'm not using the right function, but I thought this might be the easiest way to get one object to move around another.
Can anyone give me some guidance?
Thanks,
Sam.
Torque 3D Owner Ronny Bangsund
Torque Cheerleaders
I'm no good at this, and can't give an answer directly, but it involves some math (degrees and/or radians). The orbiting object needs to keep a fixed distance from the main object, positioned at a variable point in a circle around it. I think rotateTo() will just treat both objects as an entity, so you need different calculations for each.