Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

125 Neutral

About Tom123

  • Rank
  1. 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?
  2. 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?
  3. 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.
  4. 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 ?
  5.  thank you!!   I add  " actor->setRigidDynamicFlag(PxRigidDynamicFlag::eKINEMATIC,true); " to change the triangle dynamic actor to  kinematic actor, I use boxgeometry create a set of cubes and those are the dynamic actors. Then use them to hit kinematic actor--triangle mesh cube. The kinematic actor cube can  intercept dynamic actor cubes, it seems that the collision detection happened, but now a new problem appeared, the kinematic actor cube can not fall down, it just hang on the air even though I have set the kinematic target and linear velocity. So what's the problem here?
  6. here is code that create the plane:   //1) Create ground plane     PxReal d = 0.0f;   PxTransform pose = PxTransform(PxVec3(0.0f, 0.0f, 0.0f),PxQuat(PxHalfPi, PxVec3(0.0f, 0.0f, 1.0f)));   PxRigidStatic* plane = gPhysicsSDK->createRigidStatic(pose); if (!plane) cerr<<"create plane failed!"<<endl; PxShape* shape = plane->createShape(PxPlaneGeometry(), *mMaterial);   if (!shape) cerr<<"create shape failed!"<<endl; gScene->addActor(*plane);     I want to be familiar with PxTriangleMeshGeometry function so I use it to create a cube
  7. 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);          
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!