포인터 관련 문제가 있습니다.포인터가 함수 헤더로 전달됩니다.
나는 다음 헤더와 기능이 있습니다
addActor (NxuPhysicsCollection &c, NxActor &a, const char *userProperties=0, const char *actorId=0)
을 그리고는 다음과 같이 사용하는 것을 시도하고있다 :
NXU::NxuPhysicsCollection* collection = new NXU::NxuPhysicsCollection();
NxActor* actor = *actors++;
NXU::addActor(collection, actor, NULL, NULL);
그러나 나는 다음과 같은 오류 얻을 :
을A reference of type "NXU::NxuPhysicsCollection&" (not const-qualified) cannot be initialised with a value of type "NXU::NxuPhysicsCollection*" (this is for the collection parameter, same error appears for actor as well)
제대로 작동하려면 컬렉션 및 액터 매개 변수를 함수에 전달해야합니다.
나는이 시도 :NXU::addActor(&collection, &actor, NULL, NULL);
을하지만 그 중 하나 doesn''t는 일, 그것은 나에게 오류가 있습니다 : 어떤 도움을 주시면 더 좋구요
"Initial value of reference to non-const must be a lvalue."
합니다.
편집 :이처럼 사용하는 경우 :
NXU::addActor((NXU::NxuPhysicsCollection&)collection, (NxActor&)actor, NULL, NULL);
그것은 더 이상 나에게 오류를 제공하지 않습니다. 이 올바른지?
내가 NXU과 NX 네임 스페이스가 폐쇄 소스 것을 언급해야하고 나는 그들이 구현하는 방법을 수정할 수 없습니다
'NXU :: addActor (& collection, & actor, NULL, NULL);'이 경우'collection'과'actor'를 어떻게 정의 했습니까? – Shark
나는 그것을 시도했지만 효과가 없었다. – user2399378