Add option to use the transform relative to the specified root_node_path.

This commit is contained in:
aignacio_sf 2006-06-14 23:02:32 +00:00
parent 7513f0c265
commit b4633e4027
1 changed files with 9 additions and 1 deletions

View File

@ -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)