Unified movement function

It would be nice to have a unified movement function that can be used by any object that has a spatial component.

Parameters to declare when moving an object via the Unified movement function:

-what object is to be moved?

-shall it first be teleported to a specified position (XYZ or LAT_LON_HGT) and/or orientation (HPR_angles or DRU_vectors) ? If so, in reference to what object?

-The move itself would be composed of a series of any number of relative primitive moves, from 0 (just wanted to teleport) to whatever number of primitives.

each primitive would be composed of the following:

-in regards to what reference object? This object’s position/orientation will act as the reference frame for this primitive move

-in regards to what point? Defaults to (0,0,0) if none given.

-in regards to what vector emanating from that point?

-translate or rotate?

-signed amount (meters for translate, radians for rotate)

Base for other functions

This unified movement function which allows any type of movement could be called directly, or serve as a base function of other movement functions such as:


-what object is to be moved: camera

-perform an initial teleport

primitive move: none, just wanted to teleport


-what object is to be moved: camera

-no initial teleport

primitive move

-reference object: camera

-point: (0,0,0)

-vector: usually one of it’s cardinal vectors

-rotate by signed amount


(same as camera.look except it’s translate by signed amount)


-what object is to be moved: camera

-no initial teleport

primitive move

-reference object: Earth

-point: (0,0,0)

-vector: usually (0,0,1) or one of the cardinal directions of the object’s eastNorthUpToFixedFrame transform

Teleport and primitive move

There maybe be cases where you’d perform an initial teleport followed by a relative move, when you want to be offset by a specific amount from a certain position but don’t want to bother calculating what the final position is.

What’s the point of point in the movement primitive?

Something I noticed about the camera rotate functions look and rotate is that they all involve rotation around the origin, but not an arbitrary point in that reference frame.Lets say you want to rotate the right aileron of an aircraft. You know one of the sockets of the right aileron is located at (4,-1,1) in the aircraft reference frame so that is the point from which the axis of rotation emanates from.

Object Latching tree

The aileron example assumes there is an object latching system where child objects automatically follow parent objects. Child object’s position/orientation would be defined in terms of the parent’s reference frame. Earth being the main trunk of the parent/child latching tree. Perhaps sometime in the future it will be the Sun from which all planets are children. (a WebGL solar system example http://mgvez.github.io/jsorrery/ )