shrink down cube size of BasicDemo 10 times (it looked ginormous in VR) from 2x2x2 meter to 0.2
add test for VR HUD/sub-titles fix issue in previous commit, partial string use %.8s not %8.s use long long int in b3Clock fix warning/error in pointer alignment in serialization Fix pybullet Windows compilation. (thanks to bkeys/https://github.com/bulletphysics/bullet3/pull/687)
This commit is contained in:
@@ -1486,7 +1486,34 @@ void CMainApplication::RenderStereoTargets()
|
||||
{
|
||||
|
||||
Matrix4 viewMatLeft = m_mat4eyePosLeft * m_mat4HMDPose * rotYtoZ;
|
||||
Matrix4 viewMatCenter = m_mat4HMDPose * rotYtoZ;
|
||||
//0,1,2,3
|
||||
//4,5,6,7,
|
||||
//8,9,10,11
|
||||
//12,13,14,15
|
||||
|
||||
//m_mat4eyePosLeft.get()[10]
|
||||
//m_app->m_instancingRenderer->getActiveCamera()->setCameraTargetPosition(
|
||||
// m_mat4eyePosLeft.get()[3],
|
||||
// m_mat4eyePosLeft.get()[7],
|
||||
// m_mat4eyePosLeft.get()[11]);
|
||||
Matrix4 m;
|
||||
m = viewMatCenter;
|
||||
const float* mat = m.invertAffine().get();
|
||||
|
||||
/*printf("camera:\n,%f,%f,%f,%f\n%f,%f,%f,%f\n%f,%f,%f,%f\n%f,%f,%f,%f",
|
||||
mat[0],mat[1],mat[2],mat[3],
|
||||
mat[4],mat[5],mat[6],mat[7],
|
||||
mat[8],mat[9],mat[10],mat[11],
|
||||
mat[12],mat[13],mat[14],mat[15]);
|
||||
*/
|
||||
float dist=1;
|
||||
m_app->m_instancingRenderer->getActiveCamera()->setCameraTargetPosition(
|
||||
mat[12]-dist*mat[8],
|
||||
mat[13]-dist*mat[9],
|
||||
mat[14]-dist*mat[10]
|
||||
);
|
||||
m_app->m_instancingRenderer->getActiveCamera()->setCameraUpVector(mat[0],mat[1],mat[2]);
|
||||
m_app->m_instancingRenderer->getActiveCamera()->setVRCamera(viewMatLeft.get(),m_mat4ProjectionLeft.get());
|
||||
m_app->m_instancingRenderer->updateCamera(m_app->getUpAxis());
|
||||
}
|
||||
|
||||
@@ -17,14 +17,9 @@ subject to the following restrictions:
|
||||
|
||||
#include "../CommonInterfaces/CommonExampleInterface.h"
|
||||
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
|
||||
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
|
||||
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
|
||||
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
|
||||
#include "../Utils/b3Clock.h"
|
||||
|
||||
|
||||
#include "LinearMath/btTransform.h"
|
||||
#include "LinearMath/btHashMap.h"
|
||||
|
||||
|
||||
|
||||
#include "../OpenGLWindow/SimpleOpenGL3App.h"
|
||||
@@ -74,7 +69,7 @@ public:
|
||||
};
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
|
||||
SimpleOpenGL3App* app = new SimpleOpenGL3App("Bullet Standalone Example",1024,768,true);
|
||||
|
||||
prevMouseButtonCallback = app->m_window->getMouseButtonCallback();
|
||||
@@ -93,13 +88,17 @@ int main(int argc, char* argv[])
|
||||
example->initPhysics();
|
||||
example->resetCamera();
|
||||
|
||||
b3Clock clock;
|
||||
|
||||
do
|
||||
{
|
||||
app->m_instancingRenderer->init();
|
||||
app->m_instancingRenderer->updateCamera(app->getUpAxis());
|
||||
|
||||
example->stepSimulation(1./60.);
|
||||
|
||||
btScalar dtSec = btScalar(clock.getTimeInSeconds());
|
||||
example->stepSimulation(dtSec);
|
||||
clock.reset();
|
||||
|
||||
example->renderScene();
|
||||
|
||||
DrawGridData dg;
|
||||
|
||||
Reference in New Issue
Block a user