Merge branch 'master' of https://github.com/erwincoumans/bullet3
This commit is contained in:
@@ -1035,6 +1035,7 @@ void NN3DWalkersExample::drawMarkings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void NN3DWalkersExample::printWalkerConfigs(){
|
void NN3DWalkersExample::printWalkerConfigs(){
|
||||||
|
#if 0
|
||||||
char configString[25 + NUM_WALKERS*BODYPART_COUNT*JOINT_COUNT*(3+15+1) + NUM_WALKERS*4 + 1]; // 15 precision + [],\n
|
char configString[25 + NUM_WALKERS*BODYPART_COUNT*JOINT_COUNT*(3+15+1) + NUM_WALKERS*4 + 1]; // 15 precision + [],\n
|
||||||
char* runner = configString;
|
char* runner = configString;
|
||||||
sprintf(runner,"Population configuration:");
|
sprintf(runner,"Population configuration:");
|
||||||
@@ -1058,4 +1059,5 @@ void NN3DWalkersExample::printWalkerConfigs(){
|
|||||||
}
|
}
|
||||||
runner[0] = '\0';
|
runner[0] = '\0';
|
||||||
b3Printf(configString);
|
b3Printf(configString);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ pixelHeight = 240
|
|||||||
nearPlane = 0.01
|
nearPlane = 0.01
|
||||||
farPlane = 1000
|
farPlane = 1000
|
||||||
lightDirection = [0,1,0]
|
lightDirection = [0,1,0]
|
||||||
|
lightColor = [1,1,1]#optional argument
|
||||||
fov = 60
|
fov = 60
|
||||||
|
|
||||||
#img_arr = pybullet.renderImage(pixelWidth, pixelHeight)
|
#img_arr = pybullet.renderImage(pixelWidth, pixelHeight)
|
||||||
@@ -28,7 +29,7 @@ for pitch in range (0,360,10) :
|
|||||||
viewMatrix = pybullet.computeViewMatrixFromYawPitchRoll(camTargetPos, camDistance, yaw, pitch, roll, upAxisIndex)
|
viewMatrix = pybullet.computeViewMatrixFromYawPitchRoll(camTargetPos, camDistance, yaw, pitch, roll, upAxisIndex)
|
||||||
aspect = pixelWidth / pixelHeight;
|
aspect = pixelWidth / pixelHeight;
|
||||||
projectionMatrix = pybullet.computeProjectionMatrixFOV(fov, aspect, nearPlane, farPlane);
|
projectionMatrix = pybullet.computeProjectionMatrixFOV(fov, aspect, nearPlane, farPlane);
|
||||||
img_arr = pybullet.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, lightDirection)
|
img_arr = pybullet.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, lightDirection,lightColor)
|
||||||
w=img_arr[0]
|
w=img_arr[0]
|
||||||
h=img_arr[1]
|
h=img_arr[1]
|
||||||
rgb=img_arr[2]
|
rgb=img_arr[2]
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &po
|
|||||||
btScalar radiusWithThreshold = radius + contactBreakingThreshold;
|
btScalar radiusWithThreshold = radius + contactBreakingThreshold;
|
||||||
|
|
||||||
btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
|
btVector3 normal = (vertices[1]-vertices[0]).cross(vertices[2]-vertices[0]);
|
||||||
normal.normalize();
|
normal.safeNormalize();
|
||||||
btVector3 p1ToCentre = sphereCenter - vertices[0];
|
btVector3 p1ToCentre = sphereCenter - vertices[0];
|
||||||
btScalar distanceFromPlane = p1ToCentre.dot(normal);
|
btScalar distanceFromPlane = p1ToCentre.dot(normal);
|
||||||
|
|
||||||
|
|||||||
@@ -292,6 +292,9 @@ void btCompoundCollisionAlgorithm::processCollision (const btCollisionObjectWrap
|
|||||||
btTransform otherInCompoundSpace;
|
btTransform otherInCompoundSpace;
|
||||||
otherInCompoundSpace = colObjWrap->getWorldTransform().inverse() * otherObjWrap->getWorldTransform();
|
otherInCompoundSpace = colObjWrap->getWorldTransform().inverse() * otherObjWrap->getWorldTransform();
|
||||||
otherObjWrap->getCollisionShape()->getAabb(otherInCompoundSpace,localAabbMin,localAabbMax);
|
otherObjWrap->getCollisionShape()->getAabb(otherInCompoundSpace,localAabbMin,localAabbMax);
|
||||||
|
btVector3 extraExtends(resultOut->m_closestPointDistanceThreshold, resultOut->m_closestPointDistanceThreshold, resultOut->m_closestPointDistanceThreshold);
|
||||||
|
localAabbMin -= extraExtends;
|
||||||
|
localAabbMax += extraExtends;
|
||||||
|
|
||||||
const ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
|
const ATTRIBUTE_ALIGNED16(btDbvtVolume) bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
|
||||||
//process all children, that overlap with the given AABB bounds
|
//process all children, that overlap with the given AABB bounds
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void btSphereTriangleCollisionAlgorithm::processCollision (const btCollisionObje
|
|||||||
|
|
||||||
/// report a contact. internally this will be kept persistent, and contact reduction is done
|
/// report a contact. internally this will be kept persistent, and contact reduction is done
|
||||||
resultOut->setPersistentManifold(m_manifoldPtr);
|
resultOut->setPersistentManifold(m_manifoldPtr);
|
||||||
SphereTriangleDetector detector(sphere,triangle, m_manifoldPtr->getContactBreakingThreshold());
|
SphereTriangleDetector detector(sphere,triangle, m_manifoldPtr->getContactBreakingThreshold()+ resultOut->m_closestPointDistanceThreshold);
|
||||||
|
|
||||||
btDiscreteCollisionDetectorInterface::ClosestPointInput input;
|
btDiscreteCollisionDetectorInterface::ClosestPointInput input;
|
||||||
input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);///@todo: tighter bounds
|
input.m_maximumDistanceSquared = btScalar(BT_LARGE_FLOAT);///@todo: tighter bounds
|
||||||
|
|||||||
Reference in New Issue
Block a user