2 registered members (AndrewAMD, Akow),
1,371
guests, and 10
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
[Re: HeelX]
#388940
12/08/11 21:56
12/08/11 21:56
|
Joined: Jul 2001
Posts: 6,904
HeelX
OP
Senior Expert
|
OP
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
Hi folks, since my PhysX-related contract work is now finished (I will soon write about this in the projects forum, when I find some spare time), development time for the PhysX plugin is rare now, since I concentrate now on other tasks (its a commercial project, I am working on a level editor). Rojart sent me some code for cloth physics and as soon as I enabled the most of the PhysX foundation, I will work on it and fluid particles. Here are the news about the last commit I made today: - change: all pXmat... functions were renamed to pXmat33..., since they deal with 3x3 rotation matrices and PhysX knows also 3x4 matrices (see below)
- new: 3x4 matrix datatype NxMat34 (+functions). Combination of a 3x3 rotation matrix and a translation vector. Homogenous transform composed of a matrix and a vector. See functions below.
- new: plane datatype NxPlane (+functions)
- new: sphere datatype NxSphere (+functions)
- added: NxSphericalJointFlag's
- added: specific functions for manipulating spherical joints and its rotation axis, limits, etc. Can be used to simulate arm joints for ragdolls.
- new: I was **SO** annoyed of not having trinary operators in Lite-C, so I added a custom function to the dll: float pXtrinary (BOOL b, float fTrue, float fFalse); NOTE: This is not part of the official PhysX SDK, but is quiet handy
- new: pXvecDeb (NxVec3*, char* name, char* str) prints 'vec "name" xyz=(...)' into str (for debugging)
- new: pXquatGetAngle (NxQuat* q, ANGLE* angle) converts a quaternion into a Gamestudio Euler-angle
- new: pXquatDeb (NxQuat*, char* name, char* str) prints 'quat "name" xyzw=(%.3f, %.3f, %.3f, %.3f)' into str (for debugging)
- internal: to mainstream the conversions between Gamestudio and PhysX and due to the introduction of Gamestudio structs that are data facades to the PhysX classes, new conversion classes have been introduced, which should bridge the gap between plain numeric conversions (Plain) from and to Gamestudio and conversions from Gamestudio worldspace to PhysX world space (World; X/Z swap of axis and rotation matrices) and percentages (Percent). Overloaded static member functions ::fromGs and ::toGs should serve the purpose. Seems to be more elegant than my previous approaches and definitely than the previous approaches by the original author of the plugin. Use this from now on!
- internal: because of the renaming of the exported pXmat functions, the file pXmat.h/cpp was also renamed to pXmat33.h/cpp
New spherical joint functions: NxJoint* pXconAddSphericalJoint (ENTITY* eFrom, VECTOR* pos, VECTOR* axis, ENTITY* eTo, BOOL collision, float swingLimit, float swingRestitution, float twistLowLimit, float twistLowRestitution, float twistHighLimit, float twistHighRestitution);
// swing limit axis defined in the joint space of the first actor NxJoint* pXconSetSphericalJointSwingAxis (NxJoint*, NxVec3* axis);
// distance above which to project joint NxJoint* pXconSetSphericalJointProjectionDistance (NxJoint*, float dist);
// limits rotation around twist and swing axis NxJoint* pXconSetSphericalJointTwistLimit (NxJoint*, float lowAngle, float lowRestitution, float highAngle, float highRestitution); NxJoint* pXconSetSphericalJointSwingLimit (NxJoint*, float angle, float restitution);
// spring that works against twisting / swinging NxJoint* pXconSetSphericalJointTwistSpring (NxJoint*, float spring, float damper, float targetAngle); NxJoint* pXconSetSphericalJointSwingSpring (NxJoint*, float spring, float damper, float targetAngle);
// spring that lets the joint get pulled apart NxJoint* pXconSetSphericalJointSpring (NxJoint*, float spring, float damper, float targetDistance);
// sets/gets the flags to enable/disable the spring/motor/limit (see NxSphericalJointFlag) NxJoint* pXconSetSphericalJointFlags (NxJoint*, NxSphericalJointFlag flags); long pXconGetSphericalJointFlags (NxJoint*);
// use this to set/get the joint projection mode NxJoint* pXconSetSphericalJointProjectionMode (NxJoint*, NxJointProjectionMode projectionMode); NxJointProjectionMode pXconGetSphericalJointProjectionMode (NxJoint*); New 3x4 matrix (homogenous transform) functions: // by default m is inited and t isn't. Use bInitialized = true to init in full NxMat34* pXmat34create (BOOL bInitialized); NxMat34* pXmat34createRT (NxMat33* rot, NxVec3* trans);
NxMat34* pXmat34zero (NxMat34* m);
NxMat34* pXmat34id (NxMat34* m);
// returns true for identity matrix BOOL pXmat34isIdentity (NxMat34* m);
// returns true if all elems are finite (not NAN or INF, etc.) BOOL pXmat34isFinite (NxMat34* m);
// assigns inverse to dest NxMat34* pXmat34isFinite (NxMat34* m, NxMat34* dest);
// same as pXmat34getInverse, but assumes that M is orthonormal BOOL pXmat34getInverseRT (NxMat34* m, NxMat34* dest);
// m = left * right NxMat34* pXmat34multiply (NxMat34* m, NxMat34* left, NxMat34* right);
// dst = m * src NxVec3* pXmat34multiplyVec (NxMat34* m, NxVec3* src, NxVec3* dst);
// dst = inverse(this) * src - assumes that m is rotation matrix!!! NxVec3* pXmat34multiplyByInverseRT (NxMat34* m, NxVec3* src, NxVec3* dst);
// this = inverse(left) * right - assumes m is rotation matrix!!! NxMat34* pXmat34multiplyInverseRTLeft (NxMat34* m, NxMat34* left, NxMat34* right);
// this = left * inverse(right) -- assumes m is rotation matrix!!! NxMat34* pXmat34multiplyInverseRTRight (NxMat34* m, NxMat34* left, NxMat34* right);
// convert from a matrix format appropriate for rendering NxMat34* pXmat34setColumnMajor44 (NxMat34* m, float* f); float* pXmat34getColumnMajor44 (NxMat34* m, float* f);
// set the matrix given a row major matrix NxMat34* pXmat34setRowMajor44 (NxMat34* m, float* f); float* pXmat34getRowMajor44 (NxMat34* m, float* f); New plane functions: // constructors NxPlane* pXplaneCreate (); NxPlane* pXplaneCreateNormalDist (NxVec3* n, float d); // normal & dist NxPlane* pXplaneCreateNormalXYZDist (float nx, float ny, float nz, float d); // normal & dist NxPlane* pXplaneCreatePointNormal (NxVec3* p, NxVec3* n); // point on the plane & normal NxPlane* pXplaneCreatePoints (NxVec3* p0, NxVec3* p1, NxVec3* p2); // from 3 points NxPlane* pXplaneCreateCopy (NxPlane* p); // copy constructor
// sets plane to zero NxPlane* pXplaneZero (NxPlane* p);
NxPlane* pXplaneSetNormalDist (NxPlane* p, NxVec3* n, float d); NxPlane* pXplaneSetNormalXYZDist (NxPlane* p, float nx, float ny, float nz, float d); NxPlane* pXplaneSetPointNormal (NxPlane* p, NxVec3* pt, NxVec3* n); NxPlane* pXplaneSetPoints (NxPlane* p, NxVec3* p0, NxVec3* p1, NxVec3* p2);
float pXplaneDistance (NxPlane* p, NxVec3* pt);
BOOL pXplaneBelongs (NxPlane* p, NxVec3* pt); // projects p into the plane NxVec3* pXplaneProject (NxPlane* p, NxVec3* pt);
// find an arbitrary point in the plane NxVec3* pXplaneFindPoint (NxPlane* p, NxVec3* pt);
NxPlane* pXplaneNormalize (NxPlane* p); NxPlane* pXplaneTransform (NxPlane* p, NxMat34* transform, NxPlane* transformed); NxPlane* pXplaneInverseTransform (NxPlane* p, NxMat34* transform, NxPlane* transformed); New sphere functions: // constructors NxSphere* pXsphereCreate (); NxSphere* pXsphereCreateInit (NxVec3* center, float radius); NxSphere* pXsphereCreateCopy (NxSphere* s);
// checks the sphere is valid BOOL pXsphereIsValid (NxSphere* s);
// tests if a point is contained within the sphere BOOL pXsphereContainsVec (NxSphere* s, NxVec3* p);
// tests if another sphere is contained within the sphere BOOL pXsphereContainsSphere (NxSphere* s, NxSphere* other);
// tests if a box is contained within the sphere BOOL pXsphereContainsBox (NxSphere* s, NxVec3* vMin, NxVec3* vMax);
// tests if the sphere intersects another sphere BOOL pXsphereIntersect (NxSphere* s, NxSphere* other); You can download the dll + lib + header here: ackphysx.20111208.dll.h.lib.rar; you'll find the source as always on SVN. So, this is essentially not a "big" release, but I hope you understand. I hope to make another release this year with the rest of the PhysX foundation and that it is useful for anyone. Best regards, -Christian
Last edited by HeelX; 12/08/11 21:58.
|
|
|
Entire Thread
|
ackphysx.dll community version
|
HeelX
|
10/12/11 22:57
|
Re: ackphysx.dll community version
|
PadMalcom
|
10/13/11 07:00
|
Re: ackphysx.dll community version
|
3run
|
10/13/11 08:05
|
Re: ackphysx.dll community version
|
HeelX
|
10/13/11 08:33
|
Re: ackphysx.dll community version
|
Rei_Ayanami
|
10/13/11 08:48
|
Re: ackphysx.dll community version
|
HeelX
|
10/13/11 22:03
|
Re: ackphysx.dll community version
|
HeelX
|
10/24/11 20:36
|
Re: ackphysx.dll community version
|
HeelX
|
10/26/11 22:05
|
Re: ackphysx.dll community version
|
HeelX
|
10/31/11 15:01
|
Re: ackphysx.dll community version
|
Rackscha
|
10/31/11 15:15
|
Re: ackphysx.dll community version
|
HeelX
|
10/31/11 15:23
|
Re: ackphysx.dll community version
|
Rackscha
|
10/31/11 16:53
|
Re: ackphysx.dll community version
|
HeelX
|
10/31/11 22:38
|
Re: ackphysx.dll community version
|
alibaba
|
10/31/11 22:43
|
Re: ackphysx.dll community version
|
HeelX
|
10/31/11 22:52
|
Re: ackphysx.dll community version
|
alibaba
|
10/31/11 23:05
|
Re: ackphysx.dll community version
|
HeelX
|
11/01/11 10:06
|
Re: ackphysx.dll community version
|
alibaba
|
11/01/11 10:40
|
Re: ackphysx.dll community version
|
Rackscha
|
11/01/11 12:29
|
Re: ackphysx.dll community version
|
HeelX
|
11/01/11 14:08
|
Re: ackphysx.dll community version
|
HeelX
|
11/01/11 15:13
|
Re: ackphysx.dll community version
|
HeelX
|
11/02/11 13:49
|
Re: ackphysx.dll community version
|
HeelX
|
11/03/11 23:33
|
Re: ackphysx.dll community version
|
TechMuc
|
11/13/11 20:03
|
Re: ackphysx.dll community version
|
3run
|
11/13/11 21:28
|
Re: ackphysx.dll community version
|
HeelX
|
11/13/11 21:46
|
Re: ackphysx.dll community version
|
ventilator
|
11/13/11 21:51
|
Re: ackphysx.dll community version
|
TechMuc
|
11/13/11 21:57
|
Re: ackphysx.dll community version
|
HeelX
|
11/13/11 22:56
|
Re: ackphysx.dll community version
|
Quad
|
11/13/11 23:33
|
Re: ackphysx.dll community version
|
rojart
|
11/14/11 10:59
|
Re: ackphysx.dll community version
|
darkinferno
|
11/14/11 12:07
|
Re: ackphysx.dll community version
|
Emre
|
11/14/11 14:34
|
Re: ackphysx.dll community version
|
HeelX
|
11/14/11 14:41
|
Re: ackphysx.dll community version
|
Emre
|
11/14/11 15:33
|
Re: ackphysx.dll community version
|
3run
|
11/14/11 16:55
|
Re: ackphysx.dll community version
|
Random
|
11/14/11 17:27
|
Re: ackphysx.dll community version
|
darkinferno
|
11/14/11 22:20
|
Re: ackphysx.dll community version
|
HeelX
|
11/14/11 22:51
|
Re: ackphysx.dll community version
|
ventilator
|
11/14/11 23:10
|
Re: ackphysx.dll community version
|
WretchedSid
|
11/14/11 23:33
|
Re: ackphysx.dll community version
|
HeelX
|
11/15/11 00:23
|
Re: ackphysx.dll community version
|
Superku
|
11/15/11 00:48
|
Re: ackphysx.dll community version
|
Rackscha
|
11/14/11 23:40
|
Re: ackphysx.dll community version
|
darkinferno
|
11/15/11 11:37
|
Re: ackphysx.dll community version
|
HeelX
|
11/15/11 19:38
|
Re: ackphysx.dll community version
|
HeelX
|
11/21/11 00:56
|
Re: ackphysx.dll community version
|
PadMalcom
|
11/21/11 08:59
|
Re: ackphysx.dll community version
|
Nighthawk
|
11/21/11 11:18
|
Re: ackphysx.dll community version
|
HeelX
|
11/21/11 12:23
|
Re: ackphysx.dll community version
|
HeelX
|
11/21/11 12:41
|
Re: ackphysx.dll community version
|
Rackscha
|
11/21/11 15:48
|
Re: ackphysx.dll (new: quaternions + 3x3 matrices)
|
HeelX
|
11/27/11 13:49
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
HeelX
|
12/08/11 21:56
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
alibaba
|
03/26/12 09:11
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
Rei_Ayanami
|
08/02/12 13:44
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
HeelX
|
08/02/12 13:49
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
gameplan
|
08/19/12 21:50
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
HeelX
|
08/20/12 08:30
|
Re: ackphysx.dll (new: 3x4 matrices, spheres, planes, ...)
|
HeelX
|
08/20/12 08:31
|
|
|