Jump to content

  • Log In with Google      Sign In   
  • Create Account


Tom123

Member Since 15 Jan 2013
Offline Last Active May 11 2013 11:45 PM
-----

Topics I've Started

Physx 2.8.4 hardware acceleration problem

01 March 2013 - 03:35 AM

Hello, guys. I'm using Physx to create a square cloth.

 

If the cloth is big enough, for example 8cm*7cm, then it falls down at the plane successfully.

If the cloth is not big enough, for example 2cm*3cm then while it fall down to the plane, it immediate bounces up and even much higher than it original start point.

This problem only appeared with GPU acceleration. If I turn the GPU acceleration flag off, then the problem gone.

 

Could anyone tell how can I fix the problem? It is fixable(cause not by Physx SDK but just my setting of the scene wrong) or not?


Physx 3.2.2 SDK Cloth

20 February 2013 - 01:55 AM

I want to create a leaf and simulate leaf motion by Physx 3.2.2. I try to use ConvexMesh to create a leaf firstly, but the number of vertex is more than 256, so I try to use PxCloth to create leaf. I want to make leaf is stiff, but it is too soft and is crumpled when I move leaf. If I want to create a stiff leaf, What can I do?


[Physx 3.2.2] Cloth

22 January 2013 - 02:32 AM

I implement an example kind of like this video " " using Physx 3.2.2. If I want to make the ball stay on the net, what should I do. I use PxCloth to implement net and use PxClothCollisionSphere to implement the ball.


[physx3.2.2 ]

20 January 2013 - 02:33 AM

I am getting familiar with Physxx3.2.2 SDK. I want to implement a example which uses ConvexMesh/TriangleMesh to create a actor then according to some collision detection to make actor to do some deformation.

 

 I think maybe I can use some function in  PxSimulationEventCallBack to help me achieve those effect! Does anyone have some simple example about how to use PxTriggerPairFlag function or some information can help me ?


[physx3.2.2 question]collision problem related to triangle mesh object

15 January 2013 - 03:59 AM

hi guys. I'm a newbie and learning physx 3.2.2.

Now i meet a problem that I use PxTriangleMesh function to create a simple cube. We have also used PxSphereGeometry function and created a sphere. We create also a plane. The sphere can successfully drops down, touch the plane and stop, but the cube which created by triangle mesh directly fall down and over the plane. There may be something wrong with the collision detection part but I don't know why and how. 

 

Here is the code that create the cube with triangle mesh:

 

// create triangle mesh
 
PxTransform transform(PxVec3(0.0f, 15.0f, 0.0f), PxQuat::createIdentity());
PxRigidDynamic *actor = gPhysicsSDK->createRigidDynamic(transform);
//actor->setRigidDynamicFlag(PxRigidDynamicFlag::eKINEMATIC,true);
if (!actor)
cerr<<"create actor failed!"<<endl;
 
PxTriangleMeshDesc meshDesc;
PxVec3 data[8]={
PxVec3(-1.0,-1.0,-1.0),
PxVec3(1.0,-1.0,-1.0),
PxVec3(-1.0,1.0,-1.0),
PxVec3(1.0,1.0,-1.0),
PxVec3(-1.0,-1.0,1.0),
PxVec3(1.0,-1.0,1.0),
PxVec3(-1.0,1.0,1.0),
PxVec3(1.0,1.0,1.0)
};
 
PxU32 indices[12*3] = {
1,2,3,        
        0,2,1,    
        5,7,6,    
        4,5,6,    
        5,4,1,    
        1,4,0,    
        1,3,5,    
        3,7,5,    
        3,2,7,    
        2,6,7,    
        2,0,6,    
        4,6,0
};
 
meshDesc.points.count = 8;
meshDesc.points.stride = sizeof(PxVec3);
meshDesc.points.data = data;
meshDesc.triangles.count = 12;
meshDesc.triangles.stride = 3 * sizeof(PxU32);
meshDesc.triangles.data = indices;
meshDesc.flags = PxMeshFlags(0);
 
PxToolkit::MemoryOutputStream writeBuffer;
PxCookingParams cookingP;
cookingP.suppressTriangleMeshRemapTable = true;
cookingP.buildTriangleAdjacencies = true;
cooking->setParams(cookingP);
 
bool status = cooking->cookTriangleMesh(meshDesc, writeBuffer);
 
if(!status)
cerr<<"fail cooking";
 
PxToolkit::MemoryInputData readBuffer(writeBuffer.getData(), writeBuffer.getSize());
PxTriangleMesh* triangleMesh =  gPhysicsSDK->createTriangleMesh(readBuffer);
PxTriangleMeshGeometry geom(triangleMesh);
 
PxShape *aTriMeshShape = actor->createShape(geom, *mMaterial,PxTransform(PxVec3(0.0f, 0.0f, 0.0f), PxQuat::createIdentity()));
actor->setAngularDamping(0.0);
actor->setLinearVelocity(PxVec3(0,-1.0,0)); 
actor->setLinearVelocity(PxVec3(0,-1.0f,0), true);
actor->userData = (void*) 1;
actor->setRigidDynamicFlag(PxRigidDynamicFlag::eUSE_KINEMATIC_TARGET_FOR_SCENE_QUERIES,true);
actor->setActorFlag(PxActorFlag::eVISUALIZATION,true);
 
gScene->addActor(*actor);
 
 
 
 
 

PARTNERS