Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.goof.force

Class EM_GOOF_LOCALIZED_DIRECTIONAL_GRAVITY


Direct ancestors

EM_GOOF_LOCALIZED_DIRECTIONAL_FORCE

Creation

Features

Invariants

indexing

description

An EM_GOOF_LOCALIZED_DIRECTIONAL_FORCE that uses masses in the 'object_dependant_factor'
to represent localized gravity.

date

$Date: 2005/10/23 09:39:25 $

revision

$Revision: 1.4 $

class

EM_GOOF_LOCALIZED_DIRECTIONAL_GRAVITY

inherit

EM_GOOF_LOCALIZED_DIRECTIONAL_FORCE

create

makeit (a_force_direction: EM_VECTOR_2D a_effect_area: EM_GOOF_AREA)

-- Make directional force with direction

require
a_force_direction_not_void: a_force_direction /= void
a_effect_area_not_void: a_effect_area /= void

feature -- Initialization

makeit (a_force_direction: EM_VECTOR_2D a_effect_area: EM_GOOF_AREA)

-- Make directional force with direction

require
a_force_direction_not_void: a_force_direction /= void
a_effect_area_not_void: a_effect_area /= void

feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Processing

is_force_applicable (object: EM_GOOF_PHYSICABLE): BOOLEAN

-- Does the force apply to this object?

-- (From EM_GOOF_UNARY_FORCE)

require
object_not_void: object /= void
object_dependant_factor (object: EM_GOOF_PHYSICABLE): DOUBLE

-- Object dependant factor in the gravity equasion (the mass)

-- (From EM_GOOF_DIRECTIONAL_FORCE)

require
is_object: object /= void
process (objects: DS_LINKED_LIST[EM_GOOF_OBJECT])

-- Apply force to all physicables

-- (From EM_GOOF_FORCE)

require
is_objects: objects /= void
process_object (object: EM_GOOF_PHYSICABLE)

-- Apply force to this object

-- (From EM_GOOF_UNARY_FORCE)

require
object_not_void: object /= void

feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Properties

force_direction: EM_VECTOR_2D

-- Direction in with the directional force pulls

-- (From EM_GOOF_DIRECTIONAL_FORCE)

set_force_direction (a_force_direction: EM_VECTOR_2D)

-- Set force direction

-- (From EM_GOOF_DIRECTIONAL_FORCE)

require
a_force_direction_not_void: a_force_direction /= void
ensure
force_direction_set: force_direction = a_force_direction

feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- properties

effect_area: EM_GOOF_AREA

-- Area in with this force is effective

-- (From EM_GOOF_LOCALIZED_FORCE)

invariant


effect_area_not_void: effect_area /= void

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

force_direction_not_void: force_direction /= void

end