다른 클래스의 개인 정적 변수 (* PhysicsEngine :: _world -> setDebugDrawer (&; debugDraw); *)에 액세스하려고합니다.C++ 다른 클래스의 private static 변수에 액세스하는 방법
일등석 :
namespace GameEngine
{
class PhysicsEngine
{
private:
// Pointer to Bullet's World simulation
static btDynamicsWorld* _world;
2 등석 :가 0xc0000005 : 나는 나는 Bullet01.exe에서 0x00EC6910에서 처리되지 않은 예외가 _world 공개 할 경우
bool Game::initialise()
{
_device = irr::createDevice(irr::video::EDT_OPENGL,
_dimensions,
16,
false,
false,
false,
&inputHandler);
if(!_device)
{
std::cerr << "Error creating device" << std::endl;
return false;
}
_device->setWindowCaption(_caption.c_str());
//////////////
DebugDraw debugDraw(game._device);
debugDraw.setDebugMode(
btIDebugDraw::DBG_DrawWireframe |
btIDebugDraw::DBG_DrawAabb |
btIDebugDraw::DBG_DrawContactPoints |
//btIDebugDraw::DBG_DrawText |
//btIDebugDraw::DBG_DrawConstraintLimits |
btIDebugDraw::DBG_DrawConstraints //|
);
PhysicsEngine::_world->setDebugDrawer(&debugDraw);
위치를 0x00000000 읽기 액세스 위반.
을 노출? –
당신이 어떤'friend's를 필요로하는 것처럼 들린다 –
@CaptainObvlious 또는 적절한 디자인 –