Page 2 of 2

Re: Size Of Positioning Shafts In OpenMW-CS

Posted: 07 Sep 2016, 11:17
by MrAnonGuy
aesylwinn wrote: 1. Get rid of the static constants definitions in the header and source files.
2. #include "../../model/prefs/state.hpp"
3. Replace constant definitions with state retrieval like so in the member functions:

Code: Select all

const float MarkerShaftWidth = CSMPrefs::get()["General Input"]["MarkerShaftWidth"].toDouble();
Just to note, this method will not resize already existing markers. You will have to re-select the object.
Thanks aesylwinn,

That was the nudge I needed to get me moving the right direction. Works great.
shafts1.jpg
shafts2.jpg
Considering this wasn't possible at all, as the markers obscured smaller objects, selecting the object after making manual changes to marker scaling values isn't much of a problem. So, how much trouble is it to determine the distance from the object to the camera, in order to add an autoscaling factor?

Thanks!

Re: Size Of Positioning Shafts In OpenMW-CS

Posted: 07 Sep 2016, 18:33
by aesylwinn
It would involve:
1. Getting access to the osg::Camera instance when creating the marker node
2. Creating a class that inherits from osg::NodeCallback; this is where the code to update the object's scale would go
3. Attach the callback class to the marker node

Not something for the faint of heart. ;)

Re: Size Of Positioning Shafts In OpenMW-CS

Posted: 07 Sep 2016, 18:36
by scrawl
Why not scale based on the object's bounding box instead?

Re: Size Of Positioning Shafts In OpenMW-CS

Posted: 07 Sep 2016, 18:48
by aesylwinn
The main problem is that the marker gets difficult to click on at large distances when you have a set width. The objects are already lengthened with the bounding box. But the width should also be made to scale with the bounding box. That would fix the issue to some degree.

Re: Size Of Positioning Shafts In OpenMW-CS

Posted: 08 Sep 2016, 00:20
by MrAnonGuy
aesylwinn wrote:It would involve:
1. Getting access to the osg::Camera instance when creating the marker node
2. Creating a class that inherits from osg::NodeCallback; this is where the code to update the object's scale would go
3. Attach the callback class to the marker node
I see. So, the main task is to hook into the code that positions the camera, so the markers can be scaled as the camera moves. On the surface, it doesn't sound too bad and I'm sure I could work my way thought it.

Having said that, I'm not so sure the openmw project is such a good fit for me, as least at this point. I think it's time for me to fade back into the æther. I do want to thank you for helping me with the issues I had, as well as taking the time to answer my questions. I really do appreciate that. I wish you well in all your future endeavours.

Re: Size Of Positioning Shafts In OpenMW-CS

Posted: 08 Sep 2016, 01:36
by aesylwinn
That's unfortunate. In any case, it was a pleasure working with you. Good luck to you as well.