Esempio n. 1
0
	def OnUpdate(self, info):
		if (self._bone >= 0):
			v = VRScript.Math.Vector(Skel.getPosX(self._bone),Skel.getPosY(self._bone),Skel.getPosZ(self._bone))
			q = VRScript.Math.Quat(Skel.getQuatX(self._bone),Skel.getQuatY(self._bone),Skel.getQuatZ(self._bone),Skel.getQuatW(self._bone))
			mat = VRScript.Math.Matrix()
			#mat.preAxisAngle(90,VRScript.Math.Vector(1,0,0))
			#mat.preAxisAngle(90,VRScript.Math.Vector(1,0,0))
			mat.preQuat(q)
			mat.preTranslation(v)
			# Orient up
			mat.preAxisAngle(90,VRScript.Math.Vector(1,0,0))
			# Move
			mat.preTranslation(VRScript.Math.Vector(0,5,2))
			self.movable().setPose(mat)
			# Show the magic bone #
			if (self._bone==Magic):
				e = (VRScript.Math.Matrix().preQuat(q)).getEuler()
				print("Roll: " + str(e.x) + "\tPitch: " + str(e.y) + "\tYaw: " + str(e.z))