UNPKG

bird-oid

Version:

A 3D boid system with accompanying emergent behaviors. Implementation mostly based on Craig Reynolds paper Steering Behaviors For Autonomous Characters.

47 lines (46 loc) 1.77 kB
export type Radians = number; export type BehaviorObject = { fn: Function; enabled: boolean; scale: number; options: any; }; export type ApplyBehaviorObject = { boids: Boid[]; maxSpeed: number; maxForce?: number; center: import("gl-matrix").vec3; bounds: import("gl-matrix").vec3; }; export type BehaviorOptions = { position: import("gl-matrix").vec3; velocity: import("gl-matrix").vec3; maxSpeed: number; }; export type BasicBehaviorOptions = BehaviorOptions; export type ExtendedBasicBehaviorOptions = BasicBehaviorOptions; export type BasicWithRadiusBehaviorOptions = BasicBehaviorOptions; export type ObstacleBehaviorOptions = BehaviorOptions; export type WanderBehaviorOptions = { velocity: import("gl-matrix").vec3; distance: number; maxSpeed: number; radius: number; theta: Radians; phi: Radians; }; export type FollowPathBehaviorOptions = BehaviorOptions; export type FollowFlowFieldSimpleBehaviorOptions = BehaviorOptions; export type FollowFlowFieldBehaviorOptions = FollowFlowFieldSimpleBehaviorOptions; export type FollowLeaderSimpleBehaviorOptions = BehaviorOptions; export type FollowLeaderBehaviorOptions = FollowLeaderSimpleBehaviorOptions; export type GroupsBehaviorOptions = BehaviorOptions; export type ConstraintBehaviorOptions = BehaviorOptions; export type BoundsConstraintBehaviorOptions = ConstraintBehaviorOptions; export type SphereConstraintBehaviorOptions = ConstraintBehaviorOptions; export type WrapConstraintBehaviorOptions = { position: import("gl-matrix").vec3; center: import("gl-matrix").vec3; }; export type BoundsWrapConstraintBehaviorOptions = WrapConstraintBehaviorOptions; export type SphereWrapConstraintBehaviorOptions = WrapConstraintBehaviorOptions;