Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:35:07+00:00 2026-06-16T13:35:07+00:00

I am currently trying to make two arms on a character and use NxRevoluteJoint

  • 0

I am currently trying to make two arms on a character and use NxRevoluteJoint for their movement. I have these working perfectly in another program that has been given as an example and I have used the same code in this new project however I am getting an error (the one in the title) and I am struggling how to fix it. I understand that the pointers is reference to NULL at some place but I can’t see how to sort it out.

The variables are set globally:

NxRevoluteJoint* playerLeftJoint= 0;
NxRevoluteJoint* playerRightJoint= 0;

This is the code in the seperate function where the player is being built as a compound object:

NxVec3 globalAnchor(0,1,0);     
NxVec3 globalAxis(0,0,1);       

playerLeftJoint= CreateRevoluteJoint(0,actor2,globalAnchor,globalAxis);
playerRightJoint= CreateRevoluteJoint(0,actor2,globalAnchor,globalAxis);


//set joint limits
NxJointLimitPairDesc limit1;
limit1.low.value = -0.3f;
limit1.high.value = 0.0f;
playerLeftJoint->setLimits(limit1);


NxJointLimitPairDesc limit2;
limit2.low.value = 0.0f;
limit2.high.value = 0.3f;
playerRightJoint->setLimits(limit2);    

NxMotorDesc motorDesc1;
motorDesc1.velTarget = 0.15;
motorDesc1.maxForce = 1000;
motorDesc1.freeSpin = true;
playerLeftJoint->setMotor(motorDesc1);

NxMotorDesc motorDesc2;
motorDesc2.velTarget = -0.15;
motorDesc2.maxForce = 1000;
motorDesc2.freeSpin = true;
playerRightJoint->setMotor(motorDesc2);

The line where I am getting the error is at the playerLeftJoint->setLimits(limit1);

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:35:08+00:00Added an answer on June 16, 2026 at 1:35 pm

    CreateRevoluteJoint is returning a null pointer, simple as that. The error message makes it very clear that the pointer has a value of 0. Of course, you didn’t post that function, so that’s the best information I can give you. As such, this line;

    playerLeftJoint->setLimits(limit1);
    

    dereferences the pointer playerLeftJoint, which is an invalid pointer. You need to initialize your pointers. I can’t see your entire program structure, so in this case the most simple fix would be something like;

    if(!playerLeftJoint)
        playerLeftJoint = new NxRevoluteJoint();
    
    // same for the other pointer, now they are valid
    

    Additionally, as this is C++ and not C, use a smart pointer to handle memory for you, i.e.,

    #include <memory>
    
    std::unique_ptr<NxRevoluteJoint> playerLeftJoint;
    
    // or, if you have a custom deallocater...
    std::unique_ptr<NxRevoluteJoint, RevoluteJointDeleter> playerLeftJoint;
    
    // ...
    
    playerLeftJoint.reset(new NxRevoluteJoint(...));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're currently stuck trying to make a simple (?) SQL query. We have these
I'm currently working on a site where I'm trying to make use of the
The graph I'm currently trying to make falls a little between two stools. I
I am transitioning my CMS to use CKEditor. I am currently trying to make
so I'm currently trying to make an OpenID provider. I've tried using two Java
Possible Duplicate: extending from two classes I'm currently trying to make a simple Mod
I'm currently trying to make a simple square by combining two triangles, like in
I'm currently trying to make a set of conversion functions which, through one call,
I'm currently trying to make an orientation calculator in java and I'm having a
I am currently trying to make a sectioned table like this: Section 1: Entry

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.