Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (15 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/bullet/BulletDynamics/Vehicle/btRaycastVehicle.cpp

    r2907 r2908  
    2020#include "btWheelInfo.h"
    2121#include "LinearMath/btMinMax.h"
    22 #include "LinearMath/btIDebugDraw.h"
     22
     23
    2324#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
    2425
     
    2627
    2728btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis,  btVehicleRaycaster* raycaster )
    28 :m_vehicleRaycaster(raycaster),
     29: btTypedConstraint(VEHICLE_CONSTRAINT_TYPE),
     30m_vehicleRaycaster(raycaster),
    2931m_pitchControl(btScalar(0.))
    3032{
     
    8688const btTransform&      btRaycastVehicle::getWheelTransformWS( int wheelIndex ) const
    8789{
    88         btAssert(wheelIndex < getNumWheels());
     90        assert(wheelIndex < getNumWheels());
    8991        const btWheelInfo& wheel = m_wheelInfo[wheelIndex];
    9092        return wheel.m_worldTransform;
     
    174176        btVehicleRaycaster::btVehicleRaycasterResult    rayResults;
    175177
    176         btAssert(m_vehicleRaycaster);
     178        assert(m_vehicleRaycaster);
    177179
    178180        void* object = m_vehicleRaycaster->castRay(source,target,rayResults);
     
    358360void    btRaycastVehicle::setSteeringValue(btScalar steering,int wheel)
    359361{
    360         btAssert(wheel>=0 && wheel < getNumWheels());
     362        assert(wheel>=0 && wheel < getNumWheels());
    361363
    362364        btWheelInfo& wheelInfo = getWheelInfo(wheel);
     
    374376void    btRaycastVehicle::applyEngineForce(btScalar force, int wheel)
    375377{
    376         btAssert(wheel>=0 && wheel < getNumWheels());
     378        assert(wheel>=0 && wheel < getNumWheels());
    377379        btWheelInfo& wheelInfo = getWheelInfo(wheel);
    378380        wheelInfo.m_engineForce = force;
     
    703705
    704706
    705 
    706 void    btRaycastVehicle::debugDraw(btIDebugDraw* debugDrawer)
    707 {
    708 
    709         for (int v=0;v<this->getNumWheels();v++)
    710         {
    711                 btVector3 wheelColor(0,255,255);
    712                 if (getWheelInfo(v).m_raycastInfo.m_isInContact)
    713                 {
    714                         wheelColor.setValue(0,0,255);
    715                 } else
    716                 {
    717                         wheelColor.setValue(255,0,255);
    718                 }
    719 
    720                 btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.getOrigin();
    721 
    722                 btVector3 axle = btVector3(     
    723                         getWheelInfo(v).m_worldTransform.getBasis()[0][getRightAxis()],
    724                         getWheelInfo(v).m_worldTransform.getBasis()[1][getRightAxis()],
    725                         getWheelInfo(v).m_worldTransform.getBasis()[2][getRightAxis()]);
    726 
    727                 //debug wheels (cylinders)
    728                 debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor);
    729                 debugDrawer->drawLine(wheelPosWS,getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor);
    730 
    731         }
    732 }
    733 
    734 
    735707void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
    736708{
     
    756728        return 0;
    757729}
    758 
  • code/branches/questsystem5/src/bullet/BulletDynamics/Vehicle/btRaycastVehicle.h

    r2907 r2908  
    1818#include "LinearMath/btAlignedObjectArray.h"
    1919#include "btWheelInfo.h"
    20 #include "BulletDynamics/Dynamics/btActionInterface.h"
    2120
    2221class btVehicleTuning;
    2322
    2423///rayCast vehicle, very special constraint that turn a rigidbody into a vehicle.
    25 class btRaycastVehicle : public btActionInterface
     24class btRaycastVehicle : public btTypedConstraint
    2625{
    2726
     
    7574        virtual ~btRaycastVehicle() ;
    7675
    77 
    78         ///btActionInterface interface
    79         virtual void updateAction( btCollisionWorld* collisionWorld, btScalar step)
    80         {
    81                 updateVehicle(step);
    82         }
    83        
    84 
    85         ///btActionInterface interface
    86         void    debugDraw(btIDebugDraw* debugDrawer);
    87                        
     76               
    8877        const btTransform& getChassisWorldTransform() const;
    8978       
     
    9180
    9281        virtual void updateVehicle(btScalar step);
    93        
    94        
     82
    9583        void resetSuspension();
    9684
     
    188176        }
    189177
     178        virtual void    buildJacobian()
     179        {
     180                //not yet
     181        }
     182
     183        virtual void    solveConstraint(btScalar        timeStep)
     184        {
     185                (void)timeStep;
     186                //not yet
     187        }
    190188
    191189
Note: See TracChangeset for help on using the changeset viewer.