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

em.goof.force

Class EM_GOOF_DIRECTIONAL_FORCE


Direct ancestors

EM_GOOF_GENERAL_FORCE

Known direct descendants

EM_GOOF_DIRECTIONAL_GRAVITY, EM_GOOF_LOCALIZED_DIRECTIONAL_FORCE

Features

Invariants

indexing

description

An EM_GOOF_FORCE that pulls in a specified 'force_direction' witch is
the same for all points in the level.

date

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

revision

$Revision: 1.5 $

deferred class

EM_GOOF_DIRECTIONAL_FORCE

inherit

EM_GOOF_GENERAL_FORCE

feature {EM_GOOF_FORCE, EM_GOOF_PHYSICS} -- Properties

force_direction: EM_VECTOR_2D

-- Direction in with the directional force pulls

set_force_direction (a_force_direction: EM_VECTOR_2D)

-- Set force direction

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} -- 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 force equasion (mass in case of gravity)

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

invariant

force_direction_not_void: force_direction /= void

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

end