Exemplo n.º 1
0
        // Reset this constraint making sure it has all its internal structures
        //    recomputed and is enabled and ready to go.
        public virtual bool RecomputeConstraintVariables(float mass)
        {
            bool ret = false;

            if (m_enabled)
            {
                ret = CalculateTransforms();
                if (ret)
                {
                    // Setting an object's mass to zero (making it static like when it's selected)
                    //     automatically disables the constraints.
                    // If the link is enabled, be sure to set the constraint itself to enabled.
                    BulletSimAPI.SetConstraintEnable2(m_constraint.ptr, m_world.physicsScene.NumericBool(true));
                }
                else
                {
                    m_world.physicsScene.Logger.ErrorFormat("[BULLETSIM CONSTRAINT] CalculateTransforms failed. A={0}, B={1}", Body1.ID, Body2.ID);
                }
            }
            return(ret);
        }