Vector from Game Objects Orientation

I have an object that is supposed to be like a satellite (a sphere)
This object has child objects (cones) that are its ‘thrusters’

I would like to apply an impulse to the sphere based on the position/orientation of these cones around the sphere (simulating firing thrusters)

Is there an easy way to get a Vector that represents a point on a unit sphere that would correspond to a game objects orientation?

Another example is if I place a child object 1 unit directly above another object-
I could use obParent.getVectTo(obChild) and as I rotate the parent object it would always give me the vector.
Then I could apply the impulse like this

vect = obParent.getVectTo(obChild)
obParent.applyImpulse(obChild.worldPosition, vect)

I’d like to get this vector from the objects orientation. Does this make any sense?
Thanks for any help.

The orientation matrix is constructed of vectors pointing along the local axis of the object, i.e, if you want which direction the y-axis of the object faces object.worldOrientation[1] would return that as a vector.

If not, you can multiply the direction of thrust (as a vector) by the orientation matrix and that will align the vector to the local space of the satellite. You can use the mathutils module to make that easier.

Thanks for the reply - that helped me get rid of the child empties I was using to get the vector - and helped me understand matrixes better.

I’m still not getting the expected results from the ‘thrusters’ though.

My intent is to be able to place the ‘thrusters’ anywhere on the satellite ‘body’ and have them propel the satellite correctly.

I’ve included a .blend file if anyone would be willing to take a look and help me see what I am missing. Should be ready to go (press ‘p’) then the ‘thruster’ controls are ‘Q,W,E,S’



_AGENTS-HELP.blend (72.1 KB)

Try using obT.localPosition as the point to apply the impulse, that seemed to work well.

Thanks for taking a look.

I tried that and unfortunately I still see some unexpected translation. like if you hold down the ‘Q’ thruster and keep it firing it still seems to correct its rotation in a way that isn’t accurate.
Weird problem… anyway thanks again for looking into to.