■NxPointInPlaneJointDesc クラス | Top |
平面ジョイントを設定します。
関数名 説明 setToDefault 初期値を設定します。 isValid
このクラスはアクターが移動できる範囲を平面に固定します。このクラスは NxJointDesc クラスから追加機能を継承します。
NxScene* m_pNxScene; NxActor* m_pActorBox; NxPointInPlaneJointDesc pipDesc; pipDesc.actor[0] = NULL; // ワールド空間に固定する pipDesc.actor[1] = m_pActorBox; // ジョイントで接続するアクターを設定 pipDesc.localAnchor[0] = NxVec3( 0, 10, 40 ); // ワールド座標系で設定 pipDesc.localAnchor[1] = NxVec3( 0, 2, 0 ); // アンカーポイントをローカル座標系で設定 pipDesc.setGlobalAxis( NxVec3( 0, 1, 0 ) ); // 移動可能な平面の法線ベクトルを設定する // ジョイントを作成する NxJoint* pipJoint = m_pNxScene->createJoint(pipDesc); // ワールド座標系で前後左右に対して移動制限するための平面方程式を設定する pipJoint->addLimitPlane( NxVec3( 1, 0, 0 ), NxVec3( 0, 10, 40 ) + NxVec3( -5, 0, 0 ) ); pipJoint->addLimitPlane( NxVec3( -1, 0, 0 ), NxVec3( 0, 10, 40 ) + NxVec3( 5, 0, 0 ) ); pipJoint->addLimitPlane( NxVec3( 0, 0, 1 ), NxVec3( 0, 10, 40 ) + NxVec3( 0, 0, -5 ) ); pipJoint->addLimitPlane( NxVec3( 0, 0,-1 ), NxVec3( 0, 10, 40 ) + NxVec3( 0, 0, 5 ) );
ヘッダー NxPointInPlaneJointDesc.h
NxJointDesc