Hi !
yes it returns a table (getPosition renvoi un tableau) :
pos = getPosition(object)
x = pos[1]
y = pos[2]
z = pos[3]
You are not logged in. Please login or register.
Maratis forum » Posts by anael
Hi !
yes it returns a table (getPosition renvoi un tableau) :
pos = getPosition(object)
x = pos[1]
y = pos[2]
z = pos[3]
Hi,
yes, the int array will be faster in most general cases,
there is some ways to accelerate the vector class by reserving some space etc,
so it depend what is the use of your array.
For exemple, Maratis uses vector for objects list and it's fast,
but for the mesh data, the arrays are not using arrays (lots of access etc)
You can also create a dynamic array in c++ using :
int * myArray = new [NB];
delete [] myArray;
yes, it's really irritating, knowing that I already installed 2 anti bot extensions...
I'll try this one, thanks.
And here's a test build !
http://maratis.googlecode.com/files/Mar
x86-32.zip
Hi there, I just finished making a MGui native file browser, it will need some improvements but it's working cross-platform,
and finally concludes a full Linux port :
Changes are on svn, I will soon publish some beta builds, the linux version need to be tested
Cheers,
Anaël.
If your behavior is the first on the list, behaviorId will be 0, the second will be 1 etc
"variable name" will be "target" for the LookAt behavior, and then you can set the variable.
try :
setBehaviorVariable(camera, 0, "target", "object2")
Alinor : I don't remember if we talked about your question, for the transparent effect, you can play with the "opacity" value of the object material. If your object is an instance (if the mesh is used by multiple entities) you'll have to make a copy of the mesh for each entity (in the constructor of the behavior for example).
Hi,
what version of blender do you use ?
Also, is it possible for you to send a mesh file that crash ?
Hi,
I'll have a look, for now I will say that the very important thing you need to do is using
functions to create generic stuff and reuse code on maximum. For exemple, when you see
that you are doing something more than one, make a function and call the function.
And for your variable, try to pack it in class or tables.
You can also cut your script and distribute it in multiple files for better clarity
(for example you can put all the functions in a separate lua file)
But I should say that the best way to make a game is to create all the generic and consuming stuff
as c++ behavior, and then do the logic in lua. Because once a behavior is done, you just have to put it on an object
and the time you finally gain is uge.
Ok, je peux corriger ça,
par contre, si je corrige ça risque de casser les scripts, il faudra remettre les bonnes valeurs.
The force is not scale dependent, but are you saying you need to apply a bigger force to move a bigger object at the same speed as a smaller one ? Also, it can depend of the mass, when the mass is bigger you need a bigger force.
did you try running what is created in dev/prod/ ?
Waw, that's amazing !
I'm very happy to see that, it looks very promising.
I'm looking forward to see this evolving, tell me is you need something.
Nice, it's impressive !
And the light and sound are pretty immerse, I like the dramatic shadow.
Thank you, I'll try to finish that this week-end,
I'll make a minimal file selection window to load files,
the rest looks to work normally.
I tried on Ubuntu, the compilation went fine,
when I first tried to launch Maratis, it was just missing "libopenal.so.1
" which was not copied with the executable.
And for MaratisPlayer, I also have this Segmentation fault, I'll have a look. [EDIT] > something is wrong with the full-screen (don't know what yet)
I'll commit your patch.
Thank you !! The Linux release is close !
Hi,
it's a long process and unfortunately I don't have enough resources or founds to spend more time that I actually do.
But I probably spend 1 or 2h every day working on it, responding to mails, questions, removing the forum spams, correcting bugs and improving.
The previous big development was the iOS full support (openGLES1 and ES2), and currently we are spending some time on the Linux port and bug correction. There is also more and more contribution, mainly from this forum, examples, tutorials etc.
The release process is also long, but If you want to follow the development, you can see how it is going on the google.code page :
http://code.google.com/p/maratis/source/list
Regards,
Anaël.
Hi oreo,
welcome and thank you a lot for this, that's exactly what was missing !
I will try it and commit your work to svn !
The Maratis Player executable is supposed to be run from a command line (or a batch)
but it should not crash, but today I noticed a mistake in the destroying of the X11 MWindow port, so it's maybe this.
Let's keep in touch, it will be nice to have your feedbacks.
You'll see that the file selector are still missing in the X11 port, I didn't manage to find an equivalent,
maybe the best will be to try to do the file selection manually using MGui and not with a system dependent function.
Hi linux-man, thanks for trying,
the scons build system is missing some work for it to work on linux,
and as it is a contributor that made the scons system, I don't have the knowledge myself
to finish it. I guess it's missing the link to the MGUI/X11 port and the needed linux libs (X11 etc).
Hi, it looks interesting,
the software generate glsl shaders, so it's possible to adapt them,
there is just some difference that make them incompatible as-it :
The difference is mainly the use of the data (vertex, normal, uv...) and the matrices.
This software use fixed functions that are now deprecated and that Maratis doesn't use to be sure that the shaders will be compatible with openglES and future versions of openGL. I should make a doc about it.
Mesh data :
attribute vec3 Vertex;
attribute vec3 Normal;
attribute vec3 Tangent;
attribute vec3 Color;
Matrices :
- "gl_ModelViewMatrix" is replaced by "ModelViewMatrix" (declared on top with "uniform mat4 ModelViewMatrix;")
- "gl_NormalMatrix" is replaced by "NormalMatrix" (declared on top with "uniform mat4 NormalMatrix;")
- "gl_ModelViewProjectionMatrix" is replaced by "ProjModelViewMatrix"
etc
exemple :
varying vec3 Normal;
varying vec3 EyeDir;
varying vec4 EyePos;
varying float LightIntensity;
uniform vec3 LightPos;
void main(void)
{
gl_Position = ftransform();
Normal = normalize(gl_NormalMatrix * gl_Normal);
vec4 pos = gl_ModelViewMatrix * gl_Vertex;
EyeDir = pos.xyz;
EyePos = gl_ModelViewProjectionMatrix * gl_Vertex;
LightIntensity = max(dot(normalize(LightPos - EyeDir), Normal), 0.0);
}
Will be :
varying vec3 Normal;
varying vec3 EyeDir;
varying vec4 EyePos;
varying float LightIntensity;
// Maratis Mesh data
attribute vec3 Vertex;
attribute vec3 Normal;
// Maratis standard matrices
uniform mat4 ModelViewMatrix;
uniform mat4 ProjModelViewMatrix;
uniform mat4 NormalMatrix;
// 4 nearest Maratis lights
uniform vec4 LightPosition[4];
void main(void)
{
gl_Position = ProjModelViewMatrix * vec4(Vertex, 1.0);
Normal = normalize((NormalMatrix * vec4(Normal, 1.0)).xyz);
vec4 pos = ModelViewMatrix * vec4(Vertex, 1.0);
EyeDir = pos.xyz;
EyePos = ProjModelViewMatrix * vec4(Vertex, 1.0);
LightIntensity = max(dot(normalize(LightPosition[0] - EyeDir), Normal), 0.0);
}
I'm not sure about adding an option to disable depth test for a single object, it might cause some problems, for a non-flat object, it will make the polygons of the objects penetrating themselves. It will produce the same problem with shadows, if the object was supposed to penetrate a wall, the wall shadow will still cut the object where he was supposed to penetrate the wall.
personally, for the player gun in a fps, I would reduce the size of the gun to be sure it's less than the collision box and put it closer to the camera eye.
If you really don't want to change the size, you can do a separate layer like the GUI, and put the 3d gun in a separate scene that you render after the game scene.
Through sdk you can do everything, the difficulty is to do it before drawing an object.
But there is maybe a simpler way, what do you want to do ?
Exemple to disable zbuffer :
MRenderingContext * render = engine->getRenderingontext();
// you can clear zbuffer
render->clear(M_BUFFER_DEPTH);
// or disable depth test completly
render->disableDepthTest(); // re-enable by doing : render->enableDepthTest();
// or just disable writing to depth
render->setDepthMask(1); // re-enable by doing : render->setDepthMask(0);
"onKeyDown" is not affected, except for the same keys that was not recognized on windows "LSHIFT etc".
Your problem with "onKeyDown" is probably just linked with the use of "flush" yes. You need to flush the keys only after doing all your code logic, best is to put your code just after or before the script call :
If you want to call it before the script, you are not forced to redo all the update game function :
void MyGame::update(void)
{
// put your code here
MGame::update(void);
}
But if you want to call it after the script, you need to redo all the update function :
void MyGame::update(void)
{
MEngine * engine = MEngine::getInstance();
// run script
if(engine->getScriptContext())
engine->getScriptContext()->callFunction("onSceneUpdate");
// put your code here
// get level
MLevel * level = MEngine::getInstance()->getLevel();
if(! level)
return;
// get current scene
MScene * scene = level->getCurrentScene();
if(! scene)
return;
// update behaviors
unsigned int i;
unsigned int oSize = scene->getObjectsNumber();
for(i=0; i<oSize; i++)
{
MObject3d * object = scene->getObjectByIndex(i);
if(! object->isActive())
continue;
object->updateBehaviors();
}
// update scene
scene->update();
// update physics
scene->updatePhysics();
// update objects matrices
scene->updateObjectsMatrices();
// flush input
engine->getInputContext()->flush();
}
it's corrected, there was a bug on windows keys,
the new code is available on SVN trunk, if you have visual studio you can build it
(just open trunk/dev/Projects/VisualStudio2005/Maratis.sln and run the build in "release").
Strange, it's working for me, at least on mac,
I'll try later on windows.
Maratis forum » Posts by anael
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.