226

(7 replies, posted in General)

VeganDev : It's a portability reason, and it's a good reason for a lot of projects, but not when you code base is already c++.
The difficulty with c++ on Android is that you may need to compile multiple binary depending on the hardware.

227

(4 replies, posted in General)

Hi, technically it can be added, but it probably won't be faster.

LuaJIT is probably the fastest dynamic langage (the same lua we have now but with a Just-In-Time compiler).
There is plan to add it instead of the standard lua interpreter.

228

(3 replies, posted in General)

Hi,

you can follow the official code updates here : https://code.google.com/p/maratis/source/list

But there is also paralell developments, like from the user Dahnielson who is very active right now : https://github.com/dahnielson/Maratis/

It moves by waves, right now I don't have a lot of free time, so I spend most of my energy responding mails and forum questions related to Maratis. But I believe it's quite active for a small open-source project.

229

(47 replies, posted in Engine)

the xcode project might need to be update but it can normally work on all ios,
it's some time I didn't test the build, my mac system is not up to date with the newest emulator.

230

(6 replies, posted in General)

don't, it's a valid point, I'm just showing the pros and cons

231

(2 replies, posted in Engine)

It depends what you want to do,
but if you want to use render to texture look at "enableRenderToTexture" here :

https://maratis.googlecode.com/svn/trun … Script.cpp

ps : never call "new" manually to manipulate engine objects
call "level->loadTexture("myName", 0, 0);" and use a reference string as a "filename"

232

(6 replies, posted in General)

Was there a reason that name was chosen?

A "not so good in english" french developer ? smile


Changing the default folders can cause some incompatibility with previous projects if not implemented correctly,
the examples and documentation will also need to be checked and updated. I'm not sure the trouble is worth it.

But, the folder names are only important for the publishing process,
it parses each specific folders to transform the files in binary or to add them to the package.

It's also used (in a cosmetic way) by the file browser in maratis editor :
"add entity" opens the meshs/ folder by default
"add sound" the sounds/ folder
etc

The Assimp importer also converts files directly inside the meshs/ folder.

Till you publish, you can actually use different folder names and everything will work,
you will just have to browse more folders when you import meshes.

So, let's say this naming convention is really a problem, I can force the publishing process to look at
all the folders inside the project instead of the current names. But, it will be a bit slower so I'm not sure it's worth it either.

The last option would be to specify the name of each folder in the maratis project file, so older projects could still use the current names, and the editor will be able to use the correct default folder when browsing files.

233

(7 replies, posted in General)

Nice man !

What might be hard to use is OpenAL for the sound, I don't think it's supported natively on Android.
Maybe a third party lib like "OpenAL Soft" will be enough, or it will need a OpenSL sound context to replace the OpenAL one.

234

(33 replies, posted in General)

Actually, I checked the xcode again and the flag is there, so it's not that.

I checked the settings and tried different fixes but I don't understand what is the problem,
it might be an issue with the Clang compiler or with c++11 standard, but if I switch to gcc there is some different errors,
or it's a dependency problem.

Assimp code is not very attractive, specially to debug.

I will check deeper, but I need to go to Paris for some work, till Saturday,
so I'll come back to you later when I'm back home.

235

(2 replies, posted in General)

What do you mean" Maratis engine based engine" ?

Anyway, the engine is open source in zlib/libpng License : http://opensource.org/licenses/Zlib

The editor source is in GNU General Public License : http://opensource.org/licenses/GPL-2.0

Hi,
read this : http://www.maratis3d.org/?p=277

237

(4 replies, posted in Scripting)

Look at the wiki in "Input" : http://wiki.maratis3d.org/index.php?title=Lua_scripting
"getAxis(axis)" and clic on "axis" (it's a link)

238

(36 replies, posted in General)

good smile

yes, that's what I figured out, a non-uniform scale (not the same scale on each axis) can deform the rotation angles, it's a bit tricky.

239

(36 replies, posted in General)

It's maybe not optimal for you as you are updating the full armature, but it can help you debug your code or prototype ?
Let me know if it worked with your armature.

240

(33 replies, posted in General)

Hi !

I should look again to be sure, but I didn't find the flags "ASSIMP_BUILD_BOOST_WORKAROUND ASSIMP_BUILD_NO_OWN_ZLIB" anywhere in the xcode project, or I missed it or it didn't get generated ?

241

(36 replies, posted in General)

I made a small example with a behavior code to attach a bone to an entity : http://www.maratis3d.org/download/Armature.zip

After compiling, open the project.
Select "Jules" and look at the behaviors.
You can see the effect in-editor by moving the transparent boxes.

242

(36 replies, posted in General)

What I specially have a doubt is the order of the matrix multiplication for the offset, I need to check my math.

What you should do to check this potential axis problem is to visualize the bones in space,
disable the physics and all the parenting of your ragdoll objects and copy the bones transformation to the ragdoll objects.
At least you'll be able to see how the bones are oriented.

MMatrix4X4 boneWorldMatrix = (*entity->getMatrix()) * (*bone->getMatrix);
*object->getMatrix = boneWorldMatrix;
object->setPosition(boneWorldMatrix.getTranslationPart());
object->setEulerRotation(boneWorldMatrix.getEulerAngles());

243

(36 replies, posted in General)

For the offset calculation, I'm not totally sure, but it should be something like that (to be tested) :

// call this only at the first frame
MMatrix4X4 boneWorldMatrix = (*entity->getMatrix()) * (*bone->getMatrix());
MMatrix4X4 offsetMatrix = object->getMatrix()->getInverse() * boneWorldMatrix;
... // store the offset matrix
void copyTransformation(MOEntity * entity, MOBone * bone, MObject3d * object, MMatrix4X4 * offsetMatrix)
{
    MMatrix4X4 correctedWorldMatrix = (*object->getMatrix()) * (*offsetMatrix);
    MMatrix4X4 targetMatrix = entity->getMatrix()->getInverse * correctedWorldMatrix;

    *bone->getMatrix() = targetMatrix; // this is the actual armature space matrix

    // what comes after is only used to update the local coordinates position and rotation
    MObject3d * parentBone = bone->getParent();
    if(parentBone)
    {
        // calculate target matrix in parentBone's space
        targetMatrix = parentBone->getMatrix()->getInverse() * targetMatrix;
    }

    // get position and rotation coords from targetMatrix
    bone->setPosition(targetMatrix.getTranslationPart());
    bone->setEulerRotation(targetMatrix.getEulerAngles());
}

If you are 100% sure the bones are sorted, you can simplify the call :

for(i=0; i<bonesNumber; i++)
{
    MObject3d * object = ... // get the ragdoll
    MMatrix4X4 * offsetMatrix = ... // get the offset matrix
    copyTransformation(entity, armature->getBone(i), object, offsetMatrix);
}

// no need to call armature->processBonesLinking();
armature->updateBonesSkinMatrix(); // optional, is normally called by the renderer

244

(36 replies, posted in General)

I don't see something wrong in the code, if you get the same result, your code is right too, but you should not call "armature->processBonesLinking();" multiple time in your loop (it's slow because it update all the armature each time).

So if it's not that, the problem should be that the bones and the ragdoll objects axis are not synchronized :
- because the ragdoll objects are not oriented the same axis as the bones
- or because the bones are not oriented in a consistent way

Lets say they are not synchronized, but you manually placed the ragdoll on the first frame.
You can calculate the offset matrix at the first frame and store it.
Then, when you update the bones, you use this offset.

245

(36 replies, posted in General)

yes should be child.
the order is important, because you need the parent matrix to be updated to get the correct child matrix.

246

(2 replies, posted in Off-Topic)

I think I'm more Lity than Tity.
But the latter sounds better, damn... Am I wasting my life ??

247

(36 replies, posted in General)

You have to process the bones in the right order, from the roots to the childs.
It should be something like that :

void copyTransformation(MOEntity * entity, MOBone * bone, MObject3d * object)
{
    MMatrix4X4 targetMatrix = entity->getMatrix()->getInverse * (*object->getMatrix()); // get object matrix in armature space

    MObject3d * parentBone = bone->getParent();
    if(parentBone)
    {
        // calculate target matrix in parentBone's space
        targetMatrix = parentBone->getMatrix()->getInverse() * targetMatrix;
    }

    // get position and rotation coords from targetMatrix
    bone->setPosition(targetMatrix.getTranslationPart());
    bone->setEulerRotation(targetMatrix.getEulerAngles());
    bone->computeLocalMatrix();
}

void processChilds(MOEntity * entity, MOBone * bone)
{
    unsigned int i, childsNumber = bone->getChildsNumber();

    for(i=0; i<childsNumber; i++) // for all childs
    {
        MOBone * child = (MOBone *)bone->getChild(i);
        MObject3d * object = ... // get the associated ragdol object

        // compute parenting (parent matrix * child local matrix)
        copyTransformation(entity, child, object);
        (*child->getMatrix()) = (*bone->getMatrix()) * (*child->getMatrix());
        processChilds(entity, child);
    }
}

and during the update :

// start from the roots to the childs
for(i=0; i<bonesNumber; i++)
{
    MOBone * bone = armature->getBone(i);
    if(! bone->hasParent())
    {
        MObject3d * object = ... // get the associated ragdol object
        copyTransformation(entity, bone, object);
        processChilds(entity, bone);
    }
}

And in this case you don't need to call "armature->processBonesLinking();"

248

(33 replies, posted in General)

The Xcode for mac is generated.
But there is some error when compiling :

STEPFile.h "STEPFile.h:198:64: Use 'template' keyword to treat 'To' as a dependent template name"

I don't have errors with Assimp when building with Scons, but maybe we don't use the same version, did you update the Assimp lib ?

Maybe missing the flags "ASSIMP_BUILD_BOOST_WORKAROUND ASSIMP_BUILD_NO_OWN_ZLIB" ?

Additionally (but not related to the previous error), I didn't see the flag :
"M_PACKAGE_WRITABLE" for maratisEditor (not needed for the player)

I'm also not sure the runpath search path is defined (depending on the dylib installation path) but should be "@rpath"
or "@executable_path/../Frameworks @loader_path/../Frameworks"


With the ios option it stops before generating the xcode project :

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_LIBRARY
    linked by target "MaratisApp" in directory /Users/anaelseghezzi/Desktop/Maratis-ios/M/Additional/iOS

249

(16 replies, posted in Engine)

For the sound I need to check, try to do that first and get back to me.

250

(16 replies, posted in Engine)

To bind c++ code in lua, look at this doc : http://wiki.maratis3d.org/index.php?tit … iptContext

What you could do is something like that :

TheoraVideoManager * mgr = NULL;

// bind all your functions here (see wiki)

void StartPlugin(void)
{
    MEngine * engine = MEngine::getInstance();
    MScriptContext* script = engine->getScriptContext();

    // create the video manager
    mgr = new TheoraVideoManager();

    // register the script functions
    script->addFunction("loadVideoClip", loadVideoClip);
    script->addFunction("updateVideoClip", updateVideoClip);
    script->addFunction("playClip", playClip);
    script->addFunction("pauseClip", pauseClip);
    script->addFunction("stopClip", stopClip);
    script->addFunction("destroyVideoClip", destroyVideoClip);
    //etc...
}

void EndPlugin(void)
{
    // delete the video manager
    SAFE_DELETE(mgr);
}