note
	description: "[
							Represent the direction that an effect come from (an not where
							it goes, be carefull). Direction is encoded by three position
							(X axis, Y axix and Z axis). 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 (0,-1,0)
							                      ^
							                      |
							                      |
							(-1,0,0) West <----[ HAPTIC ]----> East (1,0,0)
							                      |
							                      |
							                      v
							                 South (0,1,0)
							
							
							                 [ USER ]
							                   \|||/
							                   (o o)
							             ---ooO-(_)-Ooo---
	]"
	author: "Louis Marchand"
	date: "Tue, 03 Mar 2015 15:22:37 +0000"
	revision: "2.0"

class interface
	GAME_HAPTIC_CARTESIAN_DIRECTION

create {GAME_HAPTIC_EFFECT}
	make_from_other


create 
	make,
	make_with_2_axis,
	make_with_axis

feature -- Initialization

	make
			-- Initialization of Current
		ensure then
			exists: exists
			type_is_valid: type = {GAME_SDL_EXTERNAL}.sdl_haptic_cartesian
			x_axis_valid: x = 0
			y_axis_valid: y = 0
			z_axis_valid: z = 0
	
feature -- Access

	position: TUPLE [x: INTEGER_32; y: INTEGER_32; z: INTEGER_32]
			-- The coordinate of the origin of Current
		require
			exists: exists

	set_position (a_x, a_y, a_z: INTEGER_32)
			-- Assign position with the value of a_x, a_y and a_z
		require
			exists: exists
		ensure
			x_axis_valid: x = a_x
			y_axis_valid: y = a_y
			z_axis_valid: z = a_z

	x: INTEGER_32 assign set_x
			-- The horizontal coordinate of the origin of Current
		require
			exists: exists

	set_x (a_x: INTEGER_32)
			-- Assign x with the value of a_x
		require
			exists: exists
		ensure
			is_assign: x = a_x

	y: INTEGER_32 assign set_y
			-- The vertical coordinate of the origin of Current
		require
			exists: exists

	set_y (a_y: INTEGER_32)
			-- Assign y with the value of a_y
		require
			exists: exists
		ensure
			is_assign: y = a_y

	z: INTEGER_32 assign set_z
			-- The depth coordinate of the origin of Current.
			-- To use this coordinate, you need a 3 axis haptic
			-- (See: GAME_HAPTIC.axes_count)
		require
			exists: exists

	set_z (a_z: INTEGER_32)
			-- Assign z with the value of a_z
		require
			exists: exists
		ensure
			is_assign: z = a_z

	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_cartesian
	position_valid: attached position as la_position and then (la_position.x = x and la_position.y = y and la_position.z = z)

end -- class GAME_HAPTIC_CARTESIAN_DIRECTION

Generated by ISE EiffelStudio