From b4633e4027af7308f15e518b424c68d86cab67a7 Mon Sep 17 00:00:00 2001 From: aignacio_sf <> Date: Wed, 14 Jun 2006 23:02:32 +0000 Subject: [PATCH] Add option to use the transform relative to the specified root_node_path. --- direct/src/motiontrail/MotionTrail.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/direct/src/motiontrail/MotionTrail.py b/direct/src/motiontrail/MotionTrail.py index 0e78d2c6c3..a5346c8334 100644 --- a/direct/src/motiontrail/MotionTrail.py +++ b/direct/src/motiontrail/MotionTrail.py @@ -118,6 +118,10 @@ class MotionTrail(NodePath, DirectObject): self.acceptOnce ("clientLogout", remove_task) MotionTrail.task_added = True + + + self.relative_to_render = False + return def delete(self): @@ -226,7 +230,11 @@ class MotionTrail(NodePath, DirectObject): print "relative_matrix 222", relative_matrix.__repr__ ( ) """ - transform = Mat4 (motion_trail.getNetTransform ( ).getMat ( )) + if (motion_trail.root_node_path and (motion_trail.relative_to_render == False)): + transform = motion_trail.getMat(motion_trail.root_node_path) + else: + transform = Mat4 (motion_trail.getNetTransform ( ).getMat ( )) + if (transform != None): motion_trail.update_motion_trail (current_time, transform)