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.
226 2014-02-28 10:06:40
Re: Android build (7 replies, posted in General)
227 2014-02-28 09:56:48
Re: V8 JavaScript Engine ? (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 2014-02-27 11:39:03
Re: Is Maratis game engine dead? (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 2014-02-24 10:37:47
Re: iPhone publishing (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 2014-02-17 23:17:14
Re: Spelling for "meshes" folder (6 replies, posted in General)
don't, it's a valid point, I'm just showing the pros and cons
231 2014-02-17 23:15:06
Re: How to use MTextureRef? (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 2014-02-17 19:42:49
Re: Spelling for "meshes" folder (6 replies, posted in General)
Was there a reason that name was chosen?
A "not so good in english" french developer ?
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 2014-02-17 19:00:19
Re: Android build (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 2014-02-11 19:51:41
Re: CMake build system (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 2014-02-11 09:38:34
Re: Maratis based game engine! (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
236 2014-02-11 09:32:53
Re: No mesh when exporting from Blender to Maratis (2 replies, posted in General)
Hi,
read this : http://www.maratis3d.org/?p=277
237 2014-02-11 09:31:42
Re: Get mouse position (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 2014-02-10 17:32:56
Re: Bones manipulation (36 replies, posted in General)
good
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 2014-02-10 16:15:59
Re: Bones manipulation (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 2014-02-10 16:13:39
Re: CMake build system (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 2014-02-10 14:32:48
Re: Bones manipulation (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 2014-02-10 10:34:14
Re: Bones manipulation (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 2014-02-09 23:26:59
Re: Bones manipulation (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 2014-02-09 23:02:13
Re: Bones manipulation (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 2014-02-09 21:54:25
Re: Bones manipulation (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 2014-02-09 20:07:09
Re: Question for Anael (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 2014-02-09 19:55:03
Re: Bones manipulation (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 2014-02-09 12:48:02
Re: CMake build system (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 2014-02-09 10:52:49
Re: Game Cinematics (16 replies, posted in Engine)
For the sound I need to check, try to do that first and get back to me.
250 2014-02-09 10:51:05
Re: Game Cinematics (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);
}