Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:58:23 PM (13 years ago)
Author:
rgrieder
Message:

Merged revisions 7978 - 8096 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/src/external/bullet/BulletDynamics/Character/btKinematicCharacterController.h

    r5781 r8284  
    1414*/
    1515
     16
    1617#ifndef KINEMATIC_CHARACTER_CONTROLLER_H
    1718#define KINEMATIC_CHARACTER_CONTROLLER_H
     
    2021
    2122#include "btCharacterControllerInterface.h"
     23
     24#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
     25
    2226
    2327class btCollisionShape;
     
    3337{
    3438protected:
     39
    3540        btScalar m_halfHeight;
    3641       
     
    3843        btConvexShape*  m_convexShape;//is also in m_ghostObject, but it needs to be convex, so we store it here to avoid upcast
    3944       
     45        btScalar m_verticalVelocity;
     46        btScalar m_verticalOffset;
    4047        btScalar m_fallSpeed;
    4148        btScalar m_jumpSpeed;
    4249        btScalar m_maxJumpHeight;
     50        btScalar m_maxSlopeRadians; // Slope angle that is set (used for returning the exact value)
     51        btScalar m_maxSlopeCosine;  // Cosine equivalent of m_maxSlopeRadians (calculated once when set, for optimization)
     52        btScalar m_gravity;
    4353
    4454        btScalar m_turnAngle;
     
    5060        ///this is the desired walk direction, set by the user
    5161        btVector3       m_walkDirection;
     62        btVector3       m_normalizedDirection;
    5263
    5364        //some internal variables
     
    6273        btVector3 m_touchingNormal;
    6374
     75        bool  m_wasOnGround;
     76        bool  m_wasJumping;
    6477        bool    m_useGhostObjectSweepTest;
     78        bool    m_useWalkDirection;
     79        btScalar        m_velocityTimeInterval;
     80        int m_upAxis;
    6581
    66         int m_upAxis;
    67        
     82        static btVector3* getUpAxisDirections();
     83
    6884        btVector3 computeReflectionDirection (const btVector3& direction, const btVector3& normal);
    6985        btVector3 parallelComponent (const btVector3& direction, const btVector3& normal);
     
    99115        }
    100116
    101         virtual void    setWalkDirection(const btVector3& walkDirection)
    102         {
    103                 m_walkDirection = walkDirection;
    104         }
     117        /// This should probably be called setPositionIncrementPerSimulatorStep.
     118        /// This is neither a direction nor a velocity, but the amount to
     119        ///     increment the position each simulation iteration, regardless
     120        ///     of dt.
     121        /// This call will reset any velocity set by setVelocityForTimeInterval().
     122        virtual void    setWalkDirection(const btVector3& walkDirection);
     123
     124        /// Caller provides a velocity with which the character should move for
     125        ///     the given time period.  After the time period, velocity is reset
     126        ///     to zero.
     127        /// This call will reset any walk direction set by setWalkDirection().
     128        /// Negative time intervals will result in no motion.
     129        virtual void setVelocityForTimeInterval(const btVector3& velocity,
     130                                btScalar timeInterval);
    105131
    106132        void reset ();
     
    114140        void setMaxJumpHeight (btScalar maxJumpHeight);
    115141        bool canJump () const;
     142
    116143        void jump ();
     144
     145        void setGravity(btScalar gravity);
     146        btScalar getGravity() const;
     147
     148        /// The max slope determines the maximum angle that the controller can walk up.
     149        /// The slope angle is measured in radians.
     150        void setMaxSlope(btScalar slopeRadians);
     151        btScalar getMaxSlope() const;
    117152
    118153        btPairCachingGhostObject* getGhostObject();
Note: See TracChangeset for help on using the changeset viewer.