def __init__(self, width=None, height=None): NodeComponent.__init__(self) if width is None: width = Settings.get('DisplaySettings','resolution')[0] if height is None: height = Settings.get('DisplaySettings','resolution')[1] self._width = width self._height = height self._near_dist = 1.0 self._near_width = 0.0 self._near_height = 0.0 self._far_dist = 1000.0 self._far_width = 0.0 self._far_height = 0.0 self._aspect = self._width / float(self._height) #self._fov = 75.0 self._fov = 60.0 self._frustum_planes = [] # Build Near/Far Planes self._calc_near_far() # Internal Stats self._num_inside = 0 self._num_outside = 0 self._num_intersect = 0 # Debug self._update_frustum = True if Settings.has_option('RenderSettings','update_frustum'): self._update_frustum = Settings.get('RenderSettings','update_frustum') else: Settings.set('RenderSettings','update_frustum', self._update_frustum) self._top = None self._bottom = None self._left = None self._right = None self._verts = [] self._gizmos = None self._projection_matrix = None
def __init__(self, ambient=None, diffuse=None, specular=None, attenuation=None): NodeComponent.__init__(self) if not ambient: ambient = Colour(0.2, 0.2, 0.2, 1.0) if not diffuse: diffuse = Colour(0.8, 0.8, 0.8, 1.0) if not specular: specular = Colour(0.5, 0.5, 0.5, 1.0) if not attenuation: # For now only linear attenuation is supported until i figure out a vec4 class attenuation = 0.5 self._ambient = ambient self._diffuse = diffuse self._specular = specular self._attenuation = attenuation
def __init__(self, mesh=None, material=None): NodeComponent.__init__(self) self._mesh = mesh self._material = material self._visible = True self._culled = False