From c5d4f7b3b3da227756e53930580b0839b4e3d9d8 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Sat, 8 Oct 2016 07:51:45 -0700 Subject: [PATCH] disable VSYNC for VR clamp KUKA motor motion to be less abrupt --- .../SharedMemory/PhysicsServerCommandProcessor.cpp | 2 +- examples/StandaloneMain/hellovr_opengl_main.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index 35856f819..80e9baadd 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -3396,7 +3396,7 @@ void PhysicsServerCommandProcessor::stepSimulationRealTime(double dtInSec) { btScalar desiredVelocity = 0.f; btScalar desiredPosition = q_new[link]; - //motor->setRhsClamp(gRhsClamp); + motor->setRhsClamp(gRhsClamp); //printf("link %d: %f", link, q_new[link]); motor->setVelocityTarget(desiredVelocity,1.0); motor->setPositionTarget(desiredPosition,0.6); diff --git a/examples/StandaloneMain/hellovr_opengl_main.cpp b/examples/StandaloneMain/hellovr_opengl_main.cpp index 485ee71ca..3df104e58 100644 --- a/examples/StandaloneMain/hellovr_opengl_main.cpp +++ b/examples/StandaloneMain/hellovr_opengl_main.cpp @@ -2190,7 +2190,15 @@ int main(int argc, char *argv[]) pMainApplication->Shutdown(); return 1; } - + + //request disable VSYNC + typedef bool (APIENTRY *PFNWGLSWAPINTERVALFARPROC)(int); + PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0; + wglSwapIntervalEXT = + (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress("wglSwapIntervalEXT"); + if (wglSwapIntervalEXT) + wglSwapIntervalEXT(0); + pMainApplication->RunMainLoop(); pMainApplication->Shutdown();