mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
*** empty log message ***
This commit is contained in:
parent
6eaeb5acdc
commit
d30b3b43ac
@ -22,6 +22,9 @@ class Forces(DirectObject):
|
||||
|
||||
def addForce(self, force):
|
||||
"""addForce(self, force)"""
|
||||
if (force.isLinear() == 0):
|
||||
# Physics manager will need an angular integrator
|
||||
base.addAngularIntegrator()
|
||||
self.node.addForce(force)
|
||||
|
||||
def removeForce(self, force):
|
||||
|
@ -13,6 +13,7 @@ import EventManager
|
||||
import math
|
||||
import sys
|
||||
import LinearEulerIntegrator
|
||||
import AngularEulerIntegrator
|
||||
import ClockObject
|
||||
|
||||
globalClock = ClockObject.ClockObject.getGlobalClock()
|
||||
@ -117,9 +118,10 @@ class ShowBase:
|
||||
|
||||
# Physics manager
|
||||
self.physicsMgr = physicsMgr
|
||||
self.integrator = LinearEulerIntegrator.LinearEulerIntegrator()
|
||||
self.physicsMgr.attachLinearIntegrator(self.integrator)
|
||||
integrator = LinearEulerIntegrator.LinearEulerIntegrator()
|
||||
self.physicsMgr.attachLinearIntegrator(integrator)
|
||||
self.physicsMgrEnabled = 0
|
||||
self.physicsMgrAngular = 0
|
||||
|
||||
self.createAudioManager()
|
||||
self.createRootPanel()
|
||||
@ -127,6 +129,13 @@ class ShowBase:
|
||||
|
||||
self.restart()
|
||||
|
||||
def addAngularIntegrator(self):
|
||||
"""addAngularIntegrator(self)"""
|
||||
if (self.physicsMgrAngular == 0):
|
||||
self.physicsMgrAngular = 1
|
||||
integrator = AngularEulerIntegrator.AngularEulerIntegrator()
|
||||
self.physicsMgr.attachAngularIntegrator(integrator)
|
||||
|
||||
def enableParticles(self):
|
||||
"""enableParticles(self)"""
|
||||
self.particleMgrEnabled = 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user