Esempio n. 1
0
        unsafe internal void UpdateDataFromLibrary()
        {
            if (bodyID == IntPtr.Zero)
            {
                return;
            }

            bool sleeping = Ode.dBodyIsEnabled(bodyID) == 0;

            if (!sleeping || !Sleeping)
            {
                Vec3 pos;
                Convert.ToNet(Ode.dBodyGetPosition_(bodyID), out pos);
                Quat rot;
                Convert.ToNet(Ode.dBodyGetQuaternion_(bodyID), out rot);
                Vec3 linearVel;
                Convert.ToNet(Ode.dBodyGetLinearVel_(bodyID), out linearVel);
                Vec3 angularVel;
                Convert.ToNet(Ode.dBodyGetAngularVel_(bodyID), out angularVel);

                UpdateDataFromLibrary(ref pos, ref rot, ref linearVel, ref angularVel, sleeping);
            }
        }