コード例 #1
0
        /// Set absolute coordinates  and update auxiliary variables
        /// Also, current position becomes the 'resting position' coordinates
        /// for the current time.
        public void Impose_Abs_Coord(ChCoordsys m_coord)
        {
            ChBody my_body;

            my_body = GetBody();

            ChCoordsys csys;// = new ChCoordsys(new ChVector(0, 0, 0), new ChQuaternion(1, 0, 0, 0));//ChCoordsys.CSYSNULL;

            // coordsys: transform the representation from the parent reference frame
            // to the local reference frame.

            csys.pos = ChTransform <double> .TransformParentToLocal(m_coord.pos, my_body.BodyFrame.GetCoord().pos, my_body.BodyFrame.GetA());

            csys.rot = ChQuaternion.Qcross(ChQuaternion.Qconjugate(my_body.BodyFrame.GetCoord().rot), m_coord.rot);
            // apply the imposition on local  coordinate and resting coordinate:
            Impose_Rel_Coord(csys);
        }
コード例 #2
0
 public ChVector TransformPointParentToLocal(ChVector parent)
 {
     return(ChTransform <Real> .TransformParentToLocal(parent, coord.pos, Amatrix));
 }
コード例 #3
0
 public virtual ChVector TransformPointLocalToParent(ChVector local)
 {
     return(ChTransform <Real> .TransformLocalToParent(local, coord.pos, Amatrix));
 }