Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2008, 11:45:51 PM (15 years ago)
Author:
rgrieder
Message:

Updated to Bullet 2.73 (first part).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/physics/src/bullet/LinearMath/btTransform.h

    r2192 r2430  
    2222
    2323
    24 ///The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
    25 ///It can be used in combination with btVector3, btQuaternion and btMatrix3x3 linear algebra classes.
     24/**@brief The btTransform class supports rigid transforms with only translation and rotation and no scaling/shear.
     25 *It can be used in combination with btVector3, btQuaternion and btMatrix3x3 linear algebra classes. */
    2626class btTransform {
    2727       
     
    2929public:
    3030       
    31        
     31  /**@brief No initialization constructor */
    3232        btTransform() {}
    33 
     33  /**@brief Constructor from btQuaternion (optional btVector3 )
     34   * @param q Rotation from quaternion
     35   * @param c Translation from Vector (default 0,0,0) */
    3436        explicit SIMD_FORCE_INLINE btTransform(const btQuaternion& q,
    3537                const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0)))
     
    3840        {}
    3941
     42  /**@brief Constructor from btMatrix3x3 (optional btVector3)
     43   * @param b Rotation from Matrix
     44   * @param c Translation from Vector default (0,0,0)*/
    4045        explicit SIMD_FORCE_INLINE btTransform(const btMatrix3x3& b,
    4146                const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0)))
     
    4348                m_origin(c)
    4449        {}
    45 
     50  /**@brief Copy constructor */
    4651        SIMD_FORCE_INLINE btTransform (const btTransform& other)
    4752                : m_basis(other.m_basis),
     
    4954        {
    5055        }
    51 
     56  /**@brief Assignment Operator */
    5257        SIMD_FORCE_INLINE btTransform& operator=(const btTransform& other)
    5358        {
     
    5863
    5964
     65  /**@brief Set the current transform as the value of the product of two transforms
     66   * @param t1 Transform 1
     67   * @param t2 Transform 2
     68   * This = Transform1 * Transform2 */
    6069                SIMD_FORCE_INLINE void mult(const btTransform& t1, const btTransform& t2) {
    6170                        m_basis = t1.m_basis * t2.m_basis;
     
    7079                */
    7180
    72 
     81/**@brief Return the transform of the vector */
    7382        SIMD_FORCE_INLINE btVector3 operator()(const btVector3& x) const
    7483        {
     
    7887        }
    7988
     89  /**@brief Return the transform of the vector */
    8090        SIMD_FORCE_INLINE btVector3 operator*(const btVector3& x) const
    8191        {
     
    8393        }
    8494
     95  /**@brief Return the transform of the btQuaternion */
     96        SIMD_FORCE_INLINE btQuaternion operator*(const btQuaternion& q) const
     97        {
     98                return getRotation() * q;
     99        }
     100
     101  /**@brief Return the basis matrix for the rotation */
    85102        SIMD_FORCE_INLINE btMatrix3x3&       getBasis()          { return m_basis; }
     103  /**@brief Return the basis matrix for the rotation */
    86104        SIMD_FORCE_INLINE const btMatrix3x3& getBasis()    const { return m_basis; }
    87105
     106  /**@brief Return the origin vector translation */
    88107        SIMD_FORCE_INLINE btVector3&         getOrigin()         { return m_origin; }
     108  /**@brief Return the origin vector translation */
    89109        SIMD_FORCE_INLINE const btVector3&   getOrigin()   const { return m_origin; }
    90110
     111  /**@brief Return a quaternion representing the rotation */
    91112        btQuaternion getRotation() const {
    92113                btQuaternion q;
     
    96117       
    97118       
     119  /**@brief Set from an array
     120   * @param m A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation */
    98121        void setFromOpenGLMatrix(const btScalar *m)
    99122        {
     
    102125        }
    103126
     127  /**@brief Fill an array representation
     128   * @param m A pointer to a 15 element array (12 rotation(row major padded on the right by 1), and 3 translation */
    104129        void getOpenGLMatrix(btScalar *m) const
    105130        {
     
    111136        }
    112137
     138  /**@brief Set the translational element
     139   * @param origin The vector to set the translation to */
    113140        SIMD_FORCE_INLINE void setOrigin(const btVector3& origin)
    114141        {
     
    119146
    120147
    121 
     148  /**@brief Set the rotational element by btMatrix3x3 */
    122149        SIMD_FORCE_INLINE void setBasis(const btMatrix3x3& basis)
    123150        {
     
    125152        }
    126153
     154  /**@brief Set the rotational element by btQuaternion */
    127155        SIMD_FORCE_INLINE void setRotation(const btQuaternion& q)
    128156        {
     
    131159
    132160
    133 
     161  /**@brief Set this transformation to the identity */
    134162        void setIdentity()
    135163        {
     
    138166        }
    139167
    140        
     168  /**@brief Multiply this Transform by another(this = this * another)
     169   * @param t The other transform */
    141170        btTransform& operator*=(const btTransform& t)
    142171        {
     
    146175        }
    147176
     177  /**@brief Return the inverse of this transform */
    148178        btTransform inverse() const
    149179        {
     
    152182        }
    153183
     184  /**@brief Return the inverse of this transform times the other transform
     185   * @param t The other transform
     186   * return this.inverse() * the other */
    154187        btTransform inverseTimes(const btTransform& t) const; 
    155188
     189  /**@brief Return the product of this transform and the other */
    156190        btTransform operator*(const btTransform& t) const;
    157191
     192  /**@brief Return an identity transform */
    158193        static btTransform      getIdentity()
    159194        {
     
    164199       
    165200private:
    166 
     201  ///Storage for the rotation
    167202        btMatrix3x3 m_basis;
     203  ///Storage for the translation
    168204        btVector3   m_origin;
    169205};
     
    192228}
    193229
     230/**@brief Test if two transforms have all elements equal */
    194231SIMD_FORCE_INLINE bool operator==(const btTransform& t1, const btTransform& t2)
    195232{
Note: See TracChangeset for help on using the changeset viewer.