-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes #90
Various fixes #90
Conversation
favreau
commented
Dec 14, 2016
- Crash on braynsViewer resizing
- Load/Save meshes with OSPRay plugin
- Set default camera closer to 3D model
@@ -62,6 +62,9 @@ void BraynsViewer::_registerKeyboardShortcuts() | |||
keyHandler.registerKeyboardShortcut( | |||
'x', "Set timestamp to " + std::to_string( DEFAULT_TEST_TIMESTAMP ), | |||
std::bind( &BraynsViewer::_defaultTimestamp, this )); | |||
keyHandler.registerKeyboardShortcut( | |||
'|', "Create cache file ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great key choice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'^' and '%' were already used...
|
||
bool Scene::isEmpty() const | ||
{ | ||
return ( _primitives.size() == 0 && _trianglesMeshes.size() == 0 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parentheses not needed; also empty() would look better here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Done.
@@ -99,15 +99,15 @@ bool MeshLoader::importMeshFromFile( | |||
for(size_t i=0; i < mesh->mNumVertices; ++i ) | |||
{ | |||
aiVector3D v = mesh->mVertices[ i ]; | |||
const Vector3f vertex = { -v.x, v.y, -v.z }; | |||
const Vector3f vertex = { v.x, v.y, v.z }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, good fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Quite proud of this one I have to say ;-)
@@ -891,4 +891,9 @@ uint64_t OptiXScene::_getBvhSize( const uint64_t nbElements ) const | |||
return 64 * 1.3f * nbElements; | |||
} | |||
|
|||
void OptiXScene::saveSceneToCacheFile() | |||
{ | |||
BRAYNS_ERROR << "OptiXScene::saveSceneToCacheFile not implemented" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, ideally the cache file would be engine agnostic, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it needs a different implementation for every engine. For the moment, only OSPRay support large models, and requires the use of a cache.
@@ -128,6 +128,29 @@ void OSPRayScene::_saveCacheFile() | |||
file.write( ( char* )&nbMaterials, sizeof( size_t )); | |||
BRAYNS_INFO << nbMaterials << " materials" << std::endl; | |||
|
|||
// Save materials | |||
for( size_t materialId = 0; materialId < nbMaterials; ++materialId ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++11 range for over _materials won't work? Or nbMaterials != _materials.size()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remains from pre-C++11 implementation... Fixed.
{ | ||
return ( _primitives.size() == 0 && _trianglesMeshes.size() == 0 ); | ||
return _primitives.size() == 0 && _trianglesMeshes.size() == 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not empty() here?