Hydrax wave settings

hvalola

08-03-2010 04:57:17

hi
please some one can help me with changing wave strength through the command line input
or
is there a place to download Hydrax editor source code

Thrakbad

08-03-2010 10:03:47

Afaik this works over Hydrax::Module::setOptions(), just make a options struct for your Module via the default constructor and set the strength to the value you got from the command line, then initialise your Module with these options.
If you want to do it while hydrax is running, like in the editor, maybe you can save the options with Module::getOptions(), then change the strength and set them back. Haven't tried it though.

hvalola

09-03-2010 06:03:11

Thanks

but i couldn't make it if you can please provide me with a code example
that would be a big help

Thrakbad

09-03-2010 11:49:28

Which part bothers you? The setting of the options or the passing of an argument via command line?

hvalola

10-03-2010 02:32:58

hi

problem is setting the options
visual c++ tells "setOptions' : is not a member of 'Hydrax::Module::Module"
please help me

Thrakbad

10-03-2010 09:35:50

ah yes sorry, it is part of either ProjectedGrid or SimpleGrid, depends on which module you use. This is taken and adapted from my Hydrax initialisation code. Hope it helps.
Hydrax::Module::ProjectedGrid::Options options = Hydrax::Module::ProjectedGrid::Options();
options.Strength = yourStrength;
Hydrax::Module::ProjectedGrid *mModule = new Hydrax::Module::ProjectedGrid(mHydrax,
new Hydrax::Noise::Perlin(),
plane,
Hydrax::MaterialManager::NM_VERTEX,
options);
mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));

hvalola

11-03-2010 02:37:36

thanks
it works perfectly
i'll try to get the command line input

thanks,thanksthanksthanksthanksthanksthanksthanksthanks :D

hvalola

11-03-2010 03:17:54

Thrakbad
i want to change it like hydrax editor
while hydrax is running is there a way to do that? :?:

Thrakbad

12-03-2010 14:48:39

Yes, I just tried it. This is the setStrength function I used for my ProjectedGrid. SimpleGrid should work just like that.
void setStrength(float strength)
{
// mHydrax is of course your Hydrax pointer
Hydrax::Module::ProjectedGrid* module = static_cast<Hydrax::Module::ProjectedGrid*>(mHydrax->getModule());
Hydrax::Module::ProjectedGrid::Options options = module->getOptions();
options.Strength = strength;
module->setOptions(options);
}

hvalola

15-03-2010 03:30:53

thanks

ill try it out. sorry for the lateness to reply.
ill try to integrate it to
there is a problem on recursive calling to method any way thanks!!!!!!!!!!!!!!!!!! :D

please if you can send me the complete code you have written :| to rgpr2@yahoo.com

chethaka

15-03-2010 10:12:57

This post was really helpful for me and can you please tell where should be the 'setStrength(value);' method called.

Thrakbad

15-03-2010 12:37:11

@chethaka Umm, I don't exactly understand the question. In my test I called it in a frame listener in frameStarted. But I'm pretty sure you can call it everywhere in your code and it will work just fine, as long as Hydrax is initialized.

@hvalola this is the complete code I wrote to change the strength. It should pretty much work on its own, except for the Hydrax pointer you have to provide.

hvalola

16-03-2010 05:41:52

we cannot continually update the scene through the command line only once how to resolve it