Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2011, 5:07:42 AM (13 years ago)
Author:
rgrieder
Message:

Updated Bullet from v2.77 to v2.78.
(I'm not going to make a branch for that since the update from 2.74 to 2.77 hasn't been tested that much either).

You will HAVE to do a complete RECOMPILE! I tested with MSVC and MinGW and they both threw linker errors at me.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h

    r8351 r8393  
    1414*/
    1515
    16 #ifndef TYPED_CONSTRAINT_H
    17 #define TYPED_CONSTRAINT_H
     16#ifndef BT_TYPED_CONSTRAINT_H
     17#define BT_TYPED_CONSTRAINT_H
    1818
    1919class btRigidBody;
    2020#include "LinearMath/btScalar.h"
    2121#include "btSolverConstraint.h"
    22 #include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"
    2322
    2423class btSerializer;
    2524
     25//Don't change any of the existing enum values, so add enum types at the end for serialization compatibility
    2626enum btTypedConstraintType
    2727{
    28         POINT2POINT_CONSTRAINT_TYPE=MAX_CONTACT_MANIFOLD_TYPE+1,
     28        POINT2POINT_CONSTRAINT_TYPE=3,
    2929        HINGE_CONSTRAINT_TYPE,
    3030        CONETWIST_CONSTRAINT_TYPE,
    3131        D6_CONSTRAINT_TYPE,
    3232        SLIDER_CONSTRAINT_TYPE,
    33         CONTACT_CONSTRAINT_TYPE
     33        CONTACT_CONSTRAINT_TYPE,
     34        D6_SPRING_CONSTRAINT_TYPE,
     35        MAX_CONSTRAINT_TYPE
    3436};
    3537
     
    6062                void* m_userConstraintPtr;
    6163        };
     64
     65        btScalar        m_breakingImpulseThreshold;
     66        bool            m_isEnabled;
     67
    6268
    6369        bool m_needsFeedback;
     
    154160        }
    155161
     162
     163        btScalar        getBreakingImpulseThreshold() const
     164        {
     165                return  m_breakingImpulseThreshold;
     166        }
     167
     168        void    setBreakingImpulseThreshold(btScalar threshold)
     169        {
     170                m_breakingImpulseThreshold = threshold;
     171        }
     172
     173        bool    isEnabled() const
     174        {
     175                return m_isEnabled;
     176        }
     177
     178        void    setEnabled(bool enabled)
     179        {
     180                m_isEnabled=enabled;
     181        }
     182
     183
    156184        ///internal method used by the constraint solver, don't use them directly
    157185        virtual void    solveConstraintObsolete(btRigidBody& /*bodyA*/,btRigidBody& /*bodyB*/,btScalar  /*timeStep*/) {};
     
    312340
    313341
    314 
    315 #endif //TYPED_CONSTRAINT_H
     342class btAngularLimit
     343{
     344private:
     345        btScalar
     346                m_center,
     347                m_halfRange,
     348                m_softness,
     349                m_biasFactor,
     350                m_relaxationFactor,
     351                m_correction,
     352                m_sign;
     353
     354        bool
     355                m_solveLimit;
     356
     357public:
     358        /// Default constructor initializes limit as inactive, allowing free constraint movement
     359        btAngularLimit()
     360                :m_center(0.0f),
     361                m_halfRange(-1.0f),
     362                m_softness(0.9f),
     363                m_biasFactor(0.3f),
     364                m_relaxationFactor(1.0f),
     365                m_correction(0.0f),
     366                m_sign(0.0f),
     367                m_solveLimit(false)
     368        {}
     369
     370        /// Sets all limit's parameters.
     371        /// When low > high limit becomes inactive.
     372        /// When high - low > 2PI limit is ineffective too becouse no angle can exceed the limit
     373        void set(btScalar low, btScalar high, btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f);
     374
     375        /// Checks conastaint angle against limit. If limit is active and the angle violates the limit
     376        /// correction is calculated.
     377        void test(const btScalar angle);
     378
     379        /// Returns limit's softness
     380        inline btScalar getSoftness() const
     381        {
     382                return m_softness;
     383        }
     384
     385        /// Returns limit's bias factor
     386        inline btScalar getBiasFactor() const
     387        {
     388                return m_biasFactor;
     389        }
     390
     391        /// Returns limit's relaxation factor
     392        inline btScalar getRelaxationFactor() const
     393        {
     394                return m_relaxationFactor;
     395        }
     396
     397        /// Returns correction value evaluated when test() was invoked
     398        inline btScalar getCorrection() const
     399        {
     400                return m_correction;
     401        }
     402
     403        /// Returns sign value evaluated when test() was invoked
     404        inline btScalar getSign() const
     405        {
     406                return m_sign;
     407        }
     408
     409        /// Gives half of the distance between min and max limit angle
     410        inline btScalar getHalfRange() const
     411        {
     412                return m_halfRange;
     413        }
     414
     415        /// Returns true when the last test() invocation recognized limit violation
     416        inline bool isLimit() const
     417        {
     418                return m_solveLimit;
     419        }
     420
     421        /// Checks given angle against limit. If limit is active and angle doesn't fit it, the angle
     422        /// returned is modified so it equals to the limit closest to given angle.
     423        void fit(btScalar& angle) const;
     424
     425        /// Returns correction value multiplied by sign value
     426        btScalar getError() const;
     427
     428        btScalar getLow() const;
     429
     430        btScalar getHigh() const;
     431
     432};
     433
     434
     435
     436#endif //BT_TYPED_CONSTRAINT_H
Note: See TracChangeset for help on using the changeset viewer.