0.0.5 • Published 9 years ago

steering v0.0.5

Weekly downloads
2
License
MIT
Repository
-
Last release
9 years ago

2D vector based steering behaviors. Based on Craig Reynolds' Steering Behaviors For Autonomous Characters.

#Install

npm install steering

#Usage Steering uses the vectors library as a dependency. This means that it expects two element javascript arrays passed in as arguments.

##Seek

var seek = require('steering').seek;
var force = seek(target, position, current_velocity, max_velocity, slowing_radius);

##Flee

var flee = require('steering').flee;
var force = flee(target, position, current_velocity, max_velocity);

##Wander

var flee = require('steering').wander;
var force = wander(current_velocity, wander_distance, wander_radius, wander_angle, angle_change);

##Evade

var flee = require('steering').evade;
var force = evade(target, position, max_velocity, current_velocity, target_velocity);

##Pursuit

var flee = require('steering').pursuit;
var force = pursuit(target, position, max_velocity, current_velocity, target_velocity);

##Avoidance

var flee = require('steering').avoidance;
var force = avoidance(target, position, current_velocity, max_avoid_ahead, max_velocity, avoidance_force);
0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago