Bladeren bron

*** empty log message ***

Jesse Schell 24 jaren geleden
bovenliggende
commit
7c3757e181
1 gewijzigde bestanden met toevoegingen van 24 en 0 verwijderingen
  1. 24 0
      direct/src/interval/LerpInterval.py

+ 24 - 0
direct/src/interval/LerpInterval.py

@@ -58,6 +58,9 @@ class LerpPosInterval(LerpInterval):
 	def functorFunc(node=node, pos=pos, startPos=startPos,
 	def functorFunc(node=node, pos=pos, startPos=startPos,
 			other=other):
 			other=other):
 	    assert(not node.isEmpty())
 	    assert(not node.isEmpty())
+            if callable(pos):
+                # This may be a thunk that returns a point.
+                pos = pos()
             if (other != None):
             if (other != None):
             	# lerp wrt other
             	# lerp wrt other
 	    	if (startPos == None):
 	    	if (startPos == None):
@@ -87,6 +90,9 @@ class LerpHprInterval(LerpInterval):
 	def functorFunc(node=node, hpr=hpr, startHpr=startHpr,
 	def functorFunc(node=node, hpr=hpr, startHpr=startHpr,
 			other=other):
 			other=other):
 	    assert(not node.isEmpty())
 	    assert(not node.isEmpty())
+            if callable(hpr):
+                # This may be a thunk that returns a point.
+                hpr = hpr()
             if (other != None):
             if (other != None):
             	# lerp wrt other
             	# lerp wrt other
 	    	if (startHpr == None):
 	    	if (startHpr == None):
@@ -117,6 +123,9 @@ class LerpScaleInterval(LerpInterval):
 	def functorFunc(node=node, scale=scale,
 	def functorFunc(node=node, scale=scale,
                         startScale=startScale, other=other):
                         startScale=startScale, other=other):
 	    assert(not node.isEmpty())
 	    assert(not node.isEmpty())
+            if callable(scale):
+                # This may be a thunk that returns a point.
+                scale = scale()
             if (other != None):
             if (other != None):
             	# lerp wrt other
             	# lerp wrt other
 	    	if (startScale == None):
 	    	if (startScale == None):
@@ -148,6 +157,12 @@ class LerpPosHprInterval(LerpInterval):
 	def functorFunc(node=node, pos=pos, hpr=hpr, 
 	def functorFunc(node=node, pos=pos, hpr=hpr, 
 			startPos=startPos, startHpr=startHpr, other=other):
 			startPos=startPos, startHpr=startHpr, other=other):
 	    assert(not node.isEmpty())
 	    assert(not node.isEmpty())
+            if callable(pos):
+                # This may be a thunk that returns a point.
+                pos = pos()
+            if callable(hpr):
+                # This may be a thunk that returns a point.
+                hpr = hpr()
             if (other != None):
             if (other != None):
             	# lerp wrt other
             	# lerp wrt other
 	    	if (startPos == None):
 	    	if (startPos == None):
@@ -189,6 +204,15 @@ class LerpPosHprScaleInterval(LerpInterval):
 			startPos=startPos, startHpr=startHpr,
 			startPos=startPos, startHpr=startHpr,
                         startScale=startScale, other=other):
                         startScale=startScale, other=other):
 	    assert(not node.isEmpty())
 	    assert(not node.isEmpty())
+            if callable(pos):
+                # This may be a thunk that returns a point.
+                pos = pos()
+            if callable(hpr):
+                # This may be a thunk that returns a point.
+                hpr = hpr()
+            if callable(scale):
+                # This may be a thunk that returns a point.
+                scale = scale()
             if (other != None):
             if (other != None):
             	# lerp wrt other
             	# lerp wrt other
 	    	if (startPos == None):
 	    	if (startPos == None):