Exemplo n.º 1
0
 def setLocationAndRotation(self, location, *args):
     if len(args) == 3:
         self._matrix = MathUtil.buildTransformMatrix(location, *args)
     else:
         self._matrix = MathUtil.buildTransformMatrixQ(location, *args)
     if hasattr(self, "body") and self.body is not None:
         self.body.SetMatrix(self._matrix.toList())
Exemplo n.º 2
0
 def setLocationAndRotation(self, location, *args ):
     if len(args) == 3:
         self._matrix = MathUtil.buildTransformMatrix(location, *args)
     else:
         self._matrix = MathUtil.buildTransformMatrixQ(location, *args)
     if hasattr(self, "body") and self.body is not None:
         self.body.SetMatrix( self._matrix.toList() )
Exemplo n.º 3
0
 def setLocationAndRotation(self, location, *args):
     self.location = location
     if len(args) == 3:
         self.yaw, self.pitch, self.roll = args
     else:
         self.yaw, self.pitch, self.roll = MathUtil.quaternionToEulerYawPitchRoll(*args)
     self.construction.setLocation(location, self.yaw, self.pitch, self.roll)
     self._matrix = MathUtil.buildTransformMatrix(self.location, self.yaw, self.pitch, self.roll)
Exemplo n.º 4
0
 def draw(self):
     #find camera's transform matrix
     m = MathUtil.buildTransformMatrix(self.ent.headLocation,
                                       self.ent.yaw + math.pi,
                                       self.ent.pitch, self.ent.roll)
     glPushMatrix()
     glMultMatrixf(m.toList())
     Graphics.drawPyramid(30, 10, 100.0)
     Graphics.drawWirePyramid(30, 10, 100.0)
     glPopMatrix()
Exemplo n.º 5
0
 def setLocationAndRotation(self, location, *args):
     self.location = location
     if len(args) == 3:
         self.yaw, self.pitch, self.roll = args
     else:
         self.yaw, self.pitch, self.roll = MathUtil.quaternionToEulerYawPitchRoll(
             *args)
     self.construction.setLocation(location, self.yaw, self.pitch,
                                   self.roll)
     self._matrix = MathUtil.buildTransformMatrix(self.location, self.yaw,
                                                  self.pitch, self.roll)
Exemplo n.º 6
0
	def draw(self):
		#find camera's transform matrix
		m = MathUtil.buildTransformMatrix(self.ent.headLocation,
										  self.ent.yaw + math.pi,
										  self.ent.pitch,
										  self.ent.roll)
		glPushMatrix()
		glMultMatrixf( m.toList() )
		Graphics.drawPyramid(30, 10, 100.0)
		Graphics.drawWirePyramid(30, 10, 100.0)
		glPopMatrix()
Exemplo n.º 7
0
 def grab(self, thing):
     self.holding = thing
     thing.owner = self
     location = self.location + vec3(0, 9, 0)
     m = MathUtil.buildTransformMatrix(location, 0, 0, 0)
     thing.body.SetMatrix(m.toList())
     thing.body.SetVelocity(self.body.GetVelocity())
     self.slider = self.world.solver.makeSliderJoint(
         (location.x, location.y, location.z), (0, 1, 0), self.body,
         thing.body)
     self.slider.SetMinLimit(7.5)
     self.slider.SetMaxLimit(10)
Exemplo n.º 8
0
 def grab(self, thing):
     self.holding = thing
     thing.owner = self
     location = self.location + vec3(0, 9, 0)
     m = MathUtil.buildTransformMatrix(location, 0, 0, 0)
     thing.body.SetMatrix(m.toList())
     thing.body.SetVelocity(self.body.GetVelocity())
     self.slider = self.world.solver.makeSliderJoint(
         (location.x, location.y, location.z), (0, 1, 0), self.body, thing.body
     )
     self.slider.SetMinLimit(7.5)
     self.slider.SetMaxLimit(10)
Exemplo n.º 9
0
 def getTransformMatrix(self):
     return MathUtil.buildTransformMatrix(self.position,
                                          self.yaw,
                                          self.pitch,
                                          self.roll)
Exemplo n.º 10
0
 def setLocation(self, location, yaw, pitch, roll):
     self.location = location
     self.matrix = MathUtil.buildTransformMatrix(self.location, yaw, pitch, roll)
     self.body.SetMatrix( self.matrix.toList() )
Exemplo n.º 11
0
 def setLocation(self, location):
     self.location = location
     self.matrix = MathUtil.buildTransformMatrix(self.location, 0, 0, 0)
     self.body.SetMatrix( self.matrix.toList() )
Exemplo n.º 12
0
 def setLocation(self, location, yaw, pitch, roll):
     self.location = location
     self.matrix = MathUtil.buildTransformMatrix(self.location, yaw, pitch,
                                                 roll)
     self.body.SetMatrix(self.matrix.toList())
Exemplo n.º 13
0
 def setLocation(self, location):
     self.location = location
     self.matrix = MathUtil.buildTransformMatrix(self.location, 0, 0, 0)
     self.body.SetMatrix(self.matrix.toList())
Exemplo n.º 14
0
 def transformedTo(self, position, yaw, pitch, roll):
     m = MathUtil.buildTransformMatrix(position, yaw, pitch, roll)
     return self.transformedBy(m)
Exemplo n.º 15
0
 def getTransformMatrix(self):
     return MathUtil.buildTransformMatrix(self.position, self.yaw,
                                          self.pitch, self.roll)
Exemplo n.º 16
0
 def setGraphicsTransform(self):
     GraphicsCard.multMatrix(MathUtil.buildTransformMatrix(self.location, self.yaw, 0, 0).toList())
Exemplo n.º 17
0
	def transformedTo( self, position, yaw, pitch, roll ):
		m = MathUtil.buildTransformMatrix( position, yaw, pitch, roll)
		return self.transformedBy( m )
Exemplo n.º 18
0
 def setGraphicsTransform(self):
     GraphicsCard.multMatrix(
         MathUtil.buildTransformMatrix(self.location, self.yaw, 0,
                                       0).toList())