def setShadowNode(self, pos):
		self.shadowVertices = []
		if pos is None: return
		
		trans = v.diff(pos, self.node.getPosition())
		for q in self.boundingVertices:
			p = v.add(q, trans)
			self.shadowVertices.append( p )			
Пример #2
0
def setCenterInPlace(node, centerPos):
	x,y,z = centerPos
	yaw = node.getEuler()[0]
	mat = node.getMatrix()
	mat.postTrans(centerPos)
	print 'pre pos:',mat.getPosition()
	mat.preTrans([-x,-y,-z])
	
	newPos = mat.getPosition()
	print 'newPos:',newPos
	origPos = node.getPosition()
	diff = v.diff(origPos, newPos)
	print 'diff:',diff
	finalPos = v.add(origPos, diff)
	print 'finalPos:',finalPos

	node.setCenter(centerPos)
	node.setPosition(finalPos)
def projectPointOntoPlane(q, p, n):
	mag = v.dot( v.diff(q, p), n )
	magNormal = v.mult(mag, n)
	return v.diff(q, magNormal)