101

(56 replies, posted in Editor)

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.

102

(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

(36 replies, posted in General)

With this code, while the object rotates in the Y axis, the bone rotates in the Z axis.

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

(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.

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

(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.

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

(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

(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

(40 replies, posted in Engine)

Oh, lol.... ok...

Yeah now everything works. big_smile

112

(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

(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. hmm

When something does not appear in the Editor, it's not in the .mesh file either. It's a problem of exporting IMHO.

115

(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

(40 replies, posted in Engine)

anael wrote:

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.

anael wrote:

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

(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

(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

(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

(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.

You have to write it like this:

[ code ] (with no spaces)
put your code here
[ / code ] (with no spaces)

BTW the image on the first post is so funny.
It's not the "right" way to do it though XD

123

(9 replies, posted in Engine)

zester wrote:

\

Yes but I want collision so I need soft body physics like in Bullet.

124

(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

(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();