Bajter
29-06-2008 21:22:20
Hello,
I wanted to ask, about maybe not really specific problem, but I need an answer, which I couldn't find when searching the forums and internet
The problem is about famous NxOgre (well, why do I write in here? How did I get it? - its famous ) So, here I go:
I got two bodies, from which one is a ball, and the second is a 'bouncer'
In the program I want to release the ball (which I already handled with addforce on keypress ) - and... When it hits the bouncer, I want the ball to bounce from it.
The default physics aren't working with the problem, they dont let the ball bump from the bouncer, its rather like the ball jumps from the bouncer, or throws bouncer faaar away(with a funny spin movement - dealt with it by adjusting the masses)
I tried callbacks and triggers, but had many problems with it, so I'm asking - how to? (I need to detect the collision of ball with bouncer [sphere with cube/convex] and then apply a force that will change the direction - so do *(-1) to some directions of the vector)
Hope you will be able to respond, thanks in advance,
B.!
Edit :: Currently I've noticed, that maybe NxMaterial.h from PhysX could be useful *checking out* - still waiting for response.
Edit :: Found out, that I can actually do thing like this
But it seems that it doesn't change anything. (material settings I mean) - but I feel that's the correct way of doing things. Any advice?
// and sorry for my English
I wanted to ask, about maybe not really specific problem, but I need an answer, which I couldn't find when searching the forums and internet
The problem is about famous NxOgre (well, why do I write in here? How did I get it? - its famous ) So, here I go:
I got two bodies, from which one is a ball, and the second is a 'bouncer'
In the program I want to release the ball (which I already handled with addforce on keypress ) - and... When it hits the bouncer, I want the ball to bounce from it.
The default physics aren't working with the problem, they dont let the ball bump from the bouncer, its rather like the ball jumps from the bouncer, or throws bouncer faaar away(with a funny spin movement - dealt with it by adjusting the masses)
I tried callbacks and triggers, but had many problems with it, so I'm asking - how to? (I need to detect the collision of ball with bouncer [sphere with cube/convex] and then apply a force that will change the direction - so do *(-1) to some directions of the vector)
Hope you will be able to respond, thanks in advance,
B.!
Edit :: Currently I've noticed, that maybe NxMaterial.h from PhysX could be useful *checking out* - still waiting for response.
Edit :: Found out, that I can actually do thing like this
NxOgre::Material *mMaterial= new NxOgre::Material("Ball",mScene);
mMaterial->setAll(0.9f,0.5f,0.5f);
mScene->createMaterial("Ball");
mBall = mScene->createBody("Ball;Ball.mesh", new NxOgre::Sphere(30), Vector3(0,5000,0), "mass: 1, material: Ball");
But it seems that it doesn't change anything. (material settings I mean) - but I feel that's the correct way of doing things. Any advice?
// and sorry for my English