Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed builtins/rendercore/RenderCore-1.7.tar.gz
Binary file not shown.
Binary file added builtins/rendercore/RenderCore-1.8.tar.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2157,8 +2157,8 @@ if(webgui)
endif()
ExternalProject_Add(
RENDERCORE
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-1.7.tar.gz
URL_HASH SHA256=46cf6171ae0e16ba2f99789daaeb202146072af874ea530f06a0099c66c3e9b1
URL ${CMAKE_SOURCE_DIR}/builtins/rendercore/RenderCore-1.8.tar.gz
URL_HASH SHA256=2ab84800ec1aaf36671e463a09e3befbe97b06b2547f97ec05fe16ef1351c79a
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion graf3d/eve7/src/REveBoxSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void REveBoxSet::AddHex(const REveVector& pos, Float_t r, Float_t angle, Float_t
REveTrans t; // AMT do we need to reuse ???
t.SetPos(pos.fX, pos.fY, pos.fZ);
t.SetScale(r,r,depth);
t.RotatePF(1, 2, angle);
t.RotateLF(1, 2, angle * TMath::DegToRad());
for(Int_t i=0; i<16; ++i)
hex->fMat[i] = t[i];
}
Expand Down
9 changes: 8 additions & 1 deletion ui5/eve7/lib/EveScene.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,15 @@ sap.ui.define(['rootui5/eve7/lib/EveManager'], function(EveManager) {
this.update3DObjectsVisibility(p.childs, true);
this.need_visibility_update = false;
}
this.glctrl.viewer.render();

// To improve when bbox info is streamed.
// Recalc scene bbox -- and update viewer total bbox, from scene boxes.
// 1. recalc-scene-bbox from known element bboxes (streamed)
// [ this could really be done on the server ]
// 2. tell viewer to recalc-total-bbox ONLY from scene bboxes.

// For now just refresh the gl-viewer.
this.glctrl.viewer.request_render(true);
}
}

Expand Down
66 changes: 57 additions & 9 deletions ui5/eve7/lib/GlViewerRCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ sap.ui.define([
return canvasDOM;
};

pthis.ApplyTemporaryRCoreExtensions();

pthis.bootstrap();
});
} else {
Expand Down Expand Up @@ -203,6 +205,7 @@ sap.ui.define([
this.renderer.clearColor = "#00000000";
this.scene = new RC.Scene();
this.overlay_scene = new RC.Scene();
this.scene_bbox = new RC.Box3();

this.lights = new RC.Group;
this.lights.name = "Light container";
Expand Down Expand Up @@ -470,18 +473,23 @@ sap.ui.define([
this.resetRenderer();
}

resetRenderer()
recalcSceneBBox()
{
let sbbox = new RC.Box3();
sbbox.setFromObject( this.scene );
if (sbbox.isEmpty())
this.scene_bbox.setFromObject( this.scene );
if (this.scene_bbox.isEmpty())
{
console.error("GlViewerRenderCore.resetRenderer scene bbox empty", sbbox);
console.error("GlViewerRenderCore.resetRenderer scene bbox empty", this.scene_bbox);
const ext = 100;
sbbox.expandByPoint(new RC.Vector3(-ext,-ext,-ext));
sbbox.expandByPoint(new RC.Vector3( ext, ext, ext));
this.scene_bbox.expandByPoint(new RC.Vector3(-ext,-ext,-ext));
this.scene_bbox.expandByPoint(new RC.Vector3( ext, ext, ext));
}
}

resetRenderer()
{
this.recalcSceneBBox();

let sbbox = this.scene_bbox;
let posV = new RC.Vector3; posV.subVectors(sbbox.max, this.rot_center);
let negV = new RC.Vector3; negV.subVectors(sbbox.min, this.rot_center);

Expand Down Expand Up @@ -540,6 +548,19 @@ sap.ui.define([
this.controls.update();
}

setupCamera()
{
// To be used with JS debugger to edit the values as needed.

let pos = new RC.Vector3;
let lookat = new RC.Vector3;
let fov = 30; // in degrees

console.log("A good place to set the breakpoint and edit the values");

// Call the controller stuff, hope it's not all local, otherwise we need to edit it there.
// Sigh, should really have it (and RedeQuTor) in ROOT.
}

updateViewerAttributes()
{
Expand Down Expand Up @@ -641,20 +662,28 @@ sap.ui.define([

//==============================================================================

request_render()
request_render(recalc_sbbox=false)
{
// console.log("REQUEST RENDER");

this.render_requested_recalc_sbbox ||= recalc_sbbox;
if (this.render_requested) return;
setTimeout(this.render.bind(this), 0);
this.render_requested = true;
}

render()
{
// console.log("RENDER", this.scene, this.camera, this.canvas, this.renderer);
console.log("RENDER", this.scene, this.camera, this.canvas, this.renderer);

this.render_requested = false;
if (this.render_requested_recalc_sbbox) {
this.recalcSceneBBox();
this.render_requested_recalc_sbbox = false;
}
if (this.camera.isPerspectiveCamera) {
this.camera.optimizeNearFar(this.scene_bbox);
}

if (this.canvas.width <= 0 || this.canvas.height <= 0) return;

Expand Down Expand Up @@ -1220,6 +1249,25 @@ sap.ui.define([
</html>`);
win.document.close();
}

//==============================================================================
// Temporary RCore additions (to avoid updating of RCore.tgz)
//==============================================================================

ApplyTemporaryRCoreExtensions() {
console.log("GlViewerRCore.ApplyTemporaryRCoreExtensions()");

// E.g.:
// if (RC.PerspectiveCamera.prototype.optimizeNearFar === undefined) {
// RC.PerspectiveCamera.prototype.optimizeNearFar = function(scene_bbox) {
// this.matrixWorldInverse.getInverse(this.matrixWorld);
// // .....
// };
// }
}

//==============================================================================

} // class GlViewerRCore

return GlViewerRCore;
Expand Down
Loading