Exemplo n.º 1
0
        /// <summary>
        /// Returns the world position and rotation of the road user with handle index.
        /// </summary>
        /// <param name="openDriveIndex"></param>
        /// <returns></returns>
        public static WorldPose GetWorldPose(int openDriveIndex)
        {
            WorldPose pose = new WorldPose();

            RoadManagerLibraryCS.GetPositionData(openDriveIndex, ref tmpPosData);
            pose.position = GetUnityPosition(tmpPosData);
            pose.rotation = GetUnityRotation(tmpPosData);

            return(pose);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the world position and rotation of the road user with handle index.
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        public static WorldPose GetWorldPose(int index)
        {
            WorldPose pose = new WorldPose();

            GetOpenDrivePositionData(index, ref tmpPosData);
            pose.position.x = -tmpPosData.y;
            pose.position.y = tmpPosData.z;
            pose.position.z = tmpPosData.x;

            pose.rotation = Quaternion.Euler(tmpPosData.p * RAD2DEG, -tmpPosData.h * RAD2DEG, tmpPosData.r * RAD2DEG);

            return(pose);
        }