Update! New math stuff! New revolute joint functions! Fixed 6D-joint bugs smile

Lite-C:
  • new: complete PhysX math library is now available for scalar operations. Here are the new functions:
    Click to reveal..
    // Returns true if the two numbers are within eps of each other
    BOOL pXequals (float a, float b, float eps);

    // The floor/ceil function returns a value representing the largest/smallest integer that
    // is less than or equal to x
    float pXfloor (float a);
    float pXceil (float a);

    // Truncates the float to an integer
    int pXtrunc (float a);

    // abs returns the absolute value of its argument
    float pXabs (float a);

    // sign returns the sign of its argument. The sign of zero is undefined
    float pXsign (float a);

    // The return value is the greater/lesser of the two specified values
    float pXmax (float a, float b);
    float pXmin (float a, float b);

    // mod returns the floating-point remainder of x / y
    float pXmod (float x, float y);

    // Clamps v to the range [hi,lo]
    float pXclamp (float v, float hi, float low);

    // Square root = x^(1/2) and reciprocal square root = x^(-1/2)
    float pXsqrt (float a);
    float pXrecipSqrt (float a);

    // Calculates x^y (x raised to the power of y)
    float pXpow (float x, float y);

    // Calculates e^n
    float pXexp (float a);

    // Calculates logarithm to base = e, 2, 10
    float pXlogE (float a);
    float pXlog2 (float a);
    float pXlog10 (float a);

    // Converts degrees into radians and radians to degrees
    float pXdegToRad (float deg);
    float pXradToDeg (float rad);

    // Sine, cosine, sin & cosine or tangent of an angle in degrees
    float pXsin (float a);
    float pXcos (float a);
    void pXsinCos (float a, float* s, float* c);
    float pXtan (float a);

    // Arcsine, arccosine, arctangent ot arctangen o (x/y) with correct sign
    float pXasin (float a);
    float pXacos (float a);
    float pXatan (float);
    float pXatan2 (float x, float y);

    // Uniform random number in [a,b]
    float pXrand (float a, float b);

    // Hashes an array of n 32 bit values to a 32 bit value
    int pXhash (int* arr, int n);

    // Returns true if the number is a finite floating point number as opposed to INF, NAN, etc.
    BOOL pXisFinite (float a);
  • new: all remaining specific functions for revolute joints were enabled, like
    • pXconSet/GetRevolute(Joint)Motor
    • pXconSet/GetRevolute(Joint)Spring
    • pXconGetRevolute(Joint)Angle
    • pXconGetRevolute(Joint)Velocity
    • pXconGet/SetRevolute(Joint)Flags
    • pXconGet/SetRevolute(Joint)ProjectionMode
  • bugfix: there are two restitution factors for revolute joints. This was overlooked all the time, also in the original GS plugin. The new functions were changed, so that they became a second restitution factor.
  • new: all 6D-joints functions, which were added in the last release, were enhanced by version with ENTITY* parameter like the revolute joint functions, so that they work on the first (!) 6D-Joint of an entity
  • bugfix: pXconSetD6LinearMotion and pXconSetD6AngularMotion had no effect
  • bugfix/change: pXconSetD6Swing1Limit, pXconSetD6Swing2Limit had no effect. Now, if called, they also enforce NX_D6JOINT_MOTION_LIMITED on swing1/2
  • new: pXconGetJointEntities returns the two entities constrained with a given joint


Internally:
  • pXconRevolute.h/.cpp is the new home of all functions related to revolute joints


Download the new dll for A8 (and the header) here: ackphysx.20111121.dll.h.rar, checkout on SVN as always. Upcoming: direct support for essential (and native) PhysX datatypes like NxMat33, NxVec3, NxQuat, etc. from within Lite-C ^^

Cheers,
-Christian