Bugs (Applies to 2.42 preview27)

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
goldentaiji
Posts: 15
Joined: Mon Nov 07, 2005 8:36 pm

Bugs (Applies to 2.42 preview27)

Post by goldentaiji »

On your suggestion Erwin I moved the things over here.

1. Cannot set postion of constrainted objects (using owner.setPosition() ). Not sure if it's a bug, but that option would really be nice.
2. Motion Actuator (clicking "add" is supposed to add the motion to the current motion). Does not function properly when using LinearVelocity. Add and no Add has no difference.
3. Child objects parented to an object in layers other than 1, when added using Add Object, only the parent object is added while the children are not. Children would be added along with parent in sumo.

Was making something like Armadillo run and then I came upon this bug. I need it to work so that I can place the ojbects and then initialize the constraints. Because you cannot set the position of an object that has a constraint. Also because one would not want dynamic objects to be interacting or moving around say if placing the object went through it or over it.

Jason Lin
Last edited by goldentaiji on Wed Jun 21, 2006 9:42 pm, edited 35 times in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Some of the issues on the list should be fixed now, please try out this new binary (win32):
http://www.continuousphysics.com/ftp/pu ... sensor.zip

erwin (Erwin Coumans) 2005/11/11 06:02:14 CET

Modified files:
blender/source/blender/src buttons_shading.c
blender/source/gameengine/Ketsji KX_RaySensor.cpp
blender/source/gameengine/Physics/Bullet
CcdPhysicsController.cpp

Log:
fixed raysensor, hooked up a few more bullet method: force, torque etc, + 'local'. cosmetic change in physics-engine menu.
thinkofwhy
Posts: 15
Joined: Sat Nov 05, 2005 9:50 pm
Location: Edmonton, AB Canada

Post by thinkofwhy »

Erwin Coumans wrote:Some of the issues on the list should be fixed now, please try out this new binary (win32):
http://www.continuousphysics.com/ftp/pu ... sensor.zip

erwin (Erwin Coumans) 2005/11/11 06:02:14 CET

Modified files:
blender/source/blender/src buttons_shading.c
blender/source/gameengine/Ketsji KX_RaySensor.cpp
blender/source/gameengine/Physics/Bullet
CcdPhysicsController.cpp

Log:
fixed raysensor, hooked up a few more bullet method: force, torque etc, + 'local'. cosmetic change in physics-engine menu.
:D Erwin, you must be reading my mind :shock:. Your point2point blend demo illustrates the kind of constraint I was trying to figure out. Except I wanted to pivot on an edge. But two point pivots should do the same.

And your raysensor impulse action in the jenga7 blend demo just might work in place of the still non-functioning Force/Torque functions of the Motion Actuator :( . In fact, for my purposes, your p2p and impulse techniques just might be better than Force/Torque, since they enable control of the exact point and direction of the impulse and pivot locations. I'm trying to tip objects over on an edge, and maintain precise positioning, like polyhedronal pieces on a game board grid.

And I also noticed that interacting objects don't make complete contact. There's a small gap between them. I added material and tried setting fh Dist = 0, but it didn't help. Curious. :?
pildanovak
Posts: 50
Joined: Thu Jul 14, 2005 1:55 pm

Post by pildanovak »

has anybody tested this demo I made for p2p constraints?

http://www.ffa.vutbr.cz/~novak/dwnflz/p2p2.blend

It showed some weird things with the freezing.

EDIT:
I tested with the new version - there's a network of p2p constraints "getting nervous"(just look at it :))

Also, test with clicking on the balls with mouse, there are strong impulses applied
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Thanks for the cool demo!

There are lots of ways to improve stability in a physics engine, probably a faq would be best.

But in the meanwhile, some notes:

- Object that are in a constraint hierarchy (like connected by point 2 point constraints) can become instable when colliding with neighbours. Consider turning off collision detection, or make the collisionshapes small enough to give some tolerance.

- Object deactivation/sleeping can be controlled:

Code: Select all

#after how many seconds to put objects to sleep
PhysicsConstraints.setDeactivationTime(6)
- Number of iterations influences quality.

Code: Select all

#for all iterative solvers, quality versus performance...
PhysicsConstraints.setNumIterations(20)
- Solver method

Code: Select all

## expirimental
#0 == ode quickstep
#1 == bullet pairwise solver method
#PhysicsConstraints.setSolverType(0)
You can access those tweakable parameters through the PhysicsConstraints module, see this gameblender python script:

http://www.continuousphysics.com/ftp/pu ... tconfig.py

Erwin
pildanovak
Posts: 50
Joined: Thu Jul 14, 2005 1:55 pm

Post by pildanovak »

thanks for explaining.

If you like the demo, it can be put to other testing demos.
goldentaiji
Posts: 15
Joined: Mon Nov 07, 2005 8:36 pm

Post by goldentaiji »

:D Great work on adding in local motion.
Umm... however, are you sure the ray sensor is fixed? I still can't seem to be able to detect the object with the ray sensor. Did a simple setup, cube1 with property "cube", and another cube2 with ray sensor applied, once it detects the property cube, a property in cube2 would be set to true. Doesn't seem to be working with the new build. Ran the same setup in 2.37a and it detected ok.

Also, the objects seem kinda sticky. For example in my jenga demo I want to apply a motion to a single block say in the middle of the whole stack. When the motion is applied, it brings part of the bottom and all of the top stack down with it. I've tried playing around with the friction settings with no luck, any way to make it so that the block would slide out? Or currently not possible yet.

Update bug list thing on top.

Jason Lin
fobsta
Posts: 16
Joined: Wed Jul 13, 2005 10:32 am
Location: London, United Kingdom

Post by fobsta »

Pildanovak

Great demo. Have you posted this on Elysiun or Blender.org?
pildanovak
Posts: 50
Joined: Thu Jul 14, 2005 1:55 pm

Post by pildanovak »

no, i haven't, I thought about it as an addition to the testing files. maybe I should, but I'm updating my site now, so I'll add it soon there and will post a link to there.
thinkofwhy
Posts: 15
Joined: Sat Nov 05, 2005 9:50 pm
Location: Edmonton, AB Canada

PhysicsConstraints

Post by thinkofwhy »

The p2p.blend demo works okay as is, but when I uncommented the line that is supposed to remove the constraint, it generates a type error. :( . Can't get it to work.

But hey :D , I checked out the Blender CVS and implemented the Force and Torque methods ( two lines of code :? ). They work fine now, but setPosition() doesn't, and getOrientation() always returns the identity matrix.
Also, I'm puzzled as to why there is no getPosition() method defined in the KX_IPhysicsController.h file. I'm just beginning to get my head around the GameEngine code, and since there is virtually no internal documentation (or external) it's gonna be a while :shock:.

UPDATE:

:D :D I fixed the PhysicsConstraints.removeConstraint() implementation. I can now create and remove constraints !! :lol: Turns out the constraint id returned by createConstraint() was coded: return 0;, no wonder it was always zero. So I changed it to: return int(p2p), which will return the p2p pointer cast to an int. Of course, this is in my CVS checkout, so nobody else will enjoy this update :( I'll get a patch to you erwin, if you want, but the changes I've made so far are literally only 3 lines of code, which you can easily fix when you get around to it. The other problems, like setPosition() and getOriention(), might take a little longer :shock: Hey, this is fun :D.
Last edited by thinkofwhy on Wed Nov 23, 2005 4:52 am, edited 1 time in total.
thinkofwhy
Posts: 15
Joined: Sat Nov 05, 2005 9:50 pm
Location: Edmonton, AB Canada

fixed Position() and Orientation() methods

Post by thinkofwhy »

:D Ok. I fixed the get/setPosition() and get/setOrientation() methods. So far they appear to work properly, but I'm still testing the code. I'll put up a link to the build as soon as testing is complete so you guys can try it out.

Update: Here's the link to my fixed build of Erwin's Bullet Blender 2.4 Alpha build http://www3.telus.net/BulletBlender/. Enjoy :D

UPDATE: That links to a flawed build as noted below. However, the fixes I've made to the constraint id and get/setOrientation() seems to be okay.
Last edited by thinkofwhy on Sat Dec 24, 2005 7:13 pm, edited 1 time in total.
goldentaiji
Posts: 15
Joined: Mon Nov 07, 2005 8:36 pm

Post by goldentaiji »

Well with the official release of 2.4 I updated the bug list and added 1 more bug I found. Well all that applies to the official build now. thinkofwhy might have fixed some things, and if he did (I haven't checked cause I lost the other build), it should be incorporated into the official build as patches.

Erwin I must say bullet physics is extremely great and I love what it can do. There's just some of those bugs mentioned above that need some fixing. It's hindering games that are just itching to use bullet as the base physics engine.

Jason Lin
strangeland
Posts: 1
Joined: Fri Dec 16, 2005 9:46 pm

another bug

Post by strangeland »

Also, objects added with the add object actuator do not have physics applied to them.
thinkofwhy
Posts: 15
Joined: Sat Nov 05, 2005 9:50 pm
Location: Edmonton, AB Canada

My set/getPosition() fixes

Post by thinkofwhy »

:( Sadly, after some extensive testing, I've noticed that the getPosition() function that I had implemented in Erwin's build is NOT updated by the realtime physics. That is, if an object is collided with, the position returned by getPosition() will not reflect the realtime changes. It will return the old position before being moved by a collision. So Erwin, that patch I sent you will not work properly. :oops: :( I think I'll leave the coding to you Erwin. You've got a better understanding of what's going on in there. :D

Since the fixes I've made to the constraint id and set/getOrientation() seem to be okay, I'll leave the link (previous post) to my fixed (flawed) version of Erwin's build up, just in case someone wants to try those functions :oops: :cry:
goldentaiji
Posts: 15
Joined: Mon Nov 07, 2005 8:36 pm

Post by goldentaiji »

Updated bug list and removed the ones that were fixed after Erwins newest bug fix update.
I've noticed that the getPosition() function that I had implemented in Erwin's build is NOT updated by the realtime physics.
It works properly now in Erwins newest bug fix.
Also, objects added with the add object actuator do not have physics applied to them.
Erwin's newest bug fix also has this fixed.

Jason Lin