Show Posts
|
|
Pages: [1] 2
|
|
1
|
Crystal Space Development / Support / Re: How to remove colliders and LCP error (ODE)
|
on: March 03, 2006, 05:41:38 pm
|
Thanks for your reply. the LCP error is harmless but appears to be some kind of bug in ODE. I can get hold of a patch to fix the bug if you want it? I only want to know what can generate this error. will remove the iRigidBody, not just the collider. Im not sure that this is what you want to do? should remove the collider box from the iRigidbody, you could try calling I have a mesh that is attached to a rigid body and i have a collider for this rigid body. When this object collide with the terrain i need to destroy the mesh, the rigid body and the collider.
|
|
|
|
|
2
|
Crystal Space Development / Support / How to remove colliders and LCP error (ODE)
|
on: February 25, 2006, 05:37:45 pm
|
Hi, I have two questions. 1. How to remove colliders from a dynamic rigid body? (It's a collider box) I have tried with this code but it seems does not work: m_body->SetCollisionCallback (0); m_body->SetMoveCallback (0); m_body->AttachMesh (0); m_body->DestroyColliders (); m_app->GetDynSys ()->RemoveBody (m_body);
2. What means this ODE error: "ODE Message 3: LCP internal error, s <= 0 (s=-1.0247e-011)" ? (I see it on the console when the application is running) Many thanks!!
|
|
|
|
|
6
|
Crystal Space Development / Support / Re: A problem with ODE (application crash)
|
on: February 19, 2006, 12:02:17 pm
|
The error: Exception first-chance a 0x6fef48e5 (libode-cs.dll) in CS_demoapp_debug.exe: 0xC00000FD: Stack overflow. Exception not managed a 0x6fef48e5 (libode-cs.dll) in CS_demoapp_debug.exe: 0xC00000FD: Stack overflow.
The application crashes at this point: File: chkstk.asm ... probepages: sub ecx,_PAGESIZE_ ; yes, move down a page sub eax,_PAGESIZE_ ; adjust request and...
test dword ptr [ecx],eax ; ...probe it <= THIS is the crash point.
cmp eax,_PAGESIZE_ ; more than one page requested? jae short probepages ; no ...
Registers state: EAX = 00003510 EBX = 0000015E ECX = 000322C4 EDX = 00000000 ESI = 0001E140 EDI = 0012C338 EIP = 6FEF48E5 ESP = 000A72BC EBP = 000A7308 EFL = 00000202
000322C4 = 00000000
Calls stack: >libode-cs.dll!_chkstk() Riga 91 Asm libode-cs.dll!dInternalStepIsland_x2(dxWorld * world=0x3cbaae2a, dxBody * const * body=0x3cbf0251, int nb=1035430810, dxJoint * const * _joint=0xbd28f984, int nj=1018076078, float stepsize=0.080142036) Riga 1586 C++ libode-cs.dll!dxProcessIslands(dxWorld * world=0x00d66f10, float stepsize=0.0099999998, void (dxWorld *, dxBody * const *, int, dxJoint * const *, int, float)* stepper=0x6fecb960) Riga 242 + 0x15 C++ libode-cs.dll!dWorldStep(dxWorld * w=0x00d66f10, float stepsize=0.0099999998) Riga 1309 + 0x10 C++ odedynam.dll!csODEDynamicSystem::Step(float elapsed_time=0.0099999998) Riga 716 + 0xc C++ CS_demoapp_debug.exe!cMainProgram::ProcessFrame() Riga 182 + 0x2e C++ CS_demoapp_debug.exe!csBaseEventHandler::HandleEvent(iEvent & event={...}) Riga 118 C++ CS_demoapp_debug.exe!csBaseEventHandler::EventHandlerImpl::HandleEvent(iEvent & event={...}) Riga 88 C++ CS_demoapp_debug.exe!csEventTree::Dispatch(iEvent & e={...}) Riga 558 + 0xe C++ CS_demoapp_debug.exe!csEventTree::Notify() Riga 529 C++ CS_demoapp_debug.exe!csEventQueue::Notify(const unsigned long & name=5) Riga 272 C++ CS_demoapp_debug.exe!csEventQueue::iTypedFrameEventDispatcher::HandleEvent(iEvent & __formal={...}) Riga 261 C++ CS_demoapp_debug.exe!csEventTree::Dispatch(iEvent & e={...}) Riga 558 + 0xe C++ CS_demoapp_debug.exe!csEventTree::Notify() Riga 529 C++ CS_demoapp_debug.exe!csEventQueue::Notify(const unsigned long & name=1) Riga 272 C++ CS_demoapp_debug.exe!csEventQueue::Process() Riga 292 C++ CS_demoapp_debug.exe!csDefaultRunLoop(iObjectRegistry * r=0x00a4ff50) Riga 91 C++ CS_demoapp_debug.exe!csApplicationFramework::Run() Riga 322 + 0xb C++ CS_demoapp_debug.exe!cMainProgram::Application() Riga 388 C++ CS_demoapp_debug.exe!csApplicationFramework::Start() Riga 72 C++ CS_demoapp_debug.exe!csApplicationFramework::Main(int argc=1, char * * argv=0x00a23f78) Riga 124 + 0x7 C++ CS_demoapp_debug.exe!csApplicationRunner<cMainProgram>::Run(int argc=1, char * * argv=0x00a23f78) Riga 433 + 0x13 C++ CS_demoapp_debug.exe!main(int argc=1, char * * argv=0x00a23f78) Riga 489 + 0xd C++ CS_demoapp_debug.exe!mainCRTStartup() Riga 398 + 0x11 C kernel32.dll!7c816d4f() ntdll.dll!7c925b4f() kernel32.dll!7c8399f3()
The output using "-verbose=-scf": CS_demoapp_debug.exe -verbose=-scf VFS_NOTIFY: loaded configuration file: C:\Programmi\crystalspace\vfs.cfg NOTIFY: Could not get sound loader NOTIFY: Could not get sound loader (v2) NOTIFY: Could not get sound driver NOTIFY: Could not get sound driver (v2)
crystalspace.graphics3d.opengl: Texture LOD bias -0.3 csDetectDriver: monitor name is '\\.\DISPLAY1' csDetectDriver: driver name is 'ATI2DVAG' csDetectDriver: found DLL 'atioglxx.dll'
crystalspace.canvas.openglwin: GL driver: atioglxx.dll 6.14.10.5396
crystalspace.canvas.openglcommon.driverdb: Applied: Work around broken ATI point sprites Applied: ATI: Can't handle GL_BLEND texenv for GL_INTENSITY textures Applied: ATI: Can't handle compressed formats for RECT textures Applied: ATI: RECT texture extension support apparently sucks Applied: ATI: Use AFP for some 2D drawing
crystalspace.canvas.openglcommon: OpenGL renderer: RADEON 9000 DDR x86/SSE2 (vendor: ATI Technologies Inc.) version 1.3.1014 WinXP Release Using windowed mode at resolution 640x480. Pixel format: Color: 32 Alpha: 8 Depth: 24 Stencil: 8 AccumColor: 0 AccumAlpha: 0 MultiSamples: 0
crystalspace.canvas.opengl.extmgr: GL Extension 'GL_ARB_multitexture' found and used. GL Extension 'GL_ARB_texture_env_combine' found and used. GL Extension 'GL_ARB_multisample' not found. GL Extension 'GL_ARB_fragment_program' not found.
crystalspace.canvas.openglcommon.fontcache: Text drawing method: Multitexturing
crystalspace.canvas.opengl.extmgr: WGL Extension 'WGL_ARB_extensions_string' found and used. WGL Extension 'WGL_EXT_swap_control' found and used.
crystalspace.canvas.openglwin: VSync is disabled.
crystalspace.canvas.opengl.extmgr: GL Extension 'GL_version_1_2' found and used. GL Extension 'GL_ARB_texture_cube_map' found and used. GL Extension 'GL_EXT_texture3D' found and used. GL Extension 'GL_ARB_vertex_buffer_object' found and used. GL Extension 'GL_SGIS_generate_mipmap' found and used. GL Extension 'GL_EXT_texture_filter_anisotropic' found and used. GL Extension 'GL_EXT_texture_lod_bias' found and used. GL Extension 'GL_ARB_point_parameters' found and used. GL Extension 'GL_ARB_point_sprite' not found. GL Extension 'GL_EXT_framebuffer_object' not found. GL Extension 'GL_ARB_texture_rectangle' not found. GL Extension 'GL_EXT_texture_rectangle' found, but not used. GL Extension 'GL_NV_texture_rectangle' not found. GL Extension 'GL_ARB_vertex_program' found and used. GL Extension 'GL_EXT_secondary_color' found and used.
crystalspace.graphics3d.opengl: Maximum texture size is 2048x2048
crystalspace.graphics3d.opengl.vbo: Setting up VBO buffers, VB: 32 MB IB: 16 MB
crystalspace.graphics3d.opengl: Stencil clipping is used for objects >= 50 triangles. Clearing Z buffer when stencil clear is needed enabled
crystalspace.graphics3d.shadermgr: Loaded compiler plugin crystalspace.graphics3d.shadercompiler.xmlshader, compiler: XMLShader
crystalspace.canvas.opengl.extmgr: GL Extension 'GL_ARB_texture_compression' found and used. GL Extension 'GL_EXT_texture_compression_s3tc' found and used.
crystalspace.graphics3d.opengl: Render-to-texture backend: framebuffer Delayed buffer swapping: disabled AFP DrawPixmap() workaround: disabled
crystalspace.graphics3d.shadercompiler.xmlshader: Shader std_lighting_fixed: 8 variations Shader std_lighting: 12 variations Shader std_lighting_portal: unvarying
crystalspace.mesh.object.thing: Lightmap quality=3 Lightmapping enabled=1
crystalspace.engine.notify: Lightmaps are not up to date (no 'lm_precalc_info' found in cache). Recalculation of lightmaps forced. Initializing lighting (2 meshes). Shining lights (0 lights). Time taken: 0.0000 seconds. CS_demoapp DEBUG mode start
crystalspace.canvas.opengl.extmgr: GL Extension 'GL_ATI_fragment_shader' found and used.
crystalspace.graphics3d.shader.glcg: Routing Cg fragment programs to Pixel Shader plugin ON (default).
crystalspace.canvas.opengl.extmgr: GL Extension 'GL_NV_texture_shader' not found. GL Extension 'GL_NV_texture_shader2' not found.
crystalspace.graphics3d.shader.glcg: CG ERROR : The compile returned an error. (39) : warning C7006: uninitialized variable "A2F.surface.texture" used (169) : fatal error C9999: sampler parameter to texture function not a uniform sampler
crystalspace.graphics3d.shadercompiler.xmlshader: Shader 'std_lighting'<2>: Technique with priority 150 fails. Reason: fragment program failed to load. No technique validated for shader 'std_lighting'<2>: using fallback
crystalspace.canvas.opengl.extmgr: GL Extension 'GL_EXT_separate_specular_color' found and used. GL Extension 'GL_ARB_texture_env_dot3' found and used.
crystalspace.graphics3d.shader.fixed: Multitexture units: acceptable 6
crystalspace.graphics3d.shadercompiler.xmlshader: Shader 'std_lighting_fixed'<2>: Technique with priority 200 succeeds!
If needed i can give to you the source code (is not long).My computer: Micosoft Windows XP Home SP2 ATI Radeon 9000 Crystal Space: latest Pseudo Stable Release (0.99 from 27 January 2006) build with Microsoft Visual Studio 7.1
|
|
|
|
|
7
|
Crystal Space Development / Support / A problem with ODE (application crash)
|
on: February 18, 2006, 04:26:09 pm
|
Hi, I have added the physics to my demo application. I'm using ODE and i have taken the ideas from phystut tutorial. I have the plane terrain: ... csRef<iMeshWrapper> terrain (engine->CreateSectorWallsMesh (mainsect, "terrain")); terrain_object = m_mesh->GetMeshObject (); terrain_factory = terrain_object->GetFactory(); terrain_state = scfQueryInterface<iThingFactoryState> (terrain_factory); terrain_state->AddQuad (csVector3 (0.0f, 0.0f, 0.0f), csVector3 (30.0f, 0.0f, 0.0f), csVector3 (30.0f, 0.0f, -30.0f), csVector3 (0.0f, 0.0f, -30.0f)); ... terrain_body = dynsys->CreateBody (); terrain_body->SetPosition (csVector3 (15.0f, 0.0f, -15.0f)); terrain_body->SetMoveCallback (0); terrain_body->MakeStatic (); dynsys->AttachColliderMesh (terrain, csOrthoTransform (), 10.0f, 0.0f); int i; for (i = 0; i < terrain_state->GetPolygonCount(); i++) { terrain_body->AttachColliderPlane (terrain_state->GetPolygonObjectPlane (i), 10.0f, 0.0f, 0.0f); } ...
And this is the object that must fall down: ... csVector3 meshpos (10.0f, 20.0f, -15.0f); ... csRef<iMeshWrapper> asteroid (engine->CreateSectorWallsMesh (m_world, "asteroid")); asteroid_object = asteroid->GetMeshObject (); asteroid_factory = asteroid_object->GetFactory(); asteroid_state = scfQueryInterface<iThingFactoryState> (asteroid_factory); asteroid_state->AddOutsideBox (csVector3(0.0f, 0.0f, 0.0f), csVector3(0.5f, 0.5f, 0.5f)); ... moveast = asteroid->GetMovable (); moveast->SetPosition (meshpos); moveast->UpdateMove (); ... ast_body = dynsys->CreateBody (); ast_body->SetProperties (1.0f, csVector3 (0), csMatrix3 ()); ast_body->SetPosition (meshpos); ast_body->AttachMesh (asteroid); ast_body->AttachColliderBox (csVector3 (0.5f, 0.5f, 0.5f), csOrthoTransform (csMatrix3 (), csVector3 (0)), 0.0f, 1.0f, 0.0f); ...
It seems to work fine but when the object collide with the terrain the application crashes. I have seen this (on phystut): csVector3 size (10.0f, 10.0f, 10.0f); // This should be the same size as the mesh. t.SetOrigin(csVector3(10.0f,0.0f,0.0f)); dynSys->AttachColliderBox (size, t, 10, 0); t.SetOrigin(csVector3(-10.0f,0.0f,0.0f)); dynSys->AttachColliderBox (size, t, 10, 0); t.SetOrigin(csVector3(0.0f,10.0f,0.0f)); dynSys->AttachColliderBox (size, t, 10, 0); t.SetOrigin(csVector3(0.0f,-10.0f,0.0f)); dynSys->AttachColliderBox (size, t, 10, 0); t.SetOrigin(csVector3(0.0f,0.0f,10.0f)); dynSys->AttachColliderBox (size, t, 10, 0); t.SetOrigin(csVector3(0.0f,0.0f,-10.0f)); dynSys->AttachColliderBox (size, t, 10, 0);
But i don't understand how it works. (I have understood that can be the solution to my problem) Many thanks for you help!!
|
|
|
|
|
8
|
Crystal Space Development / Support / a stupid question about GetElapsedTicks
|
on: February 14, 2006, 06:05:15 pm
|
From the simple1 tutorial (docs/html/manual/cs_4.3.1.5.html#4.3.1.5): void Simple::ProcessFrame () { ... // First get elapsed time from the virtual clock. csTicks elapsed_time = vc->GetElapsedTicks (); ...
How is calculated the value returned by GetElapsedTicks? Is it the time passed since the last frame? Many Thanks!
|
|
|
|
|
9
|
Crystal Space Development / Support / Re: Light problem!
|
on: February 11, 2006, 12:08:17 pm
|
I lost two days for this joke! (but now i find the solution) The old code i wrote (with the unwanted result): csRef<iMeshWrapper> terrain (engine->CreateSectorWallsMesh (mainsect, "terrain")); terrain_object = terrain->GetMeshObject (); terrain_factory = terrain_object->GetFactory(); terrain_state = scfQueryInterface<iThingFactoryState> (terrain_factory);
//********************* NOTE THIS ****************************************** terrain_state->AddQuad (csVector3 (0.0f, 0.0f, 0.0f), csVector3 (100.0f, 0.0f, 0.0f), csVector3 (100.0f, 0.0f, -100.0f), csVector3 (0.0f, 0.0f, -100.0f)); //************************************************************************* terrain_state->SetPolygonMaterial (CS_POLYRANGE_LAST, tm); terrain_state->SetPolygonTextureMapping (CS_POLYRANGE_LAST, 3);
ll = mainsect->GetLights (); light = engine->CreateLight (0, csVector3 (10.0, 10.0, -10.0), 20.0, csColor (1.0, 0.0, 0.0), CS_LIGHT_DYNAMICTYPE_PSEUDO); ll->Add (light); light = engine->CreateLight (0, csVector3 (10.0, 10.0, -20.0), 20.0, csColor (0.0, 0.0, 1.0), CS_LIGHT_DYNAMICTYPE_PSEUDO); ll->Add (light); light = engine->CreateLight (0, csVector3 (15.0, 15.0, -15.0), 20.0, csColor (0.0, 1.0, 0.0), CS_LIGHT_DYNAMICTYPE_PSEUDO); ll->Add (light);
 The new code (corrected): csRef<iMeshWrapper> terrain (engine->CreateSectorWallsMesh (mainsect, "terrain")); terrain_object = terrain->GetMeshObject (); terrain_factory = terrain_object->GetFactory(); terrain_state = scfQueryInterface<iThingFactoryState> (terrain_factory);
terrain_state->AddQuad (csVector3 (0.0, 0.0, 0.0), csVector3 (30.0, 0.0, 0.0), csVector3 (30.0, 0.0, -30.0), csVector3 (0.0, 0.0, -30.0)); terrain_state->SetPolygonMaterial (CS_POLYRANGE_LAST, tm); terrain_state->SetPolygonTextureMapping (CS_POLYRANGE_LAST, 3);
ll = mainsect->GetLights (); light = engine->CreateLight (0, csVector3 (10.0, 10.0, -10.0), 20.0, csColor (1.0, 0.0, 0.0), CS_LIGHT_DYNAMICTYPE_PSEUDO); ll->Add (light); light = engine->CreateLight (0, csVector3 (10.0, 10.0, -20.0), 20.0, csColor (0.0, 0.0, 1.0), CS_LIGHT_DYNAMICTYPE_PSEUDO); ll->Add (light); light = engine->CreateLight (0, csVector3 (15.0, 15.0, -15.0), 20.0, csColor (0.0, 1.0, 0.0), CS_LIGHT_DYNAMICTYPE_PSEUDO); ll->Add (light);
and the (good) result:  Now all works fine!
|
|
|
|
|
10
|
Crystal Space Development / Support / Re: Light problem!
|
on: February 09, 2006, 10:04:51 pm
|
But, why i can see the mesh if i don't have set any light? I explain: 1. I created my plane mesh (as the code above). I compile and i run the application and i don't see the mesh (i see a black screen). This is ok. 2. I added the ambient light (I don't change lighting at runtime), i compiled, run, and i correctly see the mesh. 3. I removed the ambient light. I added the static light. I compiled, run, and i see the mesh. I had expected a black screen. Always remain the color: engine->SetAmbientLight (csColor (1.0f, 1.0f, 1.0f)); 1. Use a Pseudo-dynamic light. That one can change intensity at runtime. 2. Use dynamic ambient (and not the static ambient that you were using). Check out iSector on how to set dynamic ambient.
I will try it. Many thanks.
|
|
|
|
|
11
|
Crystal Space Development / Support / Re: Light problem!
|
on: February 09, 2006, 06:15:13 pm
|
Edit: And i also tried this: ll = mainsect->GetLights ();
light = engine->CreateLight (0, csVector3 (1.0f, 1.0f, 1.0f), 10.0f, csColor (1.0f, 0.0f, 0.0f)); ll->Add (light);
But still does not work.
|
|
|
|
|
12
|
Crystal Space Development / Support / Light problem!
|
on: February 09, 2006, 06:10:38 pm
|
Hi, I wrote this simple code that create a plane terrain. loader->LoadTexture ("stone", "/lib/std/stone4.gif");
tm = engine->GetMaterialList ()->FindByName ("stone"); csRef<iMeshWrapper> terrain (engine->CreateSectorWallsMesh (mainsect, "terrain")); terrain_object = terrain->GetMeshObject (); terrain_factory = terrain_object->GetFactory(); terrain_state = scfQueryInterface<iThingFactoryState> (terrain_factory);
terrain_state->AddQuad (csVector3 (0.0f, 0.0f, 0.0f), csVector3 (100.0f, 0.0f, 0.0f), csVector3 (100.0f, 0.0f, -100.0f), csVector3 (0.0f, 0.0f, -100.0f));
terrain_state->SetPolygonMaterial (CS_POLYRANGE_LAST, tm); terrain_state->SetPolygonTextureMapping (CS_POLYRANGE_LAST, 3);
I added this and all works fine. engine->SetAmbientLight (csColor (1.0f, 1.0f, 1.0f)); I tried to change the color of the ambient light (I changed SetAmbientLight parameters): engine->SetAmbientLight (csColor (0.01f, 0.0f, 0.02f)); But it does not work! Light seems to remain as above (all 1.0f). I also tried to delete the SetAmbientLight and write this: ll = mainsect->GetLights ();
light = engine->CreateLight (0, csVector3 (0.0f, 0.0f, 0.0f), 0.0f, csColor (0.0f, 0.0f, 0.0f)); ll->Add (light);
And nothing changed. Note i have this: engine->SetLightingCacheMode (0); My environment: Windows XP Home SP2 ATI Radeon 9000 (with last driver) Visual Studio 7.1 Last pseudo-stable Crystal Space Many thanks for your help!!
|
|
|
|
|
13
|
Crystal Space Development / General Crystal Space Discussion / Re: Making Crystal Space Easier: Tutorials, documents, wiki, demos
|
on: February 01, 2006, 06:35:43 pm
|
|
Hi, I am developing a game* to learn CS, following the Jorrit advice. I can invest approximately 7 hours every week in developing. I hope to release the first beta in august (2006). My idea is to make a tutorial that explain how i have done the game. I will write it in italian (my language). I will translate it to english after (with some help because my english is insufficient).
I can't promise nothing but i will work hard to learn CS and make my first demo.
*: At the begin is a simple game. I'm working on a easy game where some objects (spheres) fall down on a terrain (plane). The mission is to destroy it before they impact on the terrain. (yes, this is a innovative idea!). I will improve it step by step (ex: best mesh, more gameplay, etc...)
|
|
|
|
|
14
|
Crystal Space Development / Support / Re: How to know Crystal Space
|
on: January 29, 2006, 03:03:59 pm
|
I think the best strategy is to just jump in and try to expand the tutorials so that they go in the direction of the game you want to make. In fact i want to do this but starting is not easy because i don't have ideas about the organization of the class hierarchy for my specific game data. This is due that i don't know "professional" use of crystal space. I think a more complete tutorial is needed in the further release of the engine. Just only to have a better vision about the engine (before writing a game). However i will see some complete games made with crystal space to take and know the usage of CS. Reading the documentation I'm reading the documentation and I'm learning what is possible and what not. Many thanks for your help!
|
|
|
|
|
|