[英]box2d var access from diff class in iphone using c++
i have a car.h我有一辆车.h
now inside the car.hi did现在在车里。你好
float cc;
void Step(Settings* settings)
{
Test::Step(settings);
cc=m_rightWheel->GetWorldCenter().x;// cc hold wheel value i needs this in other class
}
now i want to access the value of cc in other class, so i did现在我想访问其他 class中 cc 的值,所以我做了
// in VC.h
Car car;
// in VC.m
NSLog(@"car is moving at %f",car.cc );// not working
NSLog(@"car is moving at %f",car->cc );// not working
how to get the value of cc here??如何在这里获得 cc 的值?
**cc=m_rightWheel->GetWorldCenter().x
looks weird. **cc=m_rightWheel->GetWorldCenter().x
看起来很奇怪。 Remove the **
.删除
**
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.