note
	description: "[
							Represent the direction that an effect come from (an not where
							it goes, be carefull). Direction is encoded by two rotation
							(the azimuth and inclination). Cardinal directions
							of the haptic device are relative to the positioning of the device. 
							North is considered to be away from the user, south is toward the user, 
							east is right, and west is left of the user:
		
							               .--.
							               |__| .-------.
							               |=.| |.-----.|
							               |--| ||     ||
							               |  | |'-----'|
							               |__|~')_____('
							                [ COMPUTER ]
							
							
							                 North (27000)
							                      ^
							                      |
							                      |
							(18000) West <----[ HAPTIC ]----> East (0)
							                      |
							                      |
							                      v
							                 South (9000)
							
							
							                 [ USER ]
							                   \|||/
							                   (o o)
							             ---ooO-(_)-Ooo---
	]"
	author: "Louis Marchand"
	date: "Tue, 03 Mar 2015 15:22:37 +0000"
	revision: "2.0"

class interface
	GAME_HAPTIC_SPHERICAL_DIRECTION

create {GAME_HAPTIC_EFFECT}
	make_from_other


create 
	make,
	make_with_azimuth,
	make_with_azimuth_and_inclination

feature -- Initialization

	make
			-- Initialization of Current
		ensure then
			exists: exists
			type_is_valid: type = {GAME_SDL_EXTERNAL}.sdl_haptic_spherical
			azimuth_valid: azimuth = 0
			inclination_valid: inclination = 0
	
feature -- Access

	azimuth: INTEGER_32 assign set_azimuth
			-- The azimuth angle in spherical coordinate (encoded by hundredths of a degree
			-- starting east and rotating toward South).
		require
			exists: exists

	set_azimuth (a_azimuth: INTEGER_32)
			-- Assign azimuth with the value of a_azimuth
		require
			exists: exists
		ensure
			is_assign: azimuth = a_azimuth

	inclination: INTEGER_32 assign set_inclination
			-- The inclination angle in spherical coordinate (encoded by hundredths of a degree
			-- rotating toward the bottom of the haptic).
			-- To use this angle, you need a 3 axis haptic
			-- (See: GAME_HAPTIC.axes_count)
		require
			exists: exists

	set_inclination (a_inclination: INTEGER_32)
			-- Assign inclination with the value of a_inclination
		require
			exists: exists
		ensure
			is_assign: inclination = a_inclination

	is_values_equal (a_other: GAME_HAPTIC_DIRECTION): BOOLEAN
			-- Are the important values inside Current are equvalent
	
invariant
	type_valid: type = {GAME_SDL_EXTERNAL}.sdl_haptic_spherical

end -- class GAME_HAPTIC_SPHERICAL_DIRECTION

Generated by ISE EiffelStudio