// // TransformableSceneObject impl // public Frame3 GetLocalFrame(CoordSpace eSpace) { if (eSpace == CoordSpace.SceneCoords) { return(parentScene.WorldToSceneF(new Frame3(RootGameObject.transform, false))); } else { return(MathUtil.GetGameObjectFrame(RootGameObject, eSpace)); } }
// utility functions public Frame3 GetObjectFrame() { return(MathUtil.GetGameObjectFrame(RootGameObject, CoordSpace.ObjectCoords)); }
// cockpit frame is oriented such that // +X is right // +Y is up // +Z is into scene // note that for most unity mesh objects are created on the XZ plane, and so you // need to rotate world_y to point to -cockpit_z, ie Quaternion.FromToRotation (Vector3.up, -cockpitF.Z) public virtual Frame3 GetLocalFrame(CoordSpace eSpace) { return(MathUtil.GetGameObjectFrame(gameobject, eSpace)); }