core.field
Class Vec2UnitField

java.lang.Object
  extended bycore.field.Vec2Field
      extended bycore.field.Vec2UnitField

public class Vec2UnitField
extends Vec2Field

Normalized 2-D vector field. Vec2UnitField is a subclass of Vec2Field and transforms a given Vec2Field so that the magnitude at every point in the field is one, but the direction is the same.


Field Summary
private  Vec2Field field
           
 
Constructor Summary
Vec2UnitField(Vec2Field field)
          Constructs a new Vec2UnitField that is the same as 'field' but with all the vector values normalize to unit magnitude.
 
Method Summary
 Vec2 get(Vec2 p, Vec2 f)
          Sets 'f' to the value of the field at 'p', scaled to unit magnitude.
 
Methods inherited from class core.field.Vec2Field
get
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

field

private Vec2Field field
Constructor Detail

Vec2UnitField

public Vec2UnitField(Vec2Field field)
Constructs a new Vec2UnitField that is the same as 'field' but with all the vector values normalize to unit magnitude.

Method Detail

get

public Vec2 get(Vec2 p,
                Vec2 f)
Sets 'f' to the value of the field at 'p', scaled to unit magnitude. 'p' is not modified. Returns: resulting 'f'

Specified by:
get in class Vec2Field