Merge pull request #1687 from erwincoumans/master

fix VR controllers only visible in one eye
This commit is contained in:
erwincoumans
2018-05-16 14:53:06 -07:00
committed by GitHub
6 changed files with 43 additions and 29 deletions

View File

@@ -1618,7 +1618,7 @@ void GLInstancingRenderer::renderScene()
{
renderSceneInternal(B3_CREATE_SHADOWMAP_RENDERMODE);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
if (m_planeReflectionShapeIndex>=0)
{

View File

@@ -119,9 +119,9 @@ void Win32OpenGLWindow::closeWindow()
void Win32OpenGLWindow::startRendering()
{
pumpMessage();
//don't clear all 3 buffers because some AMD drivers are buggy
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
//glCullFace(GL_BACK);

View File

@@ -1,10 +1,10 @@
#include "PhysicsClientSharedMemory.h"
#include "PosixSharedMemory.h"
#include "Win32SharedMemory.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "LinearMath/btVector3.h"
#include "Bullet3Common/b3AlignedObjectArray.h"
#include "Bullet3Common/b3Vector3.h"
#include <string.h>
#include "Bullet3Common/b3HashMap.h"
#include "Bullet3Common/b3Logging.h"
#include "../Utils/b3ResourcePath.h"
#include "../../Extras/Serialize/BulletFileLoader/btBulletFile.h"
@@ -19,7 +19,7 @@
struct BodyJointInfoCache
{
std::string m_baseName;
btAlignedObjectArray<b3JointInfo> m_jointInfo;
b3AlignedObjectArray<b3JointInfo> m_jointInfo;
std::string m_bodyName;
};
@@ -28,32 +28,32 @@ struct PhysicsClientSharedMemoryInternalData {
bool m_ownsSharedMemory;
SharedMemoryBlock* m_testBlock1;
btHashMap<btHashInt,BodyJointInfoCache*> m_bodyJointMap;
btHashMap<btHashInt,b3UserConstraint> m_userConstraintInfoMap;
b3HashMap<b3HashInt,BodyJointInfoCache*> m_bodyJointMap;
b3HashMap<b3HashInt,b3UserConstraint> m_userConstraintInfoMap;
btAlignedObjectArray<TmpFloat3> m_debugLinesFrom;
btAlignedObjectArray<TmpFloat3> m_debugLinesTo;
btAlignedObjectArray<TmpFloat3> m_debugLinesColor;
b3AlignedObjectArray<TmpFloat3> m_debugLinesFrom;
b3AlignedObjectArray<TmpFloat3> m_debugLinesTo;
b3AlignedObjectArray<TmpFloat3> m_debugLinesColor;
int m_cachedCameraPixelsWidth;
int m_cachedCameraPixelsHeight;
btAlignedObjectArray<unsigned char> m_cachedCameraPixelsRGBA;
btAlignedObjectArray<float> m_cachedCameraDepthBuffer;
btAlignedObjectArray<int> m_cachedSegmentationMaskBuffer;
b3AlignedObjectArray<unsigned char> m_cachedCameraPixelsRGBA;
b3AlignedObjectArray<float> m_cachedCameraDepthBuffer;
b3AlignedObjectArray<int> m_cachedSegmentationMaskBuffer;
btAlignedObjectArray<b3ContactPointData> m_cachedContactPoints;
btAlignedObjectArray<b3OverlappingObject> m_cachedOverlappingObjects;
btAlignedObjectArray<b3VisualShapeData> m_cachedVisualShapes;
btAlignedObjectArray<b3CollisionShapeData> m_cachedCollisionShapes;
b3AlignedObjectArray<b3ContactPointData> m_cachedContactPoints;
b3AlignedObjectArray<b3OverlappingObject> m_cachedOverlappingObjects;
b3AlignedObjectArray<b3VisualShapeData> m_cachedVisualShapes;
b3AlignedObjectArray<b3CollisionShapeData> m_cachedCollisionShapes;
btAlignedObjectArray<b3VRControllerEvent> m_cachedVREvents;
btAlignedObjectArray<b3KeyboardEvent> m_cachedKeyboardEvents;
btAlignedObjectArray<b3MouseEvent> m_cachedMouseEvents;
btAlignedObjectArray<double> m_cachedMassMatrix;
btAlignedObjectArray<b3RayHitInfo> m_raycastHits;
b3AlignedObjectArray<b3VRControllerEvent> m_cachedVREvents;
b3AlignedObjectArray<b3KeyboardEvent> m_cachedKeyboardEvents;
b3AlignedObjectArray<b3MouseEvent> m_cachedMouseEvents;
b3AlignedObjectArray<double> m_cachedMassMatrix;
b3AlignedObjectArray<b3RayHitInfo> m_raycastHits;
btAlignedObjectArray<int> m_bodyIdsRequestInfo;
btAlignedObjectArray<int> m_constraintIdsRequestInfo;
b3AlignedObjectArray<int> m_bodyIdsRequestInfo;
b3AlignedObjectArray<int> m_constraintIdsRequestInfo;
SharedMemoryStatus m_tempBackupServerStatus;

View File

@@ -2,7 +2,7 @@
#include "Win32SharedMemory.h"
#include "Bullet3Common/b3Logging.h"
#include "Bullet3Common/b3Scalar.h"
#include "LinearMath/btAlignedObjectArray.h"
#include "Bullet3Common/b3AlignedObjectArray.h"
#include <windows.h>
#include <stdio.h>
@@ -29,7 +29,7 @@ struct Win32SharedMemorySegment
struct Win32SharedMemoryInteralData
{
btAlignedObjectArray<Win32SharedMemorySegment> m_segments;
b3AlignedObjectArray<Win32SharedMemorySegment> m_segments;
Win32SharedMemoryInteralData()
{

View File

@@ -937,6 +937,12 @@ static PyObject* pybullet_changeDynamicsInfo(PyObject* self, PyObject* args, PyO
return NULL;
}
if ((contactStiffness>=0 && contactDamping <0)||(contactStiffness<0 && contactDamping >=0))
{
PyErr_SetString(SpamError, "Both contactStiffness and contactDamping needs to be set together.");
return NULL;
}
{
b3SharedMemoryCommandHandle command = b3InitChangeDynamicsInfo(sm);
b3SharedMemoryStatusHandle statusHandle;

View File

@@ -528,6 +528,14 @@ protected:
otherArray.copy(0, otherSize, m_data);
}
void removeAtIndex(int index)
{
if (index<size())
{
swap( index,size()-1);
pop_back();
}
}
};
#endif //B3_OBJECT_ARRAY__