Changeset 2908 for code/branches/questsystem5/src/bullet/BulletDynamics/Vehicle/btRaycastVehicle.cpp
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/BulletDynamics/Vehicle/btRaycastVehicle.cpp
r2907 r2908 20 20 #include "btWheelInfo.h" 21 21 #include "LinearMath/btMinMax.h" 22 #include "LinearMath/btIDebugDraw.h" 22 23 23 24 #include "BulletDynamics/ConstraintSolver/btContactConstraint.h" 24 25 … … 26 27 27 28 btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster ) 28 :m_vehicleRaycaster(raycaster), 29 : btTypedConstraint(VEHICLE_CONSTRAINT_TYPE), 30 m_vehicleRaycaster(raycaster), 29 31 m_pitchControl(btScalar(0.)) 30 32 { … … 86 88 const btTransform& btRaycastVehicle::getWheelTransformWS( int wheelIndex ) const 87 89 { 88 btAssert(wheelIndex < getNumWheels());90 assert(wheelIndex < getNumWheels()); 89 91 const btWheelInfo& wheel = m_wheelInfo[wheelIndex]; 90 92 return wheel.m_worldTransform; … … 174 176 btVehicleRaycaster::btVehicleRaycasterResult rayResults; 175 177 176 btAssert(m_vehicleRaycaster);178 assert(m_vehicleRaycaster); 177 179 178 180 void* object = m_vehicleRaycaster->castRay(source,target,rayResults); … … 358 360 void btRaycastVehicle::setSteeringValue(btScalar steering,int wheel) 359 361 { 360 btAssert(wheel>=0 && wheel < getNumWheels());362 assert(wheel>=0 && wheel < getNumWheels()); 361 363 362 364 btWheelInfo& wheelInfo = getWheelInfo(wheel); … … 374 376 void btRaycastVehicle::applyEngineForce(btScalar force, int wheel) 375 377 { 376 btAssert(wheel>=0 && wheel < getNumWheels());378 assert(wheel>=0 && wheel < getNumWheels()); 377 379 btWheelInfo& wheelInfo = getWheelInfo(wheel); 378 380 wheelInfo.m_engineForce = force; … … 703 705 704 706 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 } else716 {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 735 707 void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result) 736 708 { … … 756 728 return 0; 757 729 } 758
Note: See TracChangeset
for help on using the changeset viewer.