Bullet physics implementation and other stuff

   299174   385   4
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
josh3light
Also, the list of commands in readme.txt is incomplete; here is the actual list of commands that needed to be typed.
thx, I repair.

btw: I preparing next two sop nodes. bullet_merge_properties, bullet_merge_constraints, which will have same function like a sop merge node, but It check inputs and if there are duplicates in index attribute, It return error. This is really helpful and my often mistake :? .
https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
120 posts
Joined: Feb. 2008
Offline
I see a GPU fluids checkbox in the solver… is it implemented yet? if so, what can I do to test that out?
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
josh3light
I see a GPU fluids checkbox in the solver… is it implemented yet? if so, what can I do to test that out?
No, this version dont includes Fluid stuff!
https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
Ok, I have problem with compile LINUX version.
I work under Ubuntu with GCC v4.4.3

Compile Bullet:
cmake . -G “Unix Makefiles” -DBUILD_SHARED_LIBS=off -DBUILD_DEMOS=off -DCMAKE_CXX_FLAGS=“-fPIC” -DCMAKE_C_FLAGS=“-fPIC” -DINSTALL_LIBS=on
make
sudo make install

Then I try compile OpenSource DOP bullet code(its only test):
BULLET_INC=/usr/local/include/bullet
BULLET_LIB=/usr/local/lib
rm *.o
hcustom -g -L $BULLET_LIB -I $BULLET_INC -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath SIM_SolverBullet.cpp
If I start houdini everything is OK!

Then I build my “secret stuff” library with this:
BULLET_INC=/usr/local/include/bullet
BULLET_LIB=/usr/local/lib
rm *.o

gcc -Wall -fPIC -L $BULLET_LIB -I $BULLET_INC -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath -c *.cpp
echo “Compile *.o OK.”

gcc -shared -W1,-soname,libBullet.so.1 -o libBullet.so.1.0 *.o
echo “Creating Share Object OK.”

sudo mv libBullet.so.1.0 /usr/local/lib
sudo cp SolverDLL.h /usr/local/include
echo “Copy OK”

sudo ln -sf /usr/local/lib/libBullet.so.1.0 /usr/local/lib/libBullet.so
sudo ln -sf /usr/local/lib/libBullet.so.1.0 /usr/local/lib/libBullet.so.1
echo “Link OK”

Update Linux library list:
sudo ldconfig


And finally I build houdini plugin:
BULLET_INC=/usr/local/include
BULLET_LIB=/usr/local/lib

rm *.o
hcustom -g -L $BULLET_LIB -I $BULLET_INC -lBullet SOP_Bullet.cpp
or
hcustom -L $BULLET_LIB -I $BULLET_INC -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath -lBullet SOP_Bullet.cpp


But when I start houdini its write Houdini DSO error on SOP_Bullet.so
/usr/local/lib/libBullet.so: undefined symbol: _ZNK17btTypedConstraints……..
https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
Perhaps you could simplify it, by instead of building the different versions of your libBullet.so (instead of libBullet.so.0.1 - When Bullet does that to me, I delete it and just make either the *.so or *.a libs), and by putting it into the same directory as the SOP_Bullet.so.

Try running ‘ldd SOP_bullet.so’ on your bullet sop, and also run ‘ldd’ on your libBullet.so/a; what do these output?

If you put the library in /usr/local/lib, you shouldn't have to run ldconfig; those directories are already known to the system.

Also, when you build the bullet plugins, I've found that on linux I get fewer errors when I include the files first, then do the linking to the directory, and files:
hcustom -I$BULLET_INC -L$BULLET_LIB -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath -lBullet SOP_Bullet.cppt

When the linking args are interrupted by including the docs, that will often compile fine, but when I go to use it, I often get errors similar to yours.

Oh, I just thought of something: try compiling your libBullet.so as a static (instead of shared) library (this will give you libBullet.a), and then when you build the Houdini SOP, don't link to the standard bullet libraries again. What does that give you?

Does all of this make sense?
I'm o.d.d.
User Avatar
Member
52 posts
Joined: July 2007
Offline
and your version of h11 is gcc4.4 too? if not,that's the problem
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
holy f*****ck, Its really stupid mistake!!!!!

old:
hcustom -L $BULLET_LIB -I $BULLET_INC -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath -lBullet SOP_Bullet.cpp

new:
hcustom -L $BULLET_LIB -I $BULLET_INC -lBullet -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath SOP_Bullet.cpp


thx goldleaf and horizon1231 !

In this moment It works fine, Tomorrow I try to compile libBullet.so as a static, because in this moment you need all standard bullet *.a and libBullet.so and It should be fine it will be all in one libBullet.a file. But it is certain that the new version comes out soon(maybe tomorrow) and I look forward to comparing speed on win a linux version 8)
https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
As I promised … Linux version 64bit (gcc v4.4.3)
check readme.txt for install.

now Its time for fluids!!!

Attachments:
Bullet_v0_99.zip (1.5 MB)

https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
52 posts
Joined: July 2007
Offline
cybermax
As I promised … Linux version 64bit (gcc v4.4.3)
check readme.txt for install.

now Its time for fluids!!!

thanks for efforts!!!

haven't try it ,but it should be work with gcc4.2 ? not sure if your libBullet.a has dependency with houdini.gcc.4.4!!

update:
all compiled ok with gcc4.2 except Transform.cpp

change the line 133 “or” to something other fix the error.

and I find a little bug: I register this op as “BTransform” SOP, since with some error when open example, because there already a transform sop officially.

Thanks Cybermax !
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
I found those issues too, horizon1231 Fixing those let me compile (also added all of the other SOPs to the build.sh).

These are the issues I'm finding so far:

- crashes whenever I try and use just the bullet_solver sop by connecting objects and properties directly to a bullet_solver, rather than to your digital asset.
- crashes whenever I delete a bullet_solver, even with nothing connected to it
- opening the examples hipnc file crashes upon opening; only able to see it if I merge the file in with a new hip file
- no simple examples (for example, just a two constrained spheres dropping onto the ground) to help narrow down issues (tried opening old example file, but crashes immediately)

Is anyone else coming across these as well?

I've attached my crashlog file, to see if that helps, though I can't quite figure out what's going on. It would be good to make your classes and functions unique from Houdini's default ones, like the SOP_Transform, which should be SOP_btTransform, or something like that; also SolverDLL.h has lots of entries which might conflict as well.

And yes, thank you cybermax

Attachments:
crashlog_chris.txt.gz (3.2 KB)

I'm o.d.d.
User Avatar
Member
52 posts
Joined: July 2007
Offline
goldleaf
I found those issues too, horizon1231 Fixing those let me compile (also added all of the other SOPs to the build.sh).

These are the issues I'm finding so far:

- crashes whenever I try and use just the bullet_solver sop by connecting objects and properties directly to a bullet_solver, rather than to your digital asset.
- crashes whenever I delete a bullet_solver, even with nothing connected to it
- opening the examples hipnc file crashes upon opening; only able to see it if I merge the file in with a new hip file
- no simple examples (for example, just a two constrained spheres dropping onto the ground) to help narrow down issues (tried opening old example file, but crashes immediately)

Is anyone else coming across these as well?

I've attached my crashlog file, to see if that helps, though I can't quite figure out what's going on. It would be good to make your classes and functions unique from Houdini's default ones, like the SOP_Transform, which should be SOP_btTransform, or something like that; also SolverDLL.h has lots of entries which might conflict as well.

And yes, thank you cybermax

mine is all working now

haven't see your log file. could u post a hip?

and suggestion to cybermax: any chance to make this ops with unique name next release
Edited by - Dec. 27, 2010 02:34:10
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
What build of Houdini are you using? That's the only thing I can think might be an issue at the moment.
I'm o.d.d.
User Avatar
Member
52 posts
Joined: July 2007
Offline
goldleaf
What build of Houdini are you using? That's the only thing I can think might be an issue at the moment.

11.0.581 gcc4.2
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
Ah, that was it! I was using 596. Thanks!
I'm o.d.d.
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
goldleaf
I found those issues too, horizon1231 Smile Fixing those let me compile (also added all of the other SOPs to the build.sh).
I add build.sh to the main folder, which compile everything.

Other issues are in progress
https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
repair some bug and easier install on linux.

note:
This is for both, linux and win!!!
I change names *.cpp a *.h files, so Compiler creates new names for final dso, so delete old DSO before running houdini!

Attachments:
Bullet_v0_99.zip (1.5 MB)

https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
52 posts
Joined: July 2007
Offline
cybermax
repair some bug and easier install on linux.

note:
This is for both, linux and win!!!
I change names *.cpp a *.h files, so Compiler creates new names for final dso, so delete old DSO before running houdini!

Hi cybermax

I think goldleaf mean unique entry name when add op table,not name of the source code.

void newSopOperator(OP_OperatorTable *table)
{
table->addOperator(new OP_Operator(
“bullet_transform”,
“bullet_transform”,
SOP_Transform::myConstructor,
SOP_Transform::myTemplateList,
2, // Min required sources
2, // Maximum sources
0));
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
horizon1231
Hi cybermax
I think goldleaf mean unique entry name when add op table,not name of the source code.
Sorry, this is right, bullet_transform works!

Attachments:
Bullet_v0_99.zip (1.4 MB)

https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Member
255 posts
Joined: Aug. 2009
Offline
v0.991 comming and it will be EPIC !!!

I created test scene with around 2000boxes where I tested speed performance. And Old version(your actual version) had 1.9second on 60frame, now its 655ms :shock: and bigger scene means bigger difference in time … wtf
https://vimeo.com/user3251535 [vimeo.com]
https://twitter.com/milansuk [twitter.com]
https://github.com/milansuk [github.com]
User Avatar
Staff
4159 posts
Joined: Sept. 2007
Offline
This is great cybermax!

Yeah, I meant internally (as it doesn't matter what the *cpp/*h files are called):

void newSopOperator(OP_OperatorTable *table)
{
table->addOperator(new OP_Operator(
“bullet_transform”,
“bullet_transform”,
SOP_BulletTransform::myConstructor,
SOP_BulletTransform::myTemplateList,
2, // Min required sources
2, // Maximum sources
0));
}

BTW, it would be really helpful if there were more primitives to have access to, like the Bullet DOP provides (capsules, cones, etc…). The btCompound and btMultisphere shapes are faster than simply constraining lots of objects together, and having the btStaticPlaneShape for a groundplane option in the properties sop node would also help speed things up when colliding lots of objects to the ground. Another nice use for btMultiSphereShape, is that you can get non-uniform sphere primitives. I'm just adding this to the Bullet DOP now, so once its up, the code will be open for you to refer to.

I looked at trying to implement these myself, but as far as I can tell, those are all done in your libBullet.a, right? Only the node interface is done in SOP_Properties, but the actual primitives need to be setup by you, if I understand it correctly.
I'm o.d.d.
  • Quick Links