0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
AckphysX3 development thread
#408841
10/08/12 14:20
10/08/12 14:20
|
Joined: Feb 2010
Posts: 320 TANA/Madagascar
3dgs_snake
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
Hi, I have developped for some months now a new physX plugin based on physX3 (actually 3.2.4). The current physX plugin is good but there were some (not so many)missing things for me (raycasts whithout an entity, sweep tests, ...). Actually, I have implemented rigid body dynamics, scene queries, character controllers and vehicles (No cloths and fluids, for now ) I will continue to develop the remaining functionalities depending on interests shown by the community. Anyway, below is a first demo for you all to test and experiment with the thing (And also for debugging purposes). Please tell me if you find some weird things or if there are things that you think missing. 20121008 - AckphysX3 Demo 20131128_ackphysX3CHECKED(0.93) (physX 3.2.4) Actually, there is no documentation except the description of every function that can be found in the header file (ackphysX3.h). The file also contains some files I created to test the implementation (Function names are quite similar to the actual physX plugin, just add 3 after the X)If I remember well (But not sure after changes I made lately ), the plugin (Not the demo files) is working with A7Files in the zip- ackphysX3_main.c : Actor creation
- cctbehaviour.c : CCT behaviour test (Can Ride & Slide)
- constraints_test.c : Test for all the type of constraints (Ball, Rope, Fixed, Slider, 6D).
- ackphysX3_main.c : Actor creation
- controller_test.c : CCT Test
- controller_test_2.c : CCT and trigger test Test
- forces_test.c : Test file for different kind of force APIs
- ford.c : Vehicles test
- scenequery_test.c : Test file for scene queries (raycast, sweep : sphere_cast; capsule_cast, overlap : sphere_check, capsule_check);
I will implement more demos soon. Hope you like it.
Last edited by 3dgs_snake; 11/28/13 11:53. Reason: 20131128_ackphysX3CHECKED(0.93)
|
|
|
Re: AckphysX3 development thread
[Re: bodden]
#408878
10/08/12 19:46
10/08/12 19:46
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
But what I don't understand: Where are the differences to physX? Are there any advantages/disadvantages? NVIDIA PhysX SDK 3.x (PhysX Software Development Kit version 3.0-3.2; PhysX-3) is a physics simulation middleware, new major version of PhysX SDK released by NVIDIA in May 2011.
While PhysX SDK 2.x is based on patchwork design and old code base, developed in Ageia and NovodeX, new PhysX SDK 3.0 has undergone arhitecture and API improvements, code was cleaned and refactored, considerable legacy cluster was removed, new features were added. http://physxinfo.com/wiki/PhysX_SDK_3.xHi, ...(No cloths and fluids, for now )... Hope you like it. Hi 3dgs_snake, I like it very much! I can implement the cloth simulation, but I need your ackphysX3CHECKED.dll source code, pm me if you are interested?
|
|
|
Re: AckphysX3 development thread
[Re: rojart]
#408901
10/09/12 05:15
10/09/12 05:15
|
Joined: Feb 2010
Posts: 320 TANA/Madagascar
3dgs_snake
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
Hi, You can grab a new version of the dll (I fixed some minor bugs). I can implement the cloth simulation, but I need your ackphysX3CHECKED.dll source code, pm me if you are interested? Thanks rojart, I will contact you when the plugin is more stable (There are some functionalities still not fully tested - eg Tanks - And I want to change some little things in the vehicles internal creation process). Also, physX3 cloth is quite different from the 2.x version (But not so much I hope), as they don't collide with the scene geometries but instead with collision shapes you need to provide on the cloth creation (They think to implement that in a future version). That's also why I didn't try an implementation because I'm still thinking of the best way to do that while still keeping things simple and clean for GS.
|
|
|
Re: AckphysX3 development thread
[Re: 3run]
#408939
10/09/12 14:50
10/09/12 14:50
|
Joined: Feb 2010
Posts: 320 TANA/Madagascar
3dgs_snake
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
Hi, Some tip : By default Character controllers don't push bodies (I think I saw some complaints on this with the physX plugin). If needed, that can be done using cct collision event (and can depend on other properties, like object mass, character strength, ...). 1. ENABLE_FRICTION for the CCT
cct->event = cct_event;
cct->emask |= ENABLE_FRICTION;
2. Push bodies in the event handler
/// \brief CCT event handling
///
void cct_event()
{
VECTOR hit_dir;
vec_set(hit_dir, hit.blue); // Hit direction is stored on the (red, green blue) :)
var hit_length = hit.alpha; // Hit length is stored on the alpha :)
if (hit_dir.z == 0)
{
var coeff = pX3ent_getmass(you) * hit_length / 40; // Scale to meter
// Set force to impulse
pX3_setforcemode(PX_IMPULSE);
vec_scale(hit_dir, coeff);
//set(you, TRANSLUCENT);
pX3ent_addforceatlocalpos(you, hit_dir, nullvector);
}
}
More complete documentation soon. // Hit direction is stored on the (red, green blue) Sorry for that, but I wanted to use the CONTACT struct, so I choose what was available.
|
|
|
Re: AckphysX3 development thread
[Re: 3dgs_snake]
#409561
10/19/12 10:27
10/19/12 10:27
|
Joined: Oct 2004
Posts: 900 Lgh
rojart
User
|
User
Joined: Oct 2004
Posts: 900
Lgh
|
Hi, You can grab a new version of the dll (I fixed some minor bugs). I can implement the cloth simulation, but I need your ackphysX3CHECKED.dll source code, pm me if you are interested? Thanks rojart, I will contact you when the plugin is more stable ... Thanks it would be really useful, I played a bit with sdk 3.2.1 and got to work also, but only the SDK works for me now. Here is my converted CreateCube definition code, here i missed something that the code don't Transforms the PhysX Object like the Engine Entity?
void PhysX3::CreateCube(ENTITY * ent, const PxVec3& pos, int body, PxVec3& TempScale)
{
PX_ASSERT(0 != gScene);
PxVec3 vec_min,vec_max;
GetMinMax(ent,vec_min,vec_max);
PxMaterial* mMaterial = gPhysicsSDK->createMaterial(1.0,1.0,1.0);
// Setting up the Dimensions
PxVec3 dimensions = (vec_max-vec_min)/2;
dimensions.x *= TempScale.x;
dimensions.y *= TempScale.y;
dimensions.z *= TempScale.z;
PxBoxGeometry geometry(dimensions);
PxReal density = 1.0f;
PxTransform transform(PxVec3(pos.x, pos.y, pos.z)* PXSize, PxQuat::createIdentity());
PxRigidDynamic *actor = PxCreateDynamic(*gPhysicsSDK, transform, geometry, *mMaterial, density);
actor->setAngularDamping(0.75);
actor->setLinearVelocity(PxVec3(0,0,0));
if (!actor)
error("create actor failed!");
box = actor;
// Save the entity's index to the userData of the shape
box->userData = (long*)ent->link.index;
mPhysicsActors.push_back(box);
PxU32 nShapes = box->getNbShapes();
PxShape** shapes = new PxShape*[nShapes];
box->getShapes(shapes, nShapes);
PxTransform pT = transform;
pT.p = PXSize * pos;
PxBoxGeometry bg = geometry;
PxMat33 pose = PxMat33(pT.q );
float mat[16];
getColumnMajor(pose,pT.p, mat);
ang_to_matrix((ANGLE*)&(ent->pan),&(mat[0]));
box->setDominanceGroup(1);
PX_ASSERT(box->isValid());
gScene->addActor(*box);
}
|
|
|
Re: AckphysX3 development thread
[Re: rojart]
#409568
10/19/12 11:17
10/19/12 11:17
|
Joined: Feb 2010
Posts: 320 TANA/Madagascar
3dgs_snake
OP
Senior Member
|
OP
Senior Member
Joined: Feb 2010
Posts: 320
TANA/Madagascar
|
Hi, I think that the proble is in the function. Or try to use rowMajor .
|
|
|
|