code stringlengths 3 6.57k |
|---|
self.rand.float(-math.pi, math.pi) |
self.entities.append(ent) |
self.rand.choice(self.rooms, probs=self.room_probs) |
r.point_inside(pos) |
self.intersect(ent, pos, ent.radius) |
self.rand.float(-math.pi, math.pi) |
self.entities.append(ent) |
intersect(self, ent, pos, radius) |
np.array([px, 0, pz]) |
intersect_circle_segs(pos, radius, self.wall_segs) |
np.array([px, 0, pz]) |
np.linalg.norm(pos2 - pos) |
near(self, ent0, ent1=None) |
np.linalg.norm(ent0.pos - ent1.pos) |
_load_tex(self, tex_name) |
self.params.sample(self.rand, 'tex_rand') |
Texture.get(tex_name, rand) |
_gen_static_data(self) |
np.concatenate([r.wall_segs for r in self.rooms]) |
np.array([r.area for r in self.rooms], dtype=float) |
np.sum(self.room_probs) |
_gen_world(self) |
_reward(self) |
_render_static(self) |
glDeleteLists(1, 1) |
glNewList(1, GL_COMPILE) |
glLightfv(GL_LIGHT0, GL_POSITION, (GLfloat*4) |
glLightfv(GL_LIGHT0, GL_AMBIENT, (GLfloat*4) |
glLightfv(GL_LIGHT0, GL_DIFFUSE, (GLfloat*4) |
glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 180) |
glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 0) |
glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0) |
glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0) |
glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0) |
glEnable(GL_LIGHTING) |
glEnable(GL_LIGHT0) |
glShadeModel(GL_SMOOTH) |
glEnable(GL_COLOR_MATERIAL) |
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE) |
glEnable(GL_TEXTURE_2D) |
room._render() |
ent.render() |
glEndList() |
glCallList(1) |
ent.render() |
ent.draw_bound() |
self.agent.render() |
frame_buffer.resolve() |
render_top_view(self, frame_buffer=None) |
map (from above) |
self.shadow_window.switch_to() |
frame_buffer.bind() |
glClearColor(*self.sky_color, 1.0) |
glClearDepth(1.0) |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) |
glMatrixMode(GL_PROJECTION) |
glLoadIdentity() |
glMatrixMode(GL_MODELVIEW) |
glLoadIdentity() |
glLoadMatrixf((GLfloat * len(m) |
render_obs(self, frame_buffer=None) |
self.shadow_window.switch_to() |
frame_buffer.bind() |
glClearColor(*self.sky_color, 1.0) |
glClearDepth(1.0) |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) |
glMatrixMode(GL_PROJECTION) |
glLoadIdentity() |
float(frame_buffer.height) |
glMatrixMode(GL_MODELVIEW) |
glLoadIdentity() |
render_depth(self, frame_buffer=None) |
is (H,W,1) |
self.render_obs(frame_buffer) |
frame_buffer.get_depth_map(0.04, 100.0) |
get_visible_ents(self) |
len(self.entities) |
glGenQueries(num_ents, query_ids) |
self.shadow_window.switch_to() |
frame_buffer.bind() |
glClearColor(*self.sky_color, 1.0) |
glClearDepth(1.0) |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) |
glMatrixMode(GL_PROJECTION) |
glLoadIdentity() |
float(frame_buffer.height) |
glMatrixMode(GL_MODELVIEW) |
glLoadIdentity() |
glDisable(GL_TEXTURE_2D) |
room._render() |
enumerate(self.entities) |
glBeginQuery(GL_ANY_SAMPLES_PASSED, query_ids[ent_idx]) |
glColor3f(1, 0, 0) |
glEndQuery(GL_ANY_SAMPLES_PASSED) |
set() |
enumerate(self.entities) |
glGetQueryObjectuiv(query_ids[ent_idx], GL_QUERY_RESULT, visible) |
vis_objs.add(ent) |
glDeleteQueries(1, query_ids) |
frame_buffer.resolve() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.