Ejemplo n.º 1
0
Archivo: body.py Proyecto: kralf/morsel
 def show(self, cameraMask = None):
   mesh = self.mesh
   
   if mesh:
     mesh.color = [0, 1, 0, 0.5]
     mesh.setTextureOff(1)
     mesh.setTransparency(panda.TransparencyAttrib.MAlpha)
   
   if cameraMask != None:
     Geometry.show(self, cameraMask)
   else:
     Geometry.show(self)
Ejemplo n.º 2
0
  def fit(self, node):
    Geometry.fit(self, node)
    
    d_min = min(self.scale)

    if d_min == self.scale[0]:
      self.rotate([0, 90, 0])
      self.scale = [self.scale[2], self.scale[1], 1]
    elif d_min == self.scale[1]:
      self.rotate([0, 0, 90])
      self.scale = [self.scale[0], self.scale[2], 1]
    else:
      self.scale = [self.scale[0], self.scale[1], 1]
Ejemplo n.º 3
0
  def fit(self, node):
    Geometry.fit(self, node)
    
    d_xy = abs(self.scale[0]-self.scale[1])
    d_xz = abs(self.scale[0]-self.scale[2])
    d_yz = abs(self.scale[1]-self.scale[2])
    d_min = min(d_xy, d_xz, d_yz)

    if d_min == d_xz:
      self.rotate([0, 0, 90])
      self.scale = [self.scale[0], self.scale[2], self.scale[1]]
    elif d_min == d_yz:
      self.rotate([0, 90, 0])
      self.scale = [self.scale[2], self.scale[1], self.scale[0]]

    radius = 0.5*max(self.scale[0], self.scale[1])
    self.scale = [2*radius, 2*radius, self.scale[2]]
    
Ejemplo n.º 4
0
Archivo: ray.py Proyecto: kralf/morsel
    def fit(self, node):
        Geometry.fit(self, node)

        d_xy = abs(self.scale[0] - self.scale[1])
        d_xz = abs(self.scale[0] - self.scale[2])
        d_yz = abs(self.scale[1] - self.scale[2])
        d_min = min(d_xy, d_xz, d_yz)

        if d_min == d_xz:
            self.y += 0.5 * self.scale[1]
            self.rotate([0, 0, 90])
            self.scale = [0, 0, self.scale[1]]
        elif d_min == d_yz:
            self.x += 0.5 * self.scale[0]
            self.rotate([0, 90, 0])
            self.scale = [0, 0, self.scale[0]]
        else:
            self.z += 0.5 * self.scale[2]
            self.scale = [0, 0, self.scale[2]]
Ejemplo n.º 5
0
 def fit(self, node):
   Geometry.fit(self, node)
   
   self.scale = max(self.scale)