text stringlengths 0 234 |
|---|
procedure Rotation (actor : in out GLOBE_3D.Camera; |
gc : Game_Control.Command_set; |
gx, gy : GLOBE_3D.Real; |
unitary_change : GLOBE_3D.Real; |
deceleration : GLOBE_3D.Real; |
time_step : GLOBE_3D.Real) is |
incremental_rotation : Vector_3D := (0.0, 0.0, 0.0); |
begin |
Abstract_rotation (gc, gx, gy, |
unitary_change, deceleration, incremental_rotation, time_step, |
actor.rotation_Speed); |
actor.rotation := actor.rotation + incremental_rotation; |
if actor.compose_rotations then |
actor.World_Rotation := |
XYZ_rotation (incremental_rotation) * actor.World_Rotation; |
Re_Orthonormalize (actor.World_Rotation); |
else |
declare |
r : Vector_3D renames actor.rotation; |
-- We need to turn around the axes in this order : Y, X, Z |
begin |
actor.World_Rotation := |
XYZ_rotation (0.0, 0.0, r (2)) * -- 3) turn around the nose |
XYZ_rotation (r (0), 0.0, 0.0) * -- 2) lift or lower the head |
XYZ_rotation (0.0, r (1), 0.0); -- 1) pivotate around the feet |
Function Definition: procedure Texture_is (Self : in sprite.p_Sprite; Now : in GL.textures.Object; |
Function Body: texture_Transform_s : in GL.textures.texture_Transform; |
texture_Transform_t : in GL.textures.texture_Transform) |
is |
use GL.Textures, GL.Skins, GL.Geometry.vbo; |
the_skinned_Geometry : GL.skinned_Geometry.skinned_Geometry_t renames self.skinned_geometrys (1); |
the_Skin : p_Skin_unlit_textured_vbo := new Skin_unlit_textured_vbo' (texture => Now); |
the_Vertices : GL.geometry.GL_vertex_Array renames vbo_Geometry (the_skinned_Geometry.Geometry.all).Vertices.get; |
texture_Coords : GL.textures.p_Coordinate_2D_array := to_texture_Coordinates_xz (the_Vertices, texture_Transform_s, |
texture_Transform_t); |
begin |
the_skinned_Geometry.Skin := the_Skin.all'Access; |
the_skinned_Geometry.Veneer := the_Skin.all.new_Veneer (for_geometry => the_skinned_Geometry.Geometry.all); |
declare |
use GL.Buffer.texture_coords; |
the_Veneer : GL.skins.Veneer_unlit_textured_vbo'Class renames GL.skins.Veneer_unlit_textured_vbo'Class (the_skinned_Geometry.Veneer.all); |
begin |
the_Veneer.texture_Coordinates := to_Buffer (texture_Coords, usage => GL.STATIC_DRAW); |
Function Definition: procedure initialise |
Function Body: is |
begin |
the_vertex_Buffer := GL.Buffer.vertex.to_Buffer (object_points'Access, usage => GL.STATIC_DRAW); |
declare |
piece_Id : Piece; |
begin |
for i in reverse 1 .. nb_faces loop |
case i is |
when 178 .. 237 => piece_Id := silver_Metal; |
when 260 .. 315 => piece_Id := black_Cockpit; |
when 740 .. 779 => piece_Id := Black; |
when 860 .. 865 | |
936 .. 941 => piece_Id := black_front_Air; |
when 316 .. 391 => piece_Id := Copper; |
when 780 .. 803 => piece_Id := fire_Engine; |
when 392 => piece_Id := nose_Cone; |
when others => piece_Id := Remains; |
end case; |
indices_Count (piece_Id) := indices_Count (piece_Id) + 1; |
the_Indices (piece_Id) (positive_uInt (indices_Count (piece_Id))) := vertex_Id (object_faces (i, 1)); |
indices_Count (piece_Id) := indices_Count (piece_Id) + 1; |
the_Indices (piece_Id) (positive_uInt (indices_Count (piece_Id))) := vertex_Id (object_faces (i, 2)); |
indices_Count (piece_Id) := indices_Count (piece_Id) + 1; |
the_Indices (piece_Id) (positive_uInt (indices_Count (piece_Id))) := vertex_Id (object_faces (i, 3)); |
end loop; |
Function Definition: procedure deallocate is new ada.unchecked_Deallocation (Primitive'Class, p_Primitive); |
Function Body: begin |
destroy (Self.all); |
deallocate (Self); |
Function Definition: procedure Get_pixel is |
Function Body: begin |
case iBits is |
when 32 => -- BGRA |
Get_Byte (stream_buf, pix (pix'First + 2)); |
Get_Byte (stream_buf, pix (pix'First + 1)); |
Get_Byte (stream_buf, pix (pix'First)); |
Get_Byte (stream_buf, pix (pix'First + 3)); |
when 24 => -- BGR |
Get_Byte (stream_buf, pix (pix'First + 2)); |
Get_Byte (stream_buf, pix (pix'First + 1)); |
Get_Byte (stream_buf, pix (pix'First)); |
when 8 => -- Grey |
Get_Byte (stream_buf, pix (pix'First)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.