Package svs_simulation :: Package numdata :: Module vectors
[show private | hide private]
[frames | no frames]

Module svs_simulation.numdata.vectors

2 dimensional vectors and vector functions.

Some of the classes and functions are based on the Vector2D class outlined in Mat Buckland, 2005, Programming Game AI by Example, Wordware:Plano, see http://www.wordware.com/files/ai, and http://www.ai-junkie.com.

Author: Simon Yuill

Contact: simon@lipparosa.org

Copyright: 2005 Simon Yuill

License: GNU GPL version 2 or any later version

Classes
Vector2D Represents a vector in 2D space.

Function Summary
  insideBounds2D(point, top_left, bottom_right, left, top, right, bottom)
Returns true if the point is inside the defined region.
  isSecondInFOVOfFirst(posFirst, facingFirst, posSecond, fov)
Returns true if the target position is in the field of view of the entity positioned at posFirst facing in facingFirst.
  notInsideBounds2D(point, top_left, bottom_right, left, top, right, bottom)
Returns true if the point is NOT inside the defined region.
Vector2D pointToVector(point)
Converts point to vector.
float vec2DDistance(vector1, vector2)
Returns distance between two vectors.
float vec2DDistanceSq(vector1, vector2)
Returns distance squared between two vectors.
float vec2DLength(vector)
Returns length of vector.
float vec2DLengthSq(vector)
Returns length of vector squared.
Vector2D vec2DNormalize(vector)
Normalizes specified vector.
svs_core.numdata.geomlib.Point2D vectorToPoint(vector)
Converts vector to point.

Function Details

insideBounds2D(point, top_left=None, bottom_right=None, left=None, top=None, right=None, bottom=None)

Returns true if the point is inside the defined region.

The region can either be defined by two points or vectors, or by four coordinates.

isSecondInFOVOfFirst(posFirst, facingFirst, posSecond, fov)

Returns true if the target position is in the field of view of the entity positioned at posFirst facing in facingFirst.

@type posFirst:Vector2D @type facingFirst:Vector2D @type posSecond:Vector2D @type fov:float

notInsideBounds2D(point, top_left=None, bottom_right=None, left=None, top=None, right=None, bottom=None)

Returns true if the point is NOT inside the defined region.

The region can either be defined by two points or vectors, or by four coordinates.

pointToVector(point)

Converts point to vector.
Parameters:
point
           (type=svs_core.numdata.geomlib.Point2D)
Returns:
Vector2D

vec2DDistance(vector1, vector2)

Returns distance between two vectors.
Parameters:
vector1
           (type=Vector2D)
vector2
           (type=Vector2D)
Returns:
float

vec2DDistanceSq(vector1, vector2)

Returns distance squared between two vectors.
Parameters:
vector1
           (type=Vector2D)
vector2
           (type=Vector2D)
Returns:
float

vec2DLength(vector)

Returns length of vector.
Parameters:
vector
           (type=Vector2D)
Returns:
float

vec2DLengthSq(vector)

Returns length of vector squared.
Parameters:
vector
           (type=Vector2D)
Returns:
float

vec2DNormalize(vector)

Normalizes specified vector.
Parameters:
vector
           (type=Vector2D)
Returns:
Vector2D

vectorToPoint(vector)

Converts vector to point.
Parameters:
vector
           (type=Vector2D)
Returns:
svs_core.numdata.geomlib.Point2D

Generated by Epydoc 2.1 on Thu Oct 20 15:30:28 2005 http://epydoc.sf.net