Introduced btActionInterface. This makes it easier to extend user-defined actions, such as vehicles and characters.
btRaycastVehicle and btKinematicCharacterController are derived from btActionInterface now. Some cosmetic cleanup: changed sourceforce/sf.net url to bulletphysics.com.
This commit is contained in:
@@ -19,15 +19,13 @@
|
||||
#include "btVehicleRaycaster.h"
|
||||
#include "btWheelInfo.h"
|
||||
#include "LinearMath/btMinMax.h"
|
||||
|
||||
|
||||
#include "LinearMath/btIDebugDraw.h"
|
||||
#include "BulletDynamics/ConstraintSolver/btContactConstraint.h"
|
||||
|
||||
static btRigidBody s_fixedObject( 0,0,0);
|
||||
|
||||
btRaycastVehicle::btRaycastVehicle(const btVehicleTuning& tuning,btRigidBody* chassis, btVehicleRaycaster* raycaster )
|
||||
: btTypedConstraint(VEHICLE_CONSTRAINT_TYPE),
|
||||
m_vehicleRaycaster(raycaster),
|
||||
:m_vehicleRaycaster(raycaster),
|
||||
m_pitchControl(btScalar(0.))
|
||||
{
|
||||
m_chassisBody = chassis;
|
||||
@@ -704,6 +702,36 @@ void btRaycastVehicle::updateFriction(btScalar timeStep)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void btRaycastVehicle::debugDraw(btIDebugDraw* debugDrawer)
|
||||
{
|
||||
|
||||
for (int v=0;v<this->getNumWheels();v++)
|
||||
{
|
||||
btVector3 wheelColor(0,255,255);
|
||||
if (getWheelInfo(v).m_raycastInfo.m_isInContact)
|
||||
{
|
||||
wheelColor.setValue(0,0,255);
|
||||
} else
|
||||
{
|
||||
wheelColor.setValue(255,0,255);
|
||||
}
|
||||
|
||||
btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.getOrigin();
|
||||
|
||||
btVector3 axle = btVector3(
|
||||
getWheelInfo(v).m_worldTransform.getBasis()[0][getRightAxis()],
|
||||
getWheelInfo(v).m_worldTransform.getBasis()[1][getRightAxis()],
|
||||
getWheelInfo(v).m_worldTransform.getBasis()[2][getRightAxis()]);
|
||||
|
||||
//debug wheels (cylinders)
|
||||
debugDrawer->drawLine(wheelPosWS,wheelPosWS+axle,wheelColor);
|
||||
debugDrawer->drawLine(wheelPosWS,getWheelInfo(v).m_raycastInfo.m_contactPointWS,wheelColor);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3& to, btVehicleRaycasterResult& result)
|
||||
{
|
||||
// RayResultCallback& resultCallback;
|
||||
@@ -727,3 +755,4 @@ void* btDefaultVehicleRaycaster::castRay(const btVector3& from,const btVector3&
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user