Fortraneries/BloubWorld/bloubspace.f90

55 lines
1.2 KiB
Fortran
Raw Normal View History

2022-02-07 09:45:08 +11:00
!
! fonctions de base de gestion des bloubs
!
module bloubspace
implicit none
! ----------------------------------------------------------------
type t_bloubs
character(8) :: nick
logical :: alive
integer :: num
real :: px, py, pz
real :: vx, vy, vz
real :: radius
integer :: seq
end type t_bloubs
contains ! -----------------------------------------
subroutine random_pv (blb)
type(t_bloubs), intent (inout) :: blb
blb%px = rand() - 0.50
blb%py = rand() * 0.25
blb%pz = rand() - 0.50
blb%vx = (rand() - 0.5) / 5.000
blb%vy = (rand() - 0.5) / 5.000
blb%vz = (rand() - 0.5) / 5.000
end subroutine
! ----------------------------------------------------------------
subroutine move_bloub (blb, coef)
type(t_bloubs), intent (inout) :: blb
real, intent (in) :: coef
blb%px = blb%px + (blb%vx * coef)
blb%py = blb%py + (blb%vy * coef)
blb%pz = blb%pz + (blb%vz * coef)
blb%seq = blb%seq + 1
end subroutine
! ----------------------------------------------------------------
end module