MGuiWindow is missing a removeObject methods (e.g. removeImage, removeButton).
If I just do "delete" it crashes because the window still has it in its vector.
101 2013-10-06 18:56:22
Re: MGui "v2" news (56 replies, posted in Editor)
102 2013-10-06 17:16:21
Re: Bones manipulation (36 replies, posted in General)
I already tried to set bones rotation to zero in Blender, but it was all the mesh that was rotated towards the wrong axis eheh. Now it works.
103 2013-10-06 11:50:05
Re: Bones manipulation (36 replies, posted in General)
With this code, while the object rotates in the Y axis, the bone rotates in the Z axis.
104 2013-10-06 10:33:51
Re: Editor keeps game changes after ending the player (6 replies, posted in Editor)
Yes I've found "temp.level" file.
I have problems reproducing the bug consistently though, it doesn't happen very often, so it's a bit tricky to do tests.
105 2013-10-06 10:06:55
Re: Bones manipulation (36 replies, posted in General)
So I was trying to do the same with rotation, and of course I'm failing.
Basically I have to copy the rotation of an object to the rotation of the bone to create a ragdoll.
106 2013-10-06 09:21:41
Re: Editor keeps game changes after ending the player (6 replies, posted in Editor)
About the plugin, this is what I initially thought, but the same happened with the joint demo.
I'm on Windows 7 and I have Maratis on C:\ and I'm not administrator for security reasons, so it could be permission stuff, I'll check that.
107 2013-10-06 09:09:32
Re: Physics and joints (2 replies, posted in Tutorials/Examples)
Actually this topic was just because I had a problem making joints to work, but now I succeded lol.
BTW I meant a Maratis physics and joint tutorial, e.g. what's angular factor.
But while I'm learning it I could do a wiki page myself I guess.
108 2013-10-05 22:51:52
Topic: Editor keeps game changes after ending the player (6 replies, posted in Editor)
I'm in the editor, then I play the game, then I press ESC to return to the editor. Sometimes the editor keeps the player changes (e.g. entities position after collisions), sometimes not (how it should be). I would like to understand more about this.
109 2013-10-04 21:59:22
Topic: Physics and joints (2 replies, posted in Tutorials/Examples)
Any tutorial on physics and joints?
Not necessarily Maratis specific, even Bullet or generic but with some relation to bullet physics.
110 2013-10-04 21:51:35
Re: Conversion Factors (2 replies, posted in External Tools)
As written in the Maratis website, 10 Blender units is equal to 1 meter in Maratis.
1 meter is 3.2808399 feet.
So 1 Blender unit is 0,32808399 feet in Maratis.
So if
1[SUU(ft)] = .30480[BU]
that means that
1[SUU(ft)] = ( .30480[BU] * 0,32808399[Maratis(ft)] ) [Maratis(ft)]
which is = 0.1
So 1[SUU(ft)] = 0.1[Maratis(ft)]
111 2013-10-04 18:40:27
Re: GUI clarification (40 replies, posted in Engine)
Oh, lol.... ok...
Yeah now everything works.
112 2013-10-04 17:29:13
Re: GUI clarification (40 replies, posted in Engine)
Regarding isMouseInside, instead, I've found the bug.
in MWindow.h
inline void onMove(int x, int y){ m_pos[0] = x; m_pos[1] = y; onEvent(MWIN_EVENT_MOVE); }
should be
inline void onMove(int x, int y){ m_mousePos.x = x; m_mousePos.y = y; onEvent(MWIN_EVENT_MOVE); }
That "m_" is actually misleading.
113 2013-10-04 16:38:29
Re: GUI clarification (40 replies, posted in Engine)
The function parent->isHighLight() still blocks the code...
case MWIN_EVENT_MOUSE_BUTTON_DOWN:
if(parent->isHighLight() /* && isMouseInside() */ )
I did
mguiwin_for_cursor->ignoreEvents(true);
Looks like that other than passing events to the next window you also have to highlight it. But this could set the cursor in the background. It's a bit complex.
114 2013-10-04 16:04:57
Re: Empty Maratis mesh (need help-RESOLVED) (6 replies, posted in General)
When something does not appear in the Editor, it's not in the .mesh file either. It's a problem of exporting IMHO.
115 2013-10-04 13:21:27
Re: GUI clarification (40 replies, posted in Engine)
Yes. I'll try to be more clear.
I need to draw:
-some images on the screen (e.g. name of the character)
-some windows on the top (e.g. menu window)
-cursor image
The last point is where the problem arises, since the only solution I found is to draw a big transparent MGuiWindow which in turn draws the mouse cursor image. But this window gets all the inputs, and I can't put it in the background because otherwise you will not see the cursor. Is there a solution for this?
116 2013-10-03 21:32:31
Re: GUI clarification (40 replies, posted in Engine)
Did you specified the pos and size of MWindow as (0,0) for the pos and the screen size in pixel for the size?
Yes. I didn't do further investigations, I'm stuck on those two functions. Tomorrow I'll see if I can spot the precise bug.
And yes, the order is important, if you clic on the top window, even transparent, only this one will take the event.
Yes but what is the solution? I have to draw the mouse cursor image on top of everything. To draw an image I need a parent MGuiWindow the size of the entire screen and on top of everything.
117 2013-10-03 16:08:07
Re: GUI clarification (40 replies, posted in Engine)
Actually there are problems with both functions.
Regarding isHighLight(), I guess there are "order" problems: I have a big window completely transparent in which I draw the mouse cursor, but so I can't click the other windows in the background.
118 2013-10-03 15:48:40
Re: GUI clarification (40 replies, posted in Engine)
MGuiButton::onEvent
...
case MWIN_EVENT_MOUSE_BUTTON_DOWN:
printf("this is reached");
if(parent->isHighLight() && isMouseInside())
{
printf("this is NOT reached");
so the bug it's either in isHighLight() or in isMouseInside()
119 2013-10-03 15:02:24
Re: GUI clarification (40 replies, posted in Engine)
Yes, this is exactly what I did. But for some reason it doesn't work, while explicitly calling myButtonCallback directly of course does work.
Despite having done setEventCallback(myButtonCallback), debugging with some while(1) loops shows that the button acts like if m_eventCallback is NULL.
Since the MGui code looks correct, my only guess is that, like I wrote before, since we must do
button->setEventCallback(myButtonCallback);
inside the MyGame class, this somehow makes the pointer to the function wrong.
See http://stackoverflow.com/questions/1418
e-examples for reference and similar topics on the web with these keywords (c++ method class callback etc.).
Still, proposed solutions does not work for me and I'm not even sure this is actually the cause.
120 2013-10-03 09:57:57
Re: MGui "v2" news (56 replies, posted in Editor)
I've followed these instructions.
http://forum.maratis3d.com/viewtopic.php?pid=5107#p5107
I'm using VS C++ 2010.
121 2013-10-03 09:53:18
Re: Dynamic and Clean Programming(Tutorial) (3 replies, posted in Tutorials/Examples)
You have to write it like this:
[ code ] (with no spaces)
put your code here
[ / code ] (with no spaces)
122 2013-10-02 18:36:16
Re: Artificial Intelligence(In Progress) (44 replies, posted in Scripting)
BTW the image on the first post is so funny.
It's not the "right" way to do it though XD
123 2013-10-02 18:11:42
Re: Soft body (9 replies, posted in Engine)
\
Yes but I want collision so I need soft body physics like in Bullet.
124 2013-10-02 17:46:33
Re: Soft body (9 replies, posted in Engine)
This is called deforming a mesh. It has nothing to do with physics. For physics to work (e.g. a collision between a cloth and a human), you should link every bone with a primitive which in turn has to be a physics joint, which is insane, not good performace-wise, etc. etc.
So your idea only works for "fixed" animations, cutscenes, and stuff like that.
Thanks for the suggestion though.
125 2013-10-02 16:52:13
Re: GUI clarification (40 replies, posted in Engine)
Hrm... it still doesn't work.
Debugging in old style (putting while(1) loops around) I've seen that the event actually reaches the button, so it's a problem with the callback. It's like if m_eventCallback is null, despite me having assigned it.
I think this is due to the fact that my class is assigning the callback function to a function outside its class. I'm obliged to do this otherwise the compiler will throw an error though.
Maybe I should change that method to static and create an handle, etc., how the internet suggests regarding this messy topic.
--------
Tried, no luck even with a static method which retrieves the class doing
MEngine * engine = MEngine::getInstance();
MyGame* my_game = (MyGame*)engine->getGame();
my_game->my_method();