Page 1 of 1

Floor Constraint: Patch and Windows Build

Posted: Fri Sep 02, 2005 4:34 pm
by harkyman
Made a new constraint yesterday, called "Floor".

The way it works:

1. Apply constraint to object (or bone).
2. Choose target.
3. Choose: X,Y,Z,-X,-Y,-Z. Default is Z.

Z will not allow the constrained object to pass below the target object.
-Z will not allow it to go above the target.
X,-X,Y and -Y will do the respective actions on the global X and Y axes.

Useful for placing a "floor" or "walls" for objects and armatures. Apply to armature foot bones to prevent them from slipping below the floor.

Patch against current CVS here:

http://www.harkyman.com/floorpatch.txt

Windows binary (.exe only) here (3.4 MB - if you can patch, please do that instead):

http://www.harkyman.com/blenderfloor.zip

Feedbacks are appreciated.

Also, I don't have commit privleges, so anyone (theeth!) who wants to check the code and possibly commit, please feel free. I've seen this feature asked for a dozen times in the last year.

Re: Floor Constraint: Patch and Windows Build

Posted: Fri Sep 02, 2005 5:32 pm
by kidb

Posted: Fri Sep 02, 2005 5:36 pm
by lucky3
Don't know if it's a bug or not, but i'm gonna try to explain what happens:
My constrained object is on the target, and then i move down my object along -Z axis.
I want the object to move above the target, so i move it along Z axis but i have to move it a long time until it gets the previous coordinates, because object's coordinates haven't been reset or 'stopped' below the target.

Hum i don't know if that's clear
:?

Posted: Fri Sep 02, 2005 5:42 pm
by harkyman
I think that's just the way constraints work. The actual coords (what you'd get if you set an IPO key) of your object stay live as you translate, but they are constrained on-the-fly before display, render and other calculations. As far as I know, this is the first constraint whose functionallity has made this obvious.

Just got some feedback from the mailing list that bones aren't working as expected, though they seemed to when I tried to it.

kidb, thanks for the Linux builds.

Posted: Fri Sep 02, 2005 6:57 pm
by lightning
I havent tried it, but would it be possible to set a certain 'distance', so for example if the foot is quite big, then it does not continue to pass through the floor until the bone touches the floor, but instead the bone stops a set distance above?

thanks
lightning

Posted: Fri Sep 02, 2005 7:59 pm
by harkyman
That's a cool and useful idea. You can get around it with workarounds and careful planning, but it would be easier to do it right in the constraint. I've added that and am trying to compile right now.

Posted: Fri Sep 02, 2005 9:00 pm
by harkyman
Works great. Cool idea. I'll clean up the GUI and make a new patch over the long U.S. weekend.

Posted: Fri Sep 02, 2005 10:33 pm
by SamAdam
how about a geometry constraint? would it be hard to continue this to that?

just make the object follow the geometry mesh, like having the floor mesh with an up and down constraint together.

Posted: Sat Sep 03, 2005 12:34 pm
by blendman
Hello Harkyman

GREAT feature !
I have tested and I find it really good! this work pretty well.
thank you very much.
really useful for animation !
just an idea : it seems this is the center of the constrainted object wich can't pass under the floor (the target). (I knwo that the constraint work like this)
but could be it the mesh (the face or vertices) not only the center object? and for armature too (not only the center, but the bones too)?
I don't know if it's possible or difficult to code, just an idea ;) but perhap's it 's the same feature like lightning or SamAdam. (i don't know)

thanks aigain.
sorry for my bad english;)
Blendman

Posted: Sun Sep 04, 2005 4:43 am
by MyIS
I think if you need mesh collision testing, something much more complicated is necessary, such as using ODE/SOLID collision libs, etc etc. So, while it definitely sounds like a good thing to add, it should be a separate project/effort. This one's a nice and simple constraint.

Posted: Tue Sep 06, 2005 6:35 pm
by harkyman
One more feature added and now I'm through with it.

In addition to the "offset" feature suggested above, which is very cool, I've also added a "sticky" button in the constraint. When "sticky" is active, your constrained object freezes against the target object for as long as it's constrained, as opposed to skating around on it like it does now.

patch against CVS:
http://www.harkyman.com/floorpatchstick.txt

Windows .exe:
http://www.harkyman.com/blenderfloor.zip

Posted: Wed Sep 07, 2005 8:26 pm
by CJD
GOOD IDEA, but...

don't work 2 constrains floor at same time

the center object isn't good "contact point"

it's a great idea for emptys, or bones constrain.

other thing, only work on plane? "real time mesh surfaces" is better, irregular surfaces (for example an irregular floor, stairs, dunes, etc)

and a "on the floor" option, for the objects are exactly on the floor, not above, not below. (only an idea)

great work, go to coding!

and sorry my ugly english... :oops: