import math

class pyExample1(ygNode):
	def __init__(self):
		self.skyname = ''
		print 'object of class pyExample1 constructed'
	def app(self):
		if len(self.skyname) > 0:
			r = (math.sin(ygdrasil.frameTime()) + 1.0) / 2.0
			g = (math.sin(ygdrasil.frameTime()/4) + 1.0) / 2.0
			b = (math.sin(ygdrasil.frameTime()*2) + 1.0) / 2.0
			ygdrasil.sendMessage('%s.skyColor(%f %f %f)' % (self.skyname, r, g, b))
	def ping(self):
		print self.name(), 'pinged'
		print 'time=',ygdrasil.frameTime(), 'deltaTime=', ygdrasil.frameDeltaTime()
		print 'parent=',self.parentName()
		print 'numChildren=',self.numChildren(), 'child0=',self.childName(0)
		print 'global origin=',self.origin(), 'local origin=',self.origin(self.parentName())
