예제 #1
0
    //void stepPhysics()
    void stepPhysics()
    {
        //// Start simulation
        //gScene->simulate(1.0f/60.0f);
        gScene.simulate(1 / 60f);

        //// Start ray-cast threads
        //gRaysAvailable = gRayCount;
        //gRaysCompleted = 0;
        gRaysAvailable = gRayCount;
        gRaysCompleted = 0;

        //// Signal to each raycast thread that they can start performing raycasts.
        //for (PxU32 i=0; i < gNumThreads; ++i)
        for (uint i = 0; i < gNumThreads; ++i)
        {
            //SnippetUtils::syncSet(gThreads[i].mWorkReadySyncHandle);
            gThreads[i].mWorkReadySyncHandle.Set();
        }

        //// Wait for raycast threads to finish.
        //SnippetUtils::syncWait(gWorkDoneSyncHandle);
        //SnippetUtils::syncReset(gWorkDoneSyncHandle);
        gWorkDoneSyncHandle.WaitOne();
        gWorkDoneSyncHandle.Reset();

        //// Fetch simulation results
        //gScene->fetchResults(true);
        gScene.fetchResults(true);
    }
예제 #2
0
    //void stepPhysics(bool /*interactive*/){
    void stepPhysics(bool interactive)
    {
        //gScene->simulate(1.0f/60.0f);
        //gScene->fetchResults(true);
        gScene.simulate(1 / 60f);
        gScene.fetchResults(true);

        var p = DEBUG.getGlobalPose().p;

        System.Console.WriteLine($"{p.x}, {p.y}, {p.z}");
    }