Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
fixed a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed May 31, 2019
1 parent 35441c8 commit 5548e7b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion vrep_vtk_engine/pathObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void pathObject::update() {
simxInt succes;
simxUChar *str;
simxInt signalLength;
succes = simxGetStringSignal(clientID, (simxChar*)"path", &str, &signalLength, simx_opmode_buffer);
succes = simxGetStringSignal(clientID, (simxChar*)"path", &str, &signalLength, simx_opmode_streaming);
if (succes == simx_return_ok) {
signalLength = (int)(signalLength / 4);
if (signalLength > prevLength) {
Expand Down Expand Up @@ -116,6 +116,8 @@ void pathObject::update() {
}
else {
memcpy(points->GetVoidPointer(0), (float*)str, signalLength * sizeof(float)); // for if somebody else changed the path, some optimizer maybe?
points->Modified();
polyData->Modified();
}
}
return;
Expand Down
14 changes: 11 additions & 3 deletions vrep_vtk_engine/stereoPanorama_renderwindow_support.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ void stereoPanorama_renderwindow_support::activate_interactor() {
}

void stereoPanorama_renderwindow_support::activateMainCam(int height) {
int goodRender;
simxGetIntegerSignal(clientID, "High_quality_render", &goodRender, simx_opmode_blocking); // whatever this is

for (int k = 0; k < vr_camera.size(); k++) {
vr_camera[k]->SetViewAngle(90.0);
vr_camera[k]->SetPosition(0, 0, 0);
Expand All @@ -354,19 +357,24 @@ void stereoPanorama_renderwindow_support::activateMainCam(int height) {
vr_camera[k]->SetModelTransformMatrix(pose[k]->GetMatrix());
// Classical vtk pipeline to set up renderwindow etc with extra options
renderer[k]->SetActiveCamera(vr_camera[k]);
renderer[k]->UseShadowsOn();
if (goodRender == 1) {
renderer[k]->UseShadowsOn();
}
renderer[k]->SetTwoSidedLighting(false);
renderer[k]->LightFollowCameraOff();
renderer[k]->AutomaticLightCreationOff();
renderer[k]->UseDepthPeelingForVolumesOn();
renderer[k]->SetMaximumNumberOfPeels(0);
//renderer[k]->UseDepthPeelingForVolumesOn();
//renderer[k]->SetMaximumNumberOfPeels(0);
//renderer[k]->SetUseDepthPeeling(true);
renderer[k]->Modified();
renderWindow[k]->AddRenderer(renderer[k]);

renderWindow[k]->SetSize(121.0, height); // make shure we have a 'middle' pixel
renderWindow[k]->SetOffScreenRendering(true);
renderWindow[k]->Initialize();
renderWindow[k]->SetDesiredUpdateRate(10000.0);
//renderWindow[k]->SetAlphaBitPlanes(true);
//renderWindow[k]->SetMultiSamples(0);
vr_renderWindowInteractor[k]->SetRenderWindow(renderWindow[k]);
vr_renderWindowInteractor[k]->Initialize();
filter[k]->SetInput(renderWindow[k]);
Expand Down
2 changes: 1 addition & 1 deletion vrep_vtk_engine/vrep_mesh_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void vrep_mesh_object::makeActor() {
vrep_mesh_actor->GetProperty()->SetOpacity(vrep_mesh_opacity);
};
int goodRender;
simxGetIntegerSignal(clientID, "High_quality_render", &goodRender, simx_opmode_blocking); // whatever this is
simxGetIntegerSignal(clientID, "High_quality_render", &goodRender, simx_opmode_streaming); // whatever this is
if (goodRender == 1) {
vtkSmartPointer<vtkCleanPolyData> cleanPolyData = vtkSmartPointer<vtkCleanPolyData>::New();
cleanPolyData->SetInputData(meshData);
Expand Down

0 comments on commit 5548e7b

Please sign in to comment.