Jump to content
  • Advertisement
Sign in to follow this  
Mehdi_H

object manipulation in ODE

This topic is 3585 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi every body... I'm novice to "Open Dynamic Engine" and I hope you can help me. when I want to made some changes to ODE rigidBodies in RunTime , it triggers a runTime error! For example I need To Re-Position an Object , or change Geom's parameters as a concequence of scaling or Removing a geom and add another ,etc... in RunTime. But when I run my program, a messageBox will apear showing an Error message! I read a tutorial from "Alan Baylis" ,mentions that we can't add/remove/reposition the geoms within a space when using "dSpaceCollide()". But there Must be a way to do these when it is necessary!How can you scale an Object in your projrect in runTime. How do you move your Object?... If you have any experience on this or you know a web resource , please let me know. thanx

Share this post


Link to post
Share on other sites
Advertisement
It sounds like you're trying to modify ODE's geometry once they've been created, and that's not going to work out too well, especially if you plan on modifying everything during the collisions, because every time something changed, the entire collision process would have to be restarted, but the original collisions would still have to be taken into account (in other words, it wouldn't be pretty).

There's nothing stopping you from destroying things, moving them, re-orientating them, re-creating them, etc. while there aren't any collisions happening, but you can't do it while it's trying to work out where things should be.

For instance, I had a similar issue when trying to destroy objects when things collided with them, and the only way it could be done was to delete the objects after the collisions were taken care of, by simply marking all of them for deletion when they were hit.

As for scaling objects, the only way you can do it is by continually deleting and recreating the objects.

Share this post


Link to post
Share on other sites
Ok...Thanx, It is working now.
But now there are other problems:

1- When I move my sphere with "dBodyAddForce(...)" paralel to a surface, it will move forever!

2- When I move object as above said, the direction of rolling on the surface is INVERTED. I mean if in reality a sphere roll on a plane clockwise, in my demo it do counter-clockwise! As I'm using DirectX for rendering,I thought it is because DirectX is using Left-Handed coord but maybe ODE Right-Handed. If it is So...How can I conver it?

rgds

Share this post


Link to post
Share on other sites
In a frictionless environment, things will move forever, or if you're always adding the forces, then things will always move forever... Either way, it's not exactly normal.

Assuming you've got your callback function somewhere, try to find the ones in the examples that come with ODE, and use the values they supply to see what effects they might have on your simulation. Also remember that you can use '0' (no quotes) for bodies when attaching contact joints to other bodies to connect them to nothing to simulate collisions with fixed objects (helps if the 'fixed' objects don't get affected by gravity too (there's a function that'll allow you to configure that)).

As for the rotation, you're right, but as for a solution, I'm sure you can find something if you search these forums (I haven't had to deal with it because I've only ever dealt with Open GL).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!