Example #1
0
        // public void SetRot(double e0, double e1, double e2, double e3)
        //{

        /* rot.Sete0(e0);
         * rot.Sete1(e1);
         * rot.Sete2(e2);
         * rot.Sete3(e3);
         * ChCoordsys_SetRot(m_ChCoordsys, rot.m_ChQuaternion);*/
        // }

        /*   public ChVector TransformLocalToParent(ChVector vec)
         * {
         *     ChVector temp = new ChVector(0, 0, 0);
         *     temp.m_ChVector = ChCoordsys_TransformLocalToParent(m_ChCoordsys, vec.m_ChVector);
         *     temp.data[0] = temp.GetX();
         *     temp.data[1] = temp.GetY();
         *     temp.data[2] = temp.GetZ();
         *
         *     return temp;
         * }*/

        /*   public ChVector TransformDirectionParentToLocal(ChVector vec)
         * {
         *     ChVector temp = new ChVector(0, 0, 0);
         *     temp.m_ChVector = ChCoordsys_TransformDirectionParentToLocal(m_ChCoordsys, vec.m_ChVector);
         *     temp.data[0] = temp.GetX();
         *     temp.data[1] = temp.GetY();
         *     temp.data[2] = temp.GetZ();
         *
         *     return temp;
         * }*/

        /*  public ChVector TransformDirectionLocalToParent(ChVector vec)
         * {
         *    ChVector temp = new ChVector(0, 0, 0);
         *    temp.m_ChVector = ChCoordsys_TransformDirectionLocalToParent(m_ChCoordsys, vec.m_ChVector);
         *    temp.data[0] = temp.GetX();
         *    temp.data[1] = temp.GetY();
         *    temp.data[2] = temp.GetZ();
         *
         *    return temp;
         * }*/

        // FUNCTIONS FOR COORDINATE TRANSFORMATIONS

        /// This function transforms a point from the local coordinate
        /// system to the parent coordinate system. Relative position of local respect
        /// to parent is given by this coordys, i.e. 'origin' translation and 'alignment' quaternion.
        /// \return The point in parent coordinate, as parent=origin +q*[0,(local)]*q'
        public ChVector TransformLocalToParent(ChVector local)
        {
            return(pos + rot.Rotate(local));
        }