From b73489337eaa2363992b2c64c22754d3b66a74cf Mon Sep 17 00:00:00 2001 From: jb Date: Sun, 7 Feb 2016 12:09:07 +0100 Subject: [PATCH] Physical objects can be animated --- korman/exporter/physics.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/korman/exporter/physics.py b/korman/exporter/physics.py index 69d5e89..2db134f 100644 --- a/korman/exporter/physics.py +++ b/korman/exporter/physics.py @@ -77,6 +77,14 @@ class PhysicsConverter: physical.sceneNode = self._mgr.get_scene_node(bl=bo) getattr(self, "_export_{}".format(bounds))(bo, physical) + + if self._exporter().has_coordiface(bo): + if not physical.mass: + # ...Since the object has a coordinate interface but isn't a kickable, it's likely going to be animated. In such case, + # we must warn Plasma to have the collisions follow the object's coordinates as well. + physical.mass = 1. + simIface.setProperty(plSimulationInterface.kPinned, True) + physical.setProperty(plSimulationInterface.kPinned, True) else: simIface = so.sim.object physical = simIface.physical.object