ARudik / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Bugs in conversion of blender physic options. #205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add several cubes, cylinders, etc, for scenary (static). Add then rigid 
bodies.
2. Set all object scenary bounds to cube, cylinder, etc. Set one of the rigid 
bodies as "no sleep".
3. Play.

What is the expected output? What do you see instead?
Static objects with box/cylinder bounds. Instead all of them are triangle 
meshes. It is efficient but fast objects can go through and get stuck. If I set 
all as rigid bodies with all location and rotation axes locked, it works as 
expected but slower.

The "no sleep" option behaves as "always sleep" or rather no collision at all. 
I tried to fix it in code but I don't understand what it does 
(Engine/Physics/gkRigidBody.cpp:132). I tried adding 
m_body->setSleepingThresholds(-1.0f,-1.0f) but it had no effect. By the way, I 
always wanted to have a "sleep at beginning" option in order to have thousands 
of rigid bodies across a huge scenary without hogging the cpu at the beginning.

What version of the product are you using? On what operating system?

SVN, Linux 64 bit and android (ARMv6/7 with vfp).

Please provide any additional information below.

It would be great if we can select convex decomposition in blender (at least by 
selecting "convex hull" which is not implemented in gamekit).

Original issue reported on code.google.com by kungfoobar@gmail.com on 2 Dec 2011 at 11:24

GoogleCodeExporter commented 9 years ago
I've fixed both problems. Patch attached.

Original comment by kungfoobar@gmail.com on 17 Jan 2012 at 1:27

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for the patch, we'll look into applying it.

Original comment by erwin.coumans on 17 Jan 2012 at 6:07

GoogleCodeExporter commented 9 years ago
I've made a better patch, thoroughly tested this time. It also adds the 
"capsule" shape and fixed a bug where all shapes of new objects in blend files 
with version >= 2.61 are boxes.

I'm also attaching a test file (saved with blender 2.63 svn). All objects at 
the top are rigid bodies, all objects at the bottom are static. There's a 
compound at the left with the "no sleep" flag. All shapes should be drawn in a 
simple way in debug (instead of drawing all poligons); "no sleep" objects 
appear in red (unknown state) and shouldn't stop moving too soon (like the 
cone).

Original comment by kungfoobar@gmail.com on 11 Apr 2012 at 11:34

Attachments:

GoogleCodeExporter commented 9 years ago
Great work, thx for the patch.
I commited it to trunk.

Original comment by thomas.t...@googlemail.com on 12 Apr 2012 at 1:25