mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Simply reorders where some methods are defined
This commit is contained in:
parent
13bcd723cf
commit
41fd6d4f4b
1 changed files with 14 additions and 14 deletions
|
@ -316,20 +316,6 @@ class Camera(object):
|
|||
return fc + scale * np.array([(px - pw / 2), (py - ph / 2), 0])
|
||||
|
||||
# Rendering
|
||||
def set_mobjects_as_static(self, *mobjects):
|
||||
# Create vbo's holding each mobjects shader data
|
||||
for mob in mobjects:
|
||||
info_list = mob.get_shader_info_list()
|
||||
for info in info_list:
|
||||
info["vbo"] = self.ctx.buffer(info["raw_data"])
|
||||
self.static_mobjects_to_shader_info_list[id(mob)] = info_list
|
||||
|
||||
def release_static_mobjects(self):
|
||||
for mob, info_list in self.static_mobjects_to_shader_info_list.items():
|
||||
for info in info_list:
|
||||
info["vbo"].release()
|
||||
self.static_mobjects_to_shader_info_list = {}
|
||||
|
||||
def capture(self, *mobjects, **kwargs):
|
||||
self.refresh_perspective_uniforms()
|
||||
for mobject in mobjects:
|
||||
|
@ -366,6 +352,20 @@ class Camera(object):
|
|||
if "vbo" not in shader_info:
|
||||
vbo.release()
|
||||
|
||||
def set_mobjects_as_static(self, *mobjects):
|
||||
# Create vbo's holding each mobjects shader data
|
||||
for mob in mobjects:
|
||||
info_list = mob.get_shader_info_list()
|
||||
for info in info_list:
|
||||
info["vbo"] = self.ctx.buffer(info["raw_data"])
|
||||
self.static_mobjects_to_shader_info_list[id(mob)] = info_list
|
||||
|
||||
def release_static_mobjects(self):
|
||||
for mob, info_list in self.static_mobjects_to_shader_info_list.items():
|
||||
for info in info_list:
|
||||
info["vbo"].release()
|
||||
self.static_mobjects_to_shader_info_list = {}
|
||||
|
||||
# Shaders
|
||||
def init_shaders(self):
|
||||
# Initialize with the null id going to None
|
||||
|
|
Loading…
Add table
Reference in a new issue