我在Bullet手册和Xoppa的post中已经读到,可以再次将碰撞形状用于其他对象,但是当我这样做时,它会抛出EXCEPTION_ACCESS_VIOLATION,例如
public abstract class parent {
protected static btCapsuleShape capsuleShape = new btCapsuleShape(2f, 23f);
}
public class child extends parent {
ghostObject.setCollisionShape(capsuleShape);
}
但是当我像下面这样正常工作时,它就没有EXCEPTION_ACCESS_VIOLATION
public class child extends parent {
capsuleShape = new btCapsuleShape(2f, 23f);
ghostObject.setCollisionShape(capsuleShape);
}
谢谢。