Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 521 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 4 1 2 3 4
AckphysX3 development thread #408841
10/08/12 14:20
10/08/12 14:20
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline 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 tongue ) 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 tongue 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 tongue ), the plugin (Not the demo files) is working with A7

Files 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: 3dgs_snake] #408865
10/08/12 17:41
10/08/12 17:41
Joined: Sep 2007
Posts: 62
Germany
B
bodden Offline
Junior Member
bodden  Offline
Junior Member
B

Joined: Sep 2007
Posts: 62
Germany
I tried the examples. Works fine for me. Really nice work.

But what I don't understand: Where are the differences to physX? Are there any advantages/disadvantages?

Re: AckphysX3 development thread [Re: bodden] #408878
10/08/12 19:46
10/08/12 19:46
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: bodden
But what I don't understand: Where are the differences to physX? Are there any advantages/disadvantages?

Quote:
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.x

Originally Posted By: 3dgs_snake
Hi, ...(No cloths and fluids, for now tongue )...
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?


Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
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 Offline OP
Senior Member
3dgs_snake  Offline 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).

Quote:
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: 3dgs_snake] #408904
10/09/12 07:33
10/09/12 07:33
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
It's perfect mate! laugh Please, don't give up on this! Continue developing and add cloth, particles, destructions (omg.. I'm waiting for this one so long..)! laugh I'll do my best to test and help you with finding bugs. Thank you for it mate, it's awesome! And thank you for your time which you've spent on it.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
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 Offline OP
Senior Member
3dgs_snake  Offline 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
Code:
cct->event = cct_event;
cct->emask |= ENABLE_FRICTION;



2. Push bodies in the event handler
Code:
/// \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.

Quote:
// Hit direction is stored on the (red, green blue) laugh

Sorry for that, but I wanted to use the CONTACT struct, so I choose what was available. grin

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 Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
Originally Posted By: 3dgs_snake
Hi,

You can grab a new version of the dll (I fixed some minor bugs).

Quote:
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?

Code:
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);
}



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
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 Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

I think that the proble is in the
Code:
getColumnMajor(

function. Or try to use rowMajor wink .

Re: AckphysX3 development thread [Re: 3dgs_snake] #409575
10/19/12 12:07
10/19/12 12:07
Joined: Oct 2004
Posts: 900
Lgh
rojart Offline
User
rojart  Offline
User

Joined: Oct 2004
Posts: 900
Lgh
My getColumnMajor definition looks like this, it's wrong?

Code:
inline void getColumnMajor(PxMat33 m, PxVec3 t, float* mat)
{
	mat[0] = m.column0[0];
	mat[1] = m.column0[1];
	mat[2] = m.column0[2];
	mat[3] = 0;

	mat[4] = m.column1[0];
	mat[5] = m.column1[1];
	mat[6] = m.column1[2];
	mat[7] = 0;

	mat[8] = m.column2[0];
	mat[9] = m.column2[1];
	mat[10] = m.column2[2];
	mat[11] = 0;

	mat[12] = t[0];
	mat[13] = t[1];
	mat[14] = t[2];
	mat[15] = 1;
}



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P
Re: AckphysX3 development thread [Re: rojart] #409577
10/19/12 12:23
10/19/12 12:23
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline OP
Senior Member
3dgs_snake  Offline OP
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

I didn't use m.columnx. I used m[i] directly wink

Page 1 of 4 1 2 3 4

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1