Implement Seated Universe and Raw (Room Setup) Universe Support (#150)
* Add checks for seated improve shutdown state Seated mode chaperone update is still broken. Normal standing mode space motion needs testing on WMR and Rift * Fix updating chaperone on room setup completion * Implement seated universe recenter/offsets/motion Addresses #145 * Add Option "Allow External App Chaperone Edits" This option is added to the settings tab. It allows external apps to modify the chaperone but only if the current offset is 0,0,0 and rotation is 0. The option is disabled by default.
This commit is contained in:
@@ -74,10 +74,21 @@ float ChaperoneUtils::_getDistanceToChaperone(
|
||||
return distance;
|
||||
}
|
||||
|
||||
void ChaperoneUtils::loadChaperoneData()
|
||||
void ChaperoneUtils::loadChaperoneData( bool fromLiveBounds )
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock( _mutex );
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( nullptr, &_quadsCount );
|
||||
|
||||
if ( fromLiveBounds )
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( nullptr,
|
||||
&_quadsCount );
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo( nullptr,
|
||||
&_quadsCount );
|
||||
}
|
||||
|
||||
if ( _quadsCount > 0 )
|
||||
{
|
||||
std::unique_ptr<vr::HmdQuad_t> quadsBuffer(
|
||||
@@ -86,8 +97,17 @@ void ChaperoneUtils::loadChaperoneData()
|
||||
_corners.reset( reinterpret_cast<vr::HmdVector3_t*>(
|
||||
new vr::HmdQuad_t[_quadsCount] ) );
|
||||
vr::HmdVector3_t* _cornersPtr = _corners.get();
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( quadsBufferPtr,
|
||||
&_quadsCount );
|
||||
if ( fromLiveBounds )
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetLiveCollisionBoundsInfo( quadsBufferPtr,
|
||||
&_quadsCount );
|
||||
}
|
||||
else
|
||||
{
|
||||
vr::VRChaperoneSetup()->GetWorkingCollisionBoundsInfo(
|
||||
quadsBufferPtr, &_quadsCount );
|
||||
}
|
||||
|
||||
for ( uint32_t i = 0; i < _quadsCount; i++ )
|
||||
{
|
||||
_cornersPtr[i] = quadsBufferPtr[i].vCorners[0];
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
return _mutex;
|
||||
}
|
||||
|
||||
void loadChaperoneData();
|
||||
void loadChaperoneData( bool fromLiveBounds = true );
|
||||
|
||||
float getDistanceToChaperone( const vr::HmdVector3_t& point,
|
||||
vr::HmdVector3_t* projectedPoint = nullptr,
|
||||
|
||||
Reference in New Issue
Block a user