私は現在、キャラクターに2つの腕を作り、その動きにNxRevoluteJointを使用しようとしています。例として挙げた別のプログラムでこれらを完全に機能させ、この新しいプロジェクトで同じコードを使用しましたが、エラー(タイトルの1つ)が発生し、修正方法に苦労しています。ポインタがどこかでNULLを参照していることは理解していますが、それを分類する方法がわかりません。
変数はグローバルに設定されます。
NxRevoluteJoint* playerLeftJoint= 0;
NxRevoluteJoint* playerRightJoint= 0;
これは、プレーヤーが複合オブジェクトとしてビルドされている別の関数のコードです。
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);
エラーが発生している行は、playerLeftJoint->setLimits(limit1);