def __init__(self): self.camera=bulletdemo.camera.Camera() # bullet self.world=bulletdemo.bulletworld.BulletWorld() self.shooter=bulletdemo.bulletshooter.BulletShooter() self.createGround() self.createCubes() self.m_clock=bullet.btClock() # gldrawer self.profiler=bullet.Profiler() self.texture=bullet.Texture() # scene self.m_textureenabled=True self.m_enableshadows=True self.m_sundirection=Vector3(1,-2,1)*1000.0 self.m_debugMode=0 # self.light_ambient = numpy.array([0.2, 0.2, 0.2, 1.0], 'f') self.light_diffuse = numpy.array([1.0, 1.0, 1.0, 1.0], 'f') self.light_specular = numpy.array([1.0, 1.0, 1.0, 1.0], 'f') # light_position is NOT default value self.light_position0 = numpy.array([1.0, 10.0, 1.0, 0.0], 'f') self.light_position1 = numpy.array([-1.0, -10.0, -1.0, 0.0], 'f') self.m_active_alt=True self.m_mouseOldX=None self.m_mouseOldY=None self.w=1 self.h=1 self.m_leftDown=False self.m_middleDown=False self.m_rightDown=False self.is_initialized=False
def __init__(self): self.m_profileIterator=bullet.CProfileManager.Get_Iterator() self.m_clock=bullet.btClock() # this is the most important class self.m_dynamicsWorld=None # constraint for mouse picking self.m_pickConstraint=None; self.m_shootBoxShape=None; self.m_cameraDistance=15.0; self.m_debugMode=0; self.m_ele=20.0; self.m_azi=0; self.m_cameraPosition=(0, 0, 0); #look at self.m_cameraTargetPosition=(0, 0, 0); self.m_mouseOldX=0; self.m_mouseOldY=0; self.m_mouseButtons=0; self.m_alt_key=False self.m_ctrl_key=False self.m_shift_key=False self.m_scaleBottom=0.5; self.m_scaleFactor=2.0; self.m_cameraUp=(0, 1, 0); self.m_forwardAxis=2; self.m_zoomStepSize=0.4; self.m_glutScreenWidth=0; self.m_glutScreenHeight=0; self.m_frustumZNear=1.0; self.m_frustumZFar=10000.0; self.m_ortho=0; self.m_ShootBoxInitialSpeed=40.0; self.m_stepping=True; self.m_singleStep=False; self.m_idle=False; self.m_lastKey=0; self.m_enableshadows=False; self.m_sundirection=(1*1000, -2*1000, 1*1000) self.m_defaultContactProcessingThreshold=bullet.BT_LARGE_FLOAT; self.m_use6Dof = False; self.m_oldPickingDist = 0.0; self.m_keep=[]