I thought about that a long time and I am still nt sure it'll stay that way. I just thought that since the majority of people are using OIS now that it would be ok, but you're right, I really should decouple it. I'll make my own intermediate types and use those. Thanks!Chimelion wrote:No problem having OIS in the example, but I don't think it should be coupled in API.
TwOgre - An AntTweakBar Integration
- CaseyB
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
- Contact:
- CaseyB
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
- Contact:
Ok, I have updated the project and the Example to use the version of OIS that comes in the Ogre Dependencies. Then I added some examples of using keyboard shortcuts and better comments to the example. I also beefed up the key parsing. I haven't de-integrated OIS yet, but I am thinking of a nice simple, yet effective set of classes for that.
Also, TwOgre has been added to the AntTweakBar Users Gallery!
Also, TwOgre has been added to the AntTweakBar Users Gallery!
- CaseyB
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
- Contact:
-
- Kobold
- Posts: 39
- Joined: Sat Sep 23, 2006 10:09 am
Hi, I play a bit with your code and I made my one class. Thank a lot it really help me a lot to integrate TweakInterface into my application.
Here is how my class looks and a screenshot.
Here is how my class looks and a screenshot.
Code: Select all
OgreTweakBase(Ogre::RenderWindow *renderWindow, Ogre::SceneManager *sceneManager);
virtual ~OgreTweakBase(void);
TwBar *creatBar(const Ogre::String &name);
void distoryBar(TwBar *bar);
bool addInt(TwBar *bar, Ogre::String name, int *value, bool readOnly=false);
bool addFloat(TwBar *bar, Ogre::String name, float *value, bool readOnly=false);
bool addColor(TwBar *bar, Ogre::String name, Ogre::ColourValue *color, bool readOnly=false);
bool addBool(TwBar *bar, Ogre::String name, bool *value, bool readOnly=false);
bool addButton(TwBar *bar, Ogre::String name, TwButtonCallback callback);
bool addEnum(TwBar *bar, Ogre::String name, TwEnumVal *enumVector, int enumNr, int *enumSelected, bool readOnly=false);
bool setVariableGroup(Ogre::String bar, Ogre::String name, Ogre::String group);
bool BRAND NAME(Ogre::String bar, Ogre::String name, bool visible);
bool setVariableLabel(Ogre::String bar, Ogre::String name, Ogre::String label);
bool setVariableHelp(Ogre::String bar, Ogre::String name, Ogre::String help);
bool setVariableKey(Ogre::String bar, Ogre::String name, Ogre::String key);
bool setBarPostion(Ogre::String bar, int x, int y);
bool setBarColor(Ogre::String bar, Ogre::ColourValue color);
bool setBarLabel(Ogre::String bar, Ogre::String label);
bool setBarHelp(Ogre::String bar, Ogre::String help);
bool injectMouseMoved(const OIS::MouseEvent& mouseEvent);
bool injectMouseMoved(const int x, const int y);
bool injectMousePressed(const OIS::MouseEvent& mouseEvent, OIS::MouseButtonID id);
bool injectMouseReleased(const OIS::MouseEvent& mouseEvent, OIS::MouseButtonID id);
bool injectKeyPressed(const OIS::KeyEvent& keyEvent);
bool injectKeyReleased(const OIS::KeyEvent& keyEvent);
-
- Halfling
- Posts: 84
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
Awesome. I thought AntTweakBar was perfect except that a "TextBox" is my favorite tweak control. I was thinking I had to use some more heavy weight GUI implementation just to get a "text manipluation" control. Now going straight for AntTweakBar is less risky if some day you can edit strings.CaseyB wrote:String variable type is #1 on his TODO list, so that should be coming around soon!
- CaseyB
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
- Contact:
-
- Kobold
- Posts: 29
- Joined: Wed Jun 27, 2007 5:24 pm
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
any idea what does this mean? I encountered this problem when i wanted to update the values on runtime.
this is my code for updating the values
if(mKeyboard->isKeyDown(OIS::KC_E))
{
TwOgre::EnumValueList enumList1;
enumList1.push_back(TwOgre::EnumValue(9,"Nine"));
enumList1.push_back(TwOgre::EnumValue(8,"Eight"));
enumList1.push_back(TwOgre::EnumValue(7,"Seven"));
enumList1.push_back(TwOgre::EnumValue(6,"Six"));
enumVar->addEnumValues(enumList1);
}[/img]
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
ERROR(AntTweakBar) >> Bad value
ERROR(AntTweakBar) >> Bad value line 1 column 72 [Val ...]
any idea what does this mean? I encountered this problem when i wanted to update the values on runtime.
this is my code for updating the values
if(mKeyboard->isKeyDown(OIS::KC_E))
{
TwOgre::EnumValueList enumList1;
enumList1.push_back(TwOgre::EnumValue(9,"Nine"));
enumList1.push_back(TwOgre::EnumValue(8,"Eight"));
enumList1.push_back(TwOgre::EnumValue(7,"Seven"));
enumList1.push_back(TwOgre::EnumValue(6,"Six"));
enumVar->addEnumValues(enumList1);
}[/img]
- CaseyB
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
- Contact:
- CaseyB
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
- Contact:
Ok, it's been forever since I've done anything with this, but I've updated to the latest version of AntTweakBar and added support for StingVariables. The latest version has much more consistant results as far as the custom icons under Windows, which is nice and they added support for DX10, which I have left out for now since Ogre doesn't have a DX10 RenderSystem. I updated the Demo to show a StringVariable. The next thing I am going to work on is the callback system and buttons.
You can check this update out at:
svn checkout http://twogregui.googlecode.com/svn/trunk/ twogregui
SETUP
If you use the Ogre SDK then you should be all set. TwOgre should build right out of the box for you.
If you Build Ogre from Source then you'll need to add the OGRE_SRC environment variable to point to your ogrenew folder. Then TwOgre should build with no problems.
You can check this update out at:
svn checkout http://twogregui.googlecode.com/svn/trunk/ twogregui
SETUP
If you use the Ogre SDK then you should be all set. TwOgre should build right out of the box for you.
If you Build Ogre from Source then you'll need to add the OGRE_SRC environment variable to point to your ogrenew folder. Then TwOgre should build with no problems.
- wacom
- Gnome
- Posts: 350
- Joined: Sun Feb 10, 2008 2:07 pm
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
I don't think so.
Unless you're interested in trying my unofficial update.
It was fairly easy to do.
Unless you're interested in trying my unofficial update.
It was fairly easy to do.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
I've resurrected this and upgraded it to use the latest AntTweakbar.
Added support for buttons and separators.
More to come.
Added support for buttons and separators.
More to come.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
I just committed the latest changes to TwOgre - as Casey was kind to allow me to take over the project.
Didn't fix the project, though - only added vc10 to it.
Will probably CMake it.
But the project lives.
It's just perfect for programmers.
And, yes: I added a small wiki page for it.
Didn't fix the project, though - only added vc10 to it.
Will probably CMake it.
But the project lives.
It's a GUI made especially for tweaking, hence it's name.JustBoo wrote:Oh wow, I've never seen this before. Is it really a property grid?
Is this it in the Wiki?
http://www.ogre3d.org/tikiwiki/TwOgre&h ... ntTweakBar
It's just perfect for programmers.
And, yes: I added a small wiki page for it.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
TwOgre now uses CMake for building and Mercurial to hold the source:
http://code.google.com/p/twogregui/
http://code.google.com/p/twogregui/
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
Quaternions and Vector3's
And callbacks!
And buttons!!
And a much improved syntax, using named parameters:
Code: Select all
mWin1 = mWinManager->createWindow(TwOgre::WindowParams("Window 1")
.title("World Editor")
.color(Ogre::ColourValue(1.0, 0.0, 0.0, 0.7))
.position(mWindow->getWidth()-408, 0)
.size(400, 380)
.valuesWidth(240)
);
mBoxColor = mWin1->addColorVariable(TwOgre::ColorParams("Color1")
.label("Cube Color")
.value(Ogre::ColourValue(1.0, 0.0, 0.0, 0.7))
.group("Color Values"));
mSkyBox = mWin1->addBoolVariable(TwOgre::BoolParams("Bool2")
.readOnly(false)
.label("Show Skybox")
.value(false)
.shortcut("Alt+b")
.callback(&DeviceListener::setSkyboxCallback, &DeviceListener::getSkyboxCallback, this)
);
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- Beauty
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
- Contact:
Re: TwOgre - An AntTweakBar Integration
I didn't know this GUI system.
It would be nice and useful when somebody adds it to the wiki.
At least to the GUI comparism page:
http://www.ogre3d.org/tikiwiki/tiki-ind ... on+of+GUIs
Good would be its own wiki page with feature list, discriptions, code snippets, ...
It would be nice and useful when somebody adds it to the wiki.
At least to the GUI comparism page:
http://www.ogre3d.org/tikiwiki/tiki-ind ... on+of+GUIs
Good would be its own wiki page with feature list, discriptions, code snippets, ...
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
It does have a page:
http://www.ogre3d.org/tikiwiki/TwOgre&s ... =Libraries
http://www.ogre3d.org/tikiwiki/TwOgre&s ... =Libraries
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- Beauty
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
- Contact:
Re: TwOgre - An AntTweakBar Integration
Good note.
I recognized, that there was not only one page linking to TwOgre.
Now I added it to the page Comparison of GUIs.
But the data fields of the table are still empty and needs to get detail information.
Also it would be good to add more information to the TwOgre wiki page.
I recognized, that there was not only one page linking to TwOgre.
Now I added it to the page Comparison of GUIs.
But the data fields of the table are still empty and needs to get detail information.
Also it would be good to add more information to the TwOgre wiki page.
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
TwOgreGui now builds and runs on Linux.
Was upgraded to using AntTweakBar 1.14.
Needs some Windows loving, and some fixing of the mouse position handling in Linux (it's off for some reason..)
Still at Google.Code at this address:
http://code.google.com/p/twogregui/
Was upgraded to using AntTweakBar 1.14.
Needs some Windows loving, and some fixing of the mouse position handling in Linux (it's off for some reason..)
Still at Google.Code at this address:
http://code.google.com/p/twogregui/
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
Linux problems fixed!
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- tdev
- Silver Sponsor
- Posts: 244
- Joined: Thu Apr 12, 2007 9:21 pm
- Location: Germany
- x 14
Re: TwOgre - An AntTweakBar Integration
very nice integration, thanks
i already provided a patch to fix some issue: http://code.google.com/p/twogregui/issues/detail?id=2
it seems to drop shadows. How to prevent? also, i wrote this little wrapper macro:
so you can define it like this in a class header:
and its variable adding:
and the implementation of the getter/setter (in the cpp file):
i already provided a patch to fix some issue: http://code.google.com/p/twogregui/issues/detail?id=2
it seems to drop shadows. How to prevent? also, i wrote this little wrapper macro:
Code: Select all
#define TW_WRAPPER(X, Y) \
void set##Y(const X value); \
X get##Y(); \
static inline void TW_CALL HeightmapTerrain::TWset##Y(const void *value, void *clientData) { static_cast<HeightmapTerrain*>(clientData)->set##Y(*static_cast<const X *>(value)); } \
static inline void TW_CALL HeightmapTerrain::TWget##Y(void *value, void *clientData) { *static_cast<X *>(value) = static_cast<HeightmapTerrain *>(clientData)->get##Y(); }
Code: Select all
public:
TW_WRAPPER(Ogre::Quaternion, CamOrient);
TW_WRAPPER(Ogre::Vector3, CamPosition);
Code: Select all
TwOgre::QuaternionVariable *camOrient = mWin->addQuaternionVariable(TwOgre::QuaternionParams("Orientation")
.label("Orientation")
.group("Camera")
.help("The cameras orientation")
.callback(&HeightmapTerrain::TWsetCamOrient, &HeightmapTerrain::TWgetCamOrient, this)
);
TwOgre::Position3DVariable *camPos = mWin->addPosition3DVariable(TwOgre::Position3DParams("Position")
.label("Position")
.group("Camera")
.help("The cameras position")
.callback(&HeightmapTerrain::TWsetCamPosition, &HeightmapTerrain::TWgetCamPosition, this)
);
Code: Select all
void HeightmapTerrain::setCamOrient(const Ogre::Quaternion v)
{
mCamera->setOrientation(v);
}
Ogre::Quaternion HeightmapTerrain::getCamOrient()
{
return mCamera->getOrientation();
}
void HeightmapTerrain::setCamPosition(const Ogre::Vector3 v)
{
mCamera->setPosition(v);
}
Ogre::Vector3 HeightmapTerrain::getCamPosition()
{
return mCamera->getPosition();
}
working on: http://rigsofrods.com | OgreProcedual (project) | Caelum (project) | Paged Geometry (project) | OISB (project) | OgreAngelscript | OgreMeshTool
- duststorm
- Minaton
- Posts: 921
- Joined: Sat Jul 31, 2010 6:29 pm
- Location: Belgium
- x 80
- Contact:
Re: TwOgre - An AntTweakBar Integration
Thank you for updating and bringing this GUI to my attention.
I didn't know it until now. This is really handy for quickly tuning some parameters visually.
I didn't know it until now. This is really handy for quickly tuning some parameters visually.
Developer @ MakeHuman.org
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: TwOgre - An AntTweakBar Integration
By letting me commit a fix for it.tdev wrote:it seems to drop shadows. How to prevent?
It took me a while, but I finally figured out how to exclude shadows from the rendering of the GUI.
I added these lines to WindowManager::renderQueueStarted:
Code: Select all
if (invocation == Ogre::RenderQueueInvocation::RENDER_QUEUE_INVOCATION_SHADOWS)
return;
Code: Select all
void WindowManager::renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation)
{
if (invocation == Ogre::RenderQueueInvocation::RENDER_QUEUE_INVOCATION_SHADOWS)
return;
// We're going to render ourselves in the Overlay Queue so we're always on top
if(queueGroupId == Ogre::RENDER_QUEUE_OVERLAY)
{
TwDraw();
}
}
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- tdev
- Silver Sponsor
- Posts: 244
- Joined: Thu Apr 12, 2007 9:21 pm
- Location: Germany
- x 14
Re: TwOgre - An AntTweakBar Integration
thanks for fixing
working on: http://rigsofrods.com | OgreProcedual (project) | Caelum (project) | Paged Geometry (project) | OISB (project) | OgreAngelscript | OgreMeshTool
- tdev
- Silver Sponsor
- Posts: 244
- Joined: Thu Apr 12, 2007 9:21 pm
- Location: Germany
- x 14
Re: TwOgre - An AntTweakBar Integration
not that way as the shadows that were dropped were distorted and alike.duststorm wrote:On the other hand, some might consider menus dropping shadows a feature rather than a bug
working on: http://rigsofrods.com | OgreProcedual (project) | Caelum (project) | Paged Geometry (project) | OISB (project) | OgreAngelscript | OgreMeshTool