*
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 » how to get actors
Page: 1 go to end Reply
Author Topic: how to get actors 128 views
  • s.Oliver
    s.Oliver's avatar
    Community Member
    3 posts

    how to get actors

    Hi,

    i'm trying to create a game with XNA and PhysX-sharp.

    My problem is: actors are always null.

    the scene itself is initialized correctly (i guess so, there were no errors), but i can't create actors with scene.createActor(actordescription), it always returns null. actordescription.IsValid returns true.

    I'm using XNA 3.1 (doesn't matter, or does it?), PhysX-Sharp 0.9.3, got the latest PhysX-Driver and PhysX-SDK 2.8.1.

    Hope anybody can help.

    Code:

     
    //global
    Nx.scene
     
    //initialize
    Nx.NxPhysicsSDKDesc sdkdesc = new Nx.NxPhysicsSDKDesc();
    Nx.NxSDKCreateError err = Nx.NxSDKCreateError.NXCE_NO_ERROR;
     
    sdk = Nx.PhysXLoader.NxCreatePhysicsSDK(Nx.PhysXLoader.NX_PHYSICS_SDK_VERSION, sdkdesc, ref err);
    Nx.NxSceneDesc sceneDesc = new Nx.NxSceneDesc();
     
    scene = sdk.createScene(sceneDesc);
     
     
     
    //procedure: NxActor CreateBox(Matrix world, Vector3 dim, float mass)
    Nx.NxBoxShapeDesc boxDesc = new Nx.NxBoxShapeDesc();
     
    boxDesc.dimensions = swapper.CreateNxVector(dim); //swapper is a little swapper for XNA-Vectors and matrices and physx
     
    Nx.NxActorDesc actorDesc = new Nx.NxActorDesc();
    Nx.NxBodyDesc bodyDesc = new Nx.NxBodyDesc();
     
     
    bodyDesc.mass = mass;
     
    actorDesc.body = bodyDesc;
    actorDesc.density = 10.0f;
     
    actorDesc.globalPose = swapper.CreateNxMat34(world);
     
    actorDesc.shapes.pushBack(boxDesc);
     
    if (!actorDesc.isValid())
    throw new Exception("Invalid Box"); //never thrown
     
    return scene.createActor(actorDesc);
     
     

  • s.Oliver
    s.Oliver's avatar
    Community Member
    3 posts

    Re: how to get actors

    very well visited forum, i see...

    128 views
go to top Reply

Currently Online:

There is nobody online.

Welcome to our latest member: jfreie