|
|
@ -65,7 +65,7 @@ class PhysicsConverter: |
|
|
|
else: |
|
|
|
else: |
|
|
|
return vertices |
|
|
|
return vertices |
|
|
|
|
|
|
|
|
|
|
|
def generate_physical(self, bo, so, name=None): |
|
|
|
def generate_physical(self, bo, so, bounds, name=None): |
|
|
|
"""Generates a physical object for the given object pair""" |
|
|
|
"""Generates a physical object for the given object pair""" |
|
|
|
if so.sim is None: |
|
|
|
if so.sim is None: |
|
|
|
if name is None: |
|
|
|
if name is None: |
|
|
@ -77,6 +77,8 @@ class PhysicsConverter: |
|
|
|
simIface.physical = physical.key |
|
|
|
simIface.physical = physical.key |
|
|
|
physical.object = so.key |
|
|
|
physical.object = so.key |
|
|
|
physical.sceneNode = self._mgr.get_scene_node(bl=bo) |
|
|
|
physical.sceneNode = self._mgr.get_scene_node(bl=bo) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getattr(self, "_export_{}".format(bounds))(bo, physical) |
|
|
|
else: |
|
|
|
else: |
|
|
|
simIface = so.sim.object |
|
|
|
simIface = so.sim.object |
|
|
|
physical = simIface.physical.object |
|
|
|
physical = simIface.physical.object |
|
|
@ -85,9 +87,6 @@ class PhysicsConverter: |
|
|
|
|
|
|
|
|
|
|
|
return (simIface, physical) |
|
|
|
return (simIface, physical) |
|
|
|
|
|
|
|
|
|
|
|
def export(self, bo, physical, bounds): |
|
|
|
|
|
|
|
getattr(self, "_export_{}".format(bounds))(bo, physical) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _export_box(self, bo, physical): |
|
|
|
def _export_box(self, bo, physical): |
|
|
|
"""Exports box bounds based on the object""" |
|
|
|
"""Exports box bounds based on the object""" |
|
|
|
physical.boundsType = plSimDefs.kBoxBounds |
|
|
|
physical.boundsType = plSimDefs.kBoxBounds |
|
|
|