PH_SLIDER, inversed axis limits

Posted By: HeelX

PH_SLIDER, inversed axis limits - 10/05/11 14:19

Hi,
I noticed, that when you define a slider axis, that you have to inverse the limits, e.g. if the entity is at 0,0,0 and the axis is defined as 1,0,0, and you want that it just slides between x=0...64, passing vector(0,64,0) to setparams2 doesn't work, you have to pass vector(-64,0,0), because in the PhysX plugin code you do this:

Code:
cylindricalJoint->addLimitPlane(-gAxis, gAnchor + _FLOAT(limit_angles->y)*PhX.NXSize*gAxis,_FLOAT(limit_angles->z)*0.01f);
cylindricalJoint->addLimitPlane(gAxis, gAnchor + _FLOAT(limit_angles->x)*PhX.NXSize*gAxis,_FLOAT(limit_angles->z)*0.01f);



where you obviously use the second argument (limit in axis direction) together with the -inversed- axis and vice versa.

This is not only counter-intuitive, but also wrong compared to what is stated in the manual:

Quote:
Allowed distance from original position, e.g. (-100, 1000, 0) allows the objects to slide apart by 1000 quants along the axis and 100 quants in the opposite direction, thus giving a total range of 1100 quants.


Best regards,
-Christian

[EDIT] And the manual doesn't state what happens with the .z parameter, as you obviously use it, see limit_angles->z in the above snippet... what is it?
Posted By: jcl

Re: PH_SLIDER, inversed axis limits - 10/10/11 07:37

Thanks, we'll check that. I think that inversing the limits dependent on the axis direction could be a normal behavior of PhysX.
Posted By: HeelX

Re: PH_SLIDER, inversed axis limits - 10/10/11 07:58

I already changed that in the SourceForge repository so that t behaves like it is said in the documentation.
Posted By: PadMalcom

Re: PH_SLIDER, inversed axis limits - 02/22/12 14:17

FYI this is fixed:

Limits to PH_SLIDER were swapped (all A8 versions; fixed in 8.30.4).
© 2024 lite-C Forums