Crystal Space
Welcome, Guest. Please login or register.
November 27, 2014, 07:48:18 am

Login with username, password and session length
Search:     Advanced search
9026 Posts in 2046 Topics by 9141 Members
Latest Member: Corneliussummers
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  ODE physics misbehaving
« previous next »
Pages: [1] Print
Author Topic: ODE physics misbehaving  (Read 2576 times)
pete.wells
Newbie
*
Posts: 4


View Profile Email
« on: September 09, 2007, 03:33:23 pm »

Hi there,

I'm very new to CS and am trying to get a very simple example of
collision response working using ODE.

So far I have created a plane and a cube in blender and exported it as
a level (with some gravity) using blend2crystal.

The level loads fine but the cube falls onto the plane and starts
acting strangely (not coming to a rest int the position that you would
expect).

I have compile ODE with double precision and OPCODE support and am
using version 0.8.1

my CS version is 1.0.2

I have attached a copy of the source and the world.

Can anybody tell me why the cube is not acting as you would expect?

I'd greatly appreciate any help,

Regards,

Pete

* q3.cpp.txt (8.93 KB - downloaded 161 times.)
* q3.h.txt (0.86 KB - downloaded 163 times.)
* world.txt (2.87 KB - downloaded 158 times.)
Logged
Sjobak
Newbie
*
Posts: 11


View Profile
« Reply #1 on: September 09, 2007, 08:36:58 pm »

For some reason the lines below have been commented out in csODEDynamicSystem::AttachColliderBox() from
odedynam.cpp. Not sure if it will solve your problem, but you might try to uncomment the lines and see what
happens.
Code:
  //odec->SetElasticity (elasticity);
  //odec->SetFriction (friction);
  //odec->SetSoftness (softness)

Peter
Logged
pete.wells
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: September 09, 2007, 09:58:22 pm »

Hi Sjobak,

Thanks for your response,

I uncommented all commented lines in that function and then recompiled both CS and my application but unfortunately the same problem exists (cube falls onto plane and starts rocking around strangely). 

Do you have any more suggestions?

Regards,

Pete
Logged
Sjobak
Newbie
*
Posts: 11


View Profile
« Reply #3 on: September 10, 2007, 03:10:57 pm »

You say the cube act strange. What exactly do you mean?

You might try a different type of collider. Instead of a plane, you might
create a cube for the surface and add a box collider instead of a mesh
collider.
Logged
pete.wells
Newbie
*
Posts: 4


View Profile Email
« Reply #4 on: September 10, 2007, 09:34:44 pm »

Hi Sjobak,

When I say acting strangely, the cube (rotated so that a corner hits the ground first) falls towards the plane, bounces around slightly and ends up coming to a rest entirely on a corner or an edge.  This seems a little strange as I was expecting the cube to end up resting on one of its faces. 

I will give the box collider a go,

Regards,

Pete
Logged
Darek
Newbie
*
Posts: 48



View Profile
« Reply #5 on: September 11, 2007, 07:26:35 am »

check how phystut application works for you, using space you can shoot objects
if works fine, then you miss something in your application, if works bad then something is wrong with your ODE, try to use 0.6 without any combinations, just default compilation
Logged
Sjobak
Newbie
*
Posts: 11


View Profile
« Reply #6 on: September 11, 2007, 09:42:42 am »

Oh, and I just found out that you have to be careful with 'Apply Scale/Rotation'
when using a box collider. Normally before exporting with B2CS you would do
an 'Apply Scale/Rotation' in Blender.

While exporting it seems that to create the parameters for a box collider the
DimX, DimY and DimZ settings of the object are used. When 'Apply Scale/Rotation'
is applied, this will result in a wrong set of parameters. In your case you rotate
a cube 45 degrees and when 'Apply Scale/Rotation' is used this results in DimZ
and DimX being the length of the diagonal of the side of the cube. So that
would indeed have the effect your are seeing.

Just to let you know.

Greetings,

Peter
Logged
pete.wells
Newbie
*
Posts: 4


View Profile Email
« Reply #7 on: September 13, 2007, 12:00:57 pm »

Hi there,

I took a few steps back and used blender only to create simple objects (no dynamics) and implemented the rigid bodies and colliders manually in my program using only box colliders. 

Now everything is working as expected (cube falls onto larger cube, lands corner first, then ends up coming to rest of one of its faces). 

Box and Mesh also works fine, however, Mesh and Mesh collisions act strangely. 

Does anyone know if there are currently issues with using Mesh to Mesh collisions with ODE?

Regards,

Pete

Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.541 seconds with 15 queries.