Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualN01

Posted 05 September 2013 - 05:39 AM

 

That PxMeshScale is probably what you should attempt to get rid of, for now. Scale should be 1.0, and the actor size determined entirely by the convex hull dimensions (at the point where you "cook" it). How big is the convex hull anyway, I mean the approximate distance between two furthest points forming it?

ok, tried pre-scaling convex hull(by multiplying vertices), thus removing PxMeshScale. everything acts exactly the same.

to clarify, my convex hulls are based on the model. but this model can be used by different entities, with different scaling. that's it. so i rescale initial convex hull by that entitiy's scale using PxMeshScale, before passing it to the scene, so it fits perfectly. and they look fine in PVD. so data is 100% ok, but i may set some parameters wrong. documentation is not clear on call order and physical parameters of objects and doesn't say much about scale\mass.

 

 

At least in earlier versions of physx 3.x, that PxMeshScale didn't fix oversized convex hulls. Did you already try unit spheres (for example), to see if they make any difference in speed? And how's your initialization code?

 

just tried PxSphereGeometry(1.0f) instead of convex geometry, they're in slow-mo as well, but they don't fall through static stuff(i guess, cause sphere collision is really basic and predictable).

 

my PhysX base scene initialization:

        mFoundation = PxCreateFoundation(
            PX_PHYSICS_VERSION,
            gDefaultAllocatorCallback,
            gDefaultErrorCallback);

        mCooking = PxCreateCooking(PX_PHYSICS_VERSION, *mFoundation, PxCookingParams());

        mPhysics = PxCreatePhysics(
            PX_PHYSICS_VERSION,
            *mFoundation,
            PxTolerancesScale());

        PxInitExtensions(*mPhysics);

        PxSceneDesc sceneDesc(mPhysics->getTolerancesScale());
        sceneDesc.gravity = PxVec3(0.0f, -9.8f, 0.0f);

        if(!sceneDesc.cpuDispatcher)
        {
            PxDefaultCpuDispatcher* mCpuDispatcher = PxDefaultCpuDispatcherCreate(1);
            sceneDesc.cpuDispatcher = mCpuDispatcher;
        }

        if(!sceneDesc.filterShader)
            sceneDesc.filterShader  = gDefaultFilterShader;


        mScene = mPhysics->createScene(sceneDesc);

Timestep:

 

mStepSize = 1.0f / 30.0f;

float deltaTime = clock() - mLastTime;
        mAccumulator  += deltaTime;
        if(mAccumulator < mStepSize)
            return;

        mAccumulator -= mStepSize;

        mScene->simulate(mStepSize);
        mScene->fetchResults(true);

        mLastTime = clock();

running in a separate thread at 30 FPS.


#3N01

Posted 05 September 2013 - 05:39 AM

 

That PxMeshScale is probably what you should attempt to get rid of, for now. Scale should be 1.0, and the actor size determined entirely by the convex hull dimensions (at the point where you "cook" it). How big is the convex hull anyway, I mean the approximate distance between two furthest points forming it?

ok, tried pre-scaling convex hull(by multiplying vertices), thus removing PxMeshScale. everything acts exactly the same.

to clarify, my convex hulls are based on the model. but this model can be used by different entities, with different scaling. that's it. so i rescale initial convex hull by that entitiy's scale using PxMeshScale, before passing it to the scene, so it fits perfectly. and they look fine in PVD. so data is 100% ok, but i may set some parameters wrong. documentation is not clear on call order and physical parameters of objects and doesn't say much about scale\mass.

 

 

At least in earlier versions of physx 3.x, that PxMeshScale didn't fix oversized convex hulls. Did you already try unit spheres (for example), to see if they make any difference in speed? And how's your initialization code?

 

just tried PxSphereGeometry(1.0f) instead of convex geometry, they're in slow-mo as well, but they don't fall through static stuff(i guess, cause sphere collision is really basic and predictable).

 

my PhysX base scene initialization:

        mFoundation = PxCreateFoundation(
            PX_PHYSICS_VERSION,
            gDefaultAllocatorCallback,
            gDefaultErrorCallback);

        mCooking = PxCreateCooking(PX_PHYSICS_VERSION, *mFoundation, PxCookingParams());

        mPhysics = PxCreatePhysics(
            PX_PHYSICS_VERSION,
            *mFoundation,
            PxTolerancesScale());

        PxInitExtensions(*mPhysics);

        PxSceneDesc sceneDesc(mPhysics->getTolerancesScale());
        sceneDesc.gravity = PxVec3(0.0f, -9.8f, 0.0f);

        if(!sceneDesc.cpuDispatcher)
        {
            PxDefaultCpuDispatcher* mCpuDispatcher = PxDefaultCpuDispatcherCreate(1);
            sceneDesc.cpuDispatcher = mCpuDispatcher;
        }

        if(!sceneDesc.filterShader)
            sceneDesc.filterShader  = gDefaultFilterShader;


        mScene = mPhysics->createScene(sceneDesc);

Timestep:

 

mStepSize = 1.0f / 30.0f;

float deltaTime = clock() - mLastTime;
        mAccumulator  += deltaTime;
        if(mAccumulator < mStepSize)
            return;

        mAccumulator -= mStepSize;

        mScene->simulate(mStepSize);
        mScene->fetchResults(true);

        mLastTime = clock();

#2N01

Posted 05 September 2013 - 05:31 AM

 

That PxMeshScale is probably what you should attempt to get rid of, for now. Scale should be 1.0, and the actor size determined entirely by the convex hull dimensions (at the point where you "cook" it). How big is the convex hull anyway, I mean the approximate distance between two furthest points forming it?

ok, tried pre-scaling convex hull(by multiplying vertices), thus removing PxMeshScale. everything acts exactly the same.

to clarify, my convex hulls are based on the model. but this model can be used by different entities, with different scaling. that's it. so i rescale initial convex hull by that entitiy's scale using PxMeshScale, before passing it to the scene, so it fits perfectly. and they look fine in PVD. so data is 100% ok, but i may set some parameters wrong. documentation is not clear on call order and physical parameters of objects and doesn't say much about scale\mass.

 

 

At least in earlier versions of physx 3.x, that PxMeshScale didn't fix oversized convex hulls. Did you already try unit spheres (for example), to see if they make any difference in speed? And how's your initialization code?

 

just tried PxSphereGeometry(1.0f) instead of convex geometry, they're in slow-mo as well, but they don't fall through static stuff(i guess, cause sphere collision is really basic and predictable).

 

my PhysX base scene initialization:

        mFoundation = PxCreateFoundation(
            PX_PHYSICS_VERSION,
            gDefaultAllocatorCallback,
            gDefaultErrorCallback);

        mCooking = PxCreateCooking(PX_PHYSICS_VERSION, *mFoundation, PxCookingParams());

        mPhysics = PxCreatePhysics(
            PX_PHYSICS_VERSION,
            *mFoundation,
            PxTolerancesScale());

        PxInitExtensions(*mPhysics);

        PxSceneDesc sceneDesc(mPhysics->getTolerancesScale());
        sceneDesc.gravity = PxVec3(0.0f, -9.8f, 0.0f);

        if(!sceneDesc.cpuDispatcher)
        {
            PxDefaultCpuDispatcher* mCpuDispatcher = PxDefaultCpuDispatcherCreate(1);
            sceneDesc.cpuDispatcher = mCpuDispatcher;
        }

        if(!sceneDesc.filterShader)
            sceneDesc.filterShader  = gDefaultFilterShader;


        mScene = mPhysics->createScene(sceneDesc);

#1N01

Posted 05 September 2013 - 05:27 AM

 

That PxMeshScale is probably what you should attempt to get rid of, for now. Scale should be 1.0, and the actor size determined entirely by the convex hull dimensions (at the point where you "cook" it). How big is the convex hull anyway, I mean the approximate distance between two furthest points forming it?

ok, tried pre-scaling convex hull(by multiplying vertices), thus removing PxMeshScale. everything acts exactly the same.

to clarify, my convex hulls are based on the model. but this model can be used by different entities, with different scaling. that's it. so i rescale initial convex hull by that object's scale using PxMeshScale, so it fits perfectly. and they look fine in PVD. so data is 100% ok, but i may set some parameters wrong. documentation is not clear on call order and physical parameters of objects and doesn't say much about scale\mass.

 

 

At least in earlier versions of physx 3.x, that PxMeshScale didn't fix oversized convex hulls. Did you already try unit spheres (for example), to see if they make any difference in speed? And how's your initialization code?

 

just tried PxSphereGeometry(1.0f) instead of convex geometry, they're in slow-mo as well, but they don't fall through static stuff(i guess, cause sphere collision is really basic and predictable).

 

my PhysX base scene initialization:

        mFoundation = PxCreateFoundation(
            PX_PHYSICS_VERSION,
            gDefaultAllocatorCallback,
            gDefaultErrorCallback);

        mCooking = PxCreateCooking(PX_PHYSICS_VERSION, *mFoundation, PxCookingParams());

        mPhysics = PxCreatePhysics(
            PX_PHYSICS_VERSION,
            *mFoundation,
            PxTolerancesScale());

        PxInitExtensions(*mPhysics);

        PxSceneDesc sceneDesc(mPhysics->getTolerancesScale());
        sceneDesc.gravity = PxVec3(0.0f, -9.8f, 0.0f);

        if(!sceneDesc.cpuDispatcher)
        {
            PxDefaultCpuDispatcher* mCpuDispatcher = PxDefaultCpuDispatcherCreate(1);
            sceneDesc.cpuDispatcher = mCpuDispatcher;
        }

        if(!sceneDesc.filterShader)
            sceneDesc.filterShader  = gDefaultFilterShader;


        mScene = mPhysics->createScene(sceneDesc);

PARTNERS