MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / OnRender

Method OnRender

ogsr_engine/xrGame/CustomMonster.cpp:956–1049  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954void draw_visiblity_rays(CCustomMonster* self, const CObject* object, collide::rq_results& rq_storage);
955
956void CCustomMonster::OnRender()
957{
958 RCache.OnFrameEnd();
959
960 for (int i = 0; i < 1; ++i)
961 {
962 const xr_vector<CDetailPathManager::STravelPoint>& keys = !i ? movement().detail().m_key_points : movement().detail().m_key_points;
963 const xr_vector<DetailPathManager::STravelPathPoint>& path = !i ? movement().detail().path() : movement().detail().path();
964 u32 color0 = !i ? D3DCOLOR_XRGB(0, 255, 0) : D3DCOLOR_XRGB(0, 0, 255);
965 u32 color1 = !i ? D3DCOLOR_XRGB(255, 0, 0) : D3DCOLOR_XRGB(255, 255, 0);
966 u32 color2 = !i ? D3DCOLOR_XRGB(0, 0, 255) : D3DCOLOR_XRGB(0, 255, 255);
967 u32 color3 = !i ? D3DCOLOR_XRGB(255, 255, 255) : D3DCOLOR_XRGB(255, 0, 255);
968 float radius0 = !i ? .1f : .15f;
969 float radius1 = !i ? .2f : .3f;
970 {
971 for (u32 I = 1; I < path.size(); ++I)
972 {
973 const DetailPathManager::STravelPathPoint& N1 = path[I - 1];
974 Fvector P1;
975 P1.set(N1.position);
976 P1.y += 0.1f;
977 const DetailPathManager::STravelPathPoint& N2 = path[I];
978 Fvector P2;
979 P2.set(N2.position);
980 P2.y += 0.1f;
981 if (!fis_zero(P1.distance_to_sqr(P2), EPS_L))
982 Level().debug_renderer().draw_line(Fidentity, P1, P2, color0);
983 if ((path.size() - 1) == I) // песледний box?
984 Level().debug_renderer().draw_aabb(P1, radius0, radius0, radius0, color1);
985 else
986 Level().debug_renderer().draw_aabb(P1, radius0, radius0, radius0, color2);
987 }
988
989 for (u32 I = 1; I < keys.size(); ++I)
990 {
991 CDetailPathManager::STravelPoint temp;
992 temp = keys[I - 1];
993 Fvector P1;
994 P1.set(temp.position.x, ai().level_graph().vertex_plane_y(temp.vertex_id), temp.position.y);
995 P1.y += 0.1f;
996
997 temp = keys[I];
998 Fvector P2;
999 P2.set(temp.position.x, ai().level_graph().vertex_plane_y(temp.vertex_id), temp.position.y);
1000 P2.y += 0.1f;
1001
1002 if (!fis_zero(P1.distance_to_sqr(P2), EPS_L))
1003 Level().debug_renderer().draw_line(Fidentity, P1, P2, color1);
1004 Level().debug_renderer().draw_aabb(P1, radius1, radius1, radius1, color3);
1005 }
1006 }
1007 }
1008 {
1009 u32 node = movement().level_dest_vertex_id();
1010 if (node == u32(-1))
1011 node = 0;
1012
1013 Fvector P1 = ai().level_graph().vertex_position(node);

Callers

nothing calls this directly

Calls 15

fis_zeroFunction · 0.85
g_AliveFunction · 0.85
dbg_draw_frustumFunction · 0.85
VisualFunction · 0.85
XFORMFunction · 0.85
distance_to_sqrMethod · 0.80
draw_lineMethod · 0.80
draw_aabbMethod · 0.80
vertex_plane_yMethod · 0.80
level_dest_vertex_idMethod · 0.80
vertex_positionMethod · 0.80

Tested by

no test coverage detected