Jump to content

Physics don't take effect on the object, at least not correctly


photo

Recommended Posts

Hello everyone

 

Maybe I'm just missing something here.

 

I spawn an ObjectMesh, give it a simple texture, add a RigidBody, createShapes for it and then give it a linear velocity, much like you did

with your red balls in the samples.

 

Now as a whole it moves absolutely correctly, but it seems to be unaffected by any weight changes (i.e. making the tip of an arrow heavier doesn't change the way it falls/flies).

 

Am I just missing something, so it's not updated? because once it's on the ground it behaves correctly, including the change in weight/change in center of mass.

Also PhysicalWind influences the arrows position, but not it's rotation, much like the fall/flight

 

I mean there are all these weights assigned to the different shapes, shouldn't they influence flight as well? or does it need something more in order to do that?

 

The answer is just eluding me, and i don't want to resort to manually calculating the arrows angle, if possible.

 

Thank you in advance

Link to comment

I spawn an ObjectMesh, give it a simple texture, add a RigidBody, createShapes for it and then give it a linear velocity, much like you did

with your red balls in the samples.

 

Now as a whole it moves absolutely correctly, but it seems to be unaffected by any weight changes (i.e. making the tip of an arrow heavier doesn't change the way it falls/flies).

 

Try to create a shape manually, because the method BodyRigid::createShapes creates one or more a convex shape approximating the mesh, in this case the automatic shapes can be incorrect it is depends on the mesh geometry. It will be more optimized if you will add shapes manually with a certain size (larger or smaller than the original mesh size).

 

Also PhysicalWind influences the arrows position, but not it's rotation, much like the fall/flight

 

Please, see the following sample 'samples/physicals/force_01.cpp' it demonstrates how the physical force and physical wind rotate the rigid bodies.

Link to comment

first of all, thank you very much for your quick response, but i'm not entirely sure you understood what i meant.

 

even if the shapes aren't correct, if i manually set the arrow tip as 100kilos, while the rest of the arrow weighs only 7kilos, i still don't see any change in it's behaviour during flight.

once it hit the ground it moves correctly, but not in the air.

 

for example, my arrow needs to change its rotation as it slows, namely the tip has to lean down more and more... now i thought all these mass parameters are there for a reason =)

 

the thing is, i can even make the tip a metric ton and it still makes no difference on it's flight and fall. now what am i missing? isn't its behaviour calculated by the mass parameters?

do i literally need to tell the arrow, what rotation it has to have during flight? then what is its center of mass for? and the inertia tensor? shouldn't that handle the orientation of the object during flight/fall? so why is it, that these values are only going into effect, after the arrow has touched the ground for the first time? why aren't these values updated during airtime?

 

i'm really sorry, it's probably something i'm overlooking, but as of now my arrow behaves like a static object with its weight distributed evenly across the entire object, which of course isn't the case...

it flies in a correct line (according to the physics that have been set), but stays exactly the same rotation (on all axis) during its entire flight, what am i doing wrong?

 

i really need help in order to know how to approach this problem. i'm sure it's my fault somewhere, but i don't know where the problem is.

 

oh and by the way, i have used both createShapes and a node file from our 3d artist, with the body manually generated, and it makes absolutely no difference while it's in the air.

 

please enlighten me =)

 

thank you very much

Link to comment

Please, create the test scene (without any references to files or folder on your PC) and upload.

What the problems you have and what you want to achieve as a result (only abstracts, please)

Link to comment
×
×
  • Create New...