def fit(self, node): Solid.fit(self, node) mesh = _Mesh(position = self.globalPosition, orientation = self.globalOrientation) mesh.copyFrom(node.mesh, flatten = True) data = panda.OdeTriMeshData(mesh) mesh.detachNode() self.geometry = panda.OdeTriMeshGeom(node.world.space, data)
def getMesh(self): if not self._mesh and self.object: self._mesh = _Mesh(parent = self) self._mesh.copyFrom(self.object.mesh.model, flatten = True) return self._mesh