*
Login | forgot password | register | register with OpenID Click here to register with OpenID
X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

(what is OpenID?)

Forums

45 Posts in 15 Topics by 16 members

Jump to:

General Discussion

If this is your first visit, you will need to register before you can post. However, you can browse all messages below.

Imaginary Game Engine » Forums » General Discussion » hey, a question
Page: 1 go to end Reply
Author Topic: hey, a question 987 views
  • iffanka
    iffanka's avatar
    Community Member
    1 posts

    hey, a question

    i tried you PhysX wrapper,
    it's nice and it works, but isSleeping() function ;)
    and actually
    it has some speed penalty..
    with 100 textured boxes
    -a CLI wrapper (not as complete as this one) performs 260 FPS
    -your wrapper performs at 170 fps.. so quite big difference
    is there an option that i missed to turn off/on that could speedup your wrapper or is that just a disadvantage of P/Invoke?
    thank you,
    Iffanka

  • SeaEagle1
    SeaEagle1's avatar
    Administrator
    16 posts

    Re: hey, a question

    P/Invoke has a bit more overhead on function calls than C++/CLI, so that might very well be the issue. Also the C++/CLI wrappers that are available a mostly hand written and sometimes reimplement (parts of) classes in managed code, to avoid the overhead of switching between managed and unmanaged code. My wrapper just passes everything to the unmanaged PhysX api, so relatively static stuff can get a significant speedup by storing the results in managed code (NxActor.isDynamic() for example).

    As a side note, FPS is not the best way to measure code excecution speed as it's a non-linear 1/x-scale. Comparing an average of 5.8ms vs 3.8 ms per frame gives a better comparison (I agree that it's still quite a difference though).

    Last edited: 5 May 2008 at 7:13pm

  • MoP
    MoP's avatar
    Community Member
    5 posts

    Re: hey, a question

    Hi.
    I'm trying to initialize PhysX engine and create a simple scene with C#, but there is an error in the following code:

    NxSDKCreateError er=new NxSDKCreateError();
    NxPhysicsSDK sdk = PhysXLoader.NxCreatePhysicsSDK(0, new NxPhysicsSDKDesc(),ref er);
    NxScene scene = sdk.createScene(new NxSceneDesc());

    exception in 3rd line:
    AccessViolationException:
    Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    Please, help me with it, or give a valid sample of using PhysX

  • SeaEagle1
    SeaEagle1's avatar
    Administrator
    16 posts

    Re: hey, a question

    I suspect you have some trouble with initialising the SDK. Make sure it gets properly initialised. I'm using the following code to initialise my scene:

     
    // Create PhysX SDK
    NxSDKCreateError createError = NxSDKCreateError.NXCE_NO_ERROR;
    sdk = PhysXLoader.NxCreatePhysicsSDK(PhysXLoader.NX_PHYSICS_SDK_VERSION, new NxPhysicsSDKDesc(), ref createError);
    // Check SDK creation
    if (sdk == null || createError != NxSDKCreateError.NXCE_NO_ERROR)
    LogMgr.Instance.Error("Unable to load PhysX: " + createError, new NotSupportedException());
     
    // Setup scene
    NxSceneDesc scenedesc = new NxSceneDesc();
    scenedesc.flags = scenedesc.flags | (uint) NxSceneFlags.NX_SF_SIMULATE_SEPARATE_THREAD;
    NxScene scene = sdk.createScene(scenedesc);
     

    Last edited: 16 June 2008 at 12:36pm

  • MoP
    MoP's avatar
    Community Member
    5 posts

    Re: hey, a question

    Oh, thank you very mutch.
    This exception was occured because of passing wrong uint sdkversion in function NxCreatePhysicsSDK()
    Your code is working properly.

    987 views
go to top Reply

Currently Online:

There is nobody online.

Welcome to our latest member: jfreie