yuka library

Classes

AABB
Class representing an axis-aligned bounding box (AABB).
AlignmentBehavior
This steering behavior produces a force that keeps a vehicle’s heading aligned with its neighbors.
ArriveBehavior
This steering behavior produces a force that directs an agent toward a target position. Unlike {@link SeekBehavior}, it decelerates so the agent comes to a gentle halt at the target position.
AStar
Implementation of the AStar algorithm.
BFS
Implementation of Breadth-first Search.
BoundingSphere
Class representing a bounding sphere.
BVH
Class representing a bounding volume hierarchy. The current implementation represents single BVH nodes as AABBs. It accepts arbitrary branching factors and can subdivide the given geometry until a defined hierarchy depth has been reached. Besides, the hierarchy finalruction is performed top-down and the algorithm only performs splits along the cardinal axes.
BVHNode
A single node in a bounding volume hierarchy (BVH).
Cell
Class for representing a single partition in context of cell-space partitioning.
CellSpacePartitioning
This class is used for cell-space partitioning, a basic approach for implementing a spatial index. The 3D space is divided up into a number of cells. A cell contains a list of references to all the entities it contains. Compared to other spatial indices like octrees, the division of the 3D space is coarse and often not balanced but the computational overhead for calculating the index of a specific cell based on a position vector is very fast.
CohesionBehavior
This steering produces a steering force that moves a vehicle toward the center of mass of its neighbors.
CompositeGoal
Class representing a composite goal. Essentially it's a goal which consists of subgoals.
ConvexHull
Class representing a convex hull. This is an implementation of the Quickhull algorithm based on the presentation {@link http://media.steampowered.com/apps/valve/2014/DirkGregorius_ImplementingQuickHull.pdf Implementing QuickHull} by Dirk Gregorius (Valve Software) from GDC 2014. The algorithm has an average runtime complexity of O(nlog(n)), whereas in the worst case it takes O(n²).
Corridor
A corridor is a sequence of portal edges representing a walkable way within a navigation mesh. The class is able to find the shortest path through this corridor as a sequence of waypoints. It's an implementation of the so called { @link http://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html Funnel Algorithm}. Read the paper {@link https://aaai.org/Papers/AAAI/2006/AAAI06-148.pdf Efficient Triangulation-Based Pathfinding} for more detailed information.
CostTable
A lookup table representing the cost associated from traveling from one node to every other node in the navgiation mesh's graph.
DFS
Implementation of Depth-first Search.
Dijkstra
Implementation of Dijkstra's algorithm.
Edge
Base class for graph edges.
EntityManager
This class is used for managing all central objects of a game like game entities.
EvadeBehavior
This steering behavior is is almost the same as {@link PursuitBehavior} except that the agent flees from the estimated future position of the pursuer.
EventDispatcher
Other classes can inherit from this class in order to provide an event based API. Useful for controls development.
Face
FleeBehavior
This steering behavior produces a force that steers an agent away from a target position. It's the opposite of {@link SeekBehavior}.
FollowPathBehavior
This steering behavior produces a force that moves a vehicle along a series of waypoints forming a path.
FuzzyAND
Class for representing an AND operator. Can be used to construct fuzzy rules.
FuzzyCompositeTerm
Base class for representing more complex fuzzy terms based on the composite design pattern.
FuzzyFAIRLY
Hedges are special unary operators that can be employed to modify the meaning of a fuzzy set. The FAIRLY fuzzy hedge widens the membership function.
FuzzyModule
Class for representing a fuzzy module. Instances of this class are used by game entities for fuzzy inference. A fuzzy module is a collection of fuzzy variables and the rules that operate on them.
FuzzyOR
Class for representing an OR operator. Can be used to construct fuzzy rules.
FuzzyRule
Class for representing a fuzzy rule. Fuzzy rules are comprised of an antecedent and a consequent in the form: IF antecedent THEN consequent.
FuzzySet
Base class for fuzzy sets. This type of sets are defined by a membership function which can be any arbitrary shape but are typically triangular or trapezoidal. They define a gradual transition from regions completely outside the set to regions completely within the set, thereby enabling a value to have partial membership to a set.
FuzzyTerm
Base class for representing a term in a {@link FuzzyRule}.
FuzzyVariable
Class for representing a fuzzy linguistic variable (FLV). A FLV is the composition of one or more fuzzy sets to represent a concept or domain qualitatively. For example fuzzs sets "Dumb", "Average", and "Clever" are members of the fuzzy linguistic variable "IQ".
FuzzyVERY
Hedges are special unary operators that can be employed to modify the meaning of a fuzzy set. The FAIRLY fuzzy hedge widens the membership function.
GameEntity
Base class for all game entities.
Goal
Base class for representing a goal in context of Goal-driven agent design.
GoalEvaluator
Base class for representing a goal evaluator in context of Goal-driven agent design.
Graph
Class representing a sparse graph implementation based on adjacency lists. A sparse graph can be used to model many different types of graphs like navigation graphs (pathfinding), dependency graphs (e.g. technology trees) or state graphs (a representation of every possible state in a game).
GraphUtils
Class with graph helpers.
HalfEdge
Implementation of a half-edge data structure, also known as { @link https://en.wikipedia.org/wiki/Doubly_connected_edge_list Doubly connected edge list}.
HeuristicPolicyDijkstra
Class for representing a heuristic for graph search algorithms based on Dijkstra's algorithm.
HeuristicPolicyEuclid
Class for representing a heuristic for graph search algorithms based on the euclidean distance. The heuristic assumes that the node have a position property of type {@link Vector3}.
HeuristicPolicyEuclidSquared
Class for representing a heuristic for graph search algorithms based on the squared euclidean distance. The heuristic assumes that the node have a position property of type {@link Vector3}.
HeuristicPolicyManhattan
Class for representing a heuristic for graph search algorithms based on the manhattan distance. The heuristic assumes that the node have a position property of type {@link Vector3}.
InterposeBehavior
This steering behavior produces a force that moves a vehicle to the midpoint of the imaginary line connecting two other agents.
LeftSCurveFuzzySet
Class for representing a fuzzy set that has a s-shape membership function with values from highest to lowest.
LeftShoulderFuzzySet
Class for representing a fuzzy set that has a left shoulder shape. The range between the midpoint and left border point represents the same DOM.
LineSegment
Class representing a 3D line segment.
MathUtils
Class with various math helpers.
Matrix3
Class representing a 3x3 matrix. The elements of the matrix are stored in column-major order.
Matrix4
Class representing a 4x4 matrix. The elements of the matrix are stored in column-major order.
MemoryRecord
Class for representing the memory information about a single game entity.
MemorySystem
Class for representing the memory system of a game entity. It is used for managing, filtering, and remembering sensory input.
MeshGeometry
Class for representing a polygon mesh. The faces consist of triangles.
MessageDispatcher
This class is the core of the messaging system for game entities and used by the { @link EntityManager}. The implementation can directly dispatch messages or use a delayed delivery for deferred communication. This can be useful if a game entity wants to inform itself about a particular event in the future.
MovingEntity
Class representing moving game entities.
Class for representing navigation edges.
Implementation of a navigation mesh. A navigation mesh is a network of convex polygons which define the walkable areas of a game environment. A convex polygon allows unobstructed travel from any point in the polygon to any other. This is useful because it enables the navigation mesh to be represented using a graph where each node represents a convex polygon and their respective edges represent the neighborly relations to other polygons. More compact navigation graphs lead to faster graph search execution.
Class for loading navigation meshes as glTF assets. The loader supports glTF and glb files, embedded buffers, index and non-indexed geometries. Interleaved geometry data are not yet supported.
Class for representing navigation nodes.
Node
Base class for graph nodes.
NormalDistFuzzySet
Class for representing a fuzzy set that has a normal distribution shape. It can be defined by the mean and standard deviation.
OBB
Class representing an oriented bounding box (OBB). Similar to an AABB, it's a rectangular block but with an arbitrary orientation. When using {@link OBB#fromPoints}, the implementation tries to provide a tight-fitting oriented bounding box. In many cases, the result is better than an AABB or bounding sphere but worse than a convex hull. However, it's more efficient to work with OBBs compared to convex hulls. In general, OBB's are a good compromise between performance and tightness.
ObstacleAvoidanceBehavior
This steering behavior produces a force so a vehicle avoids obstacles lying in its path.
OffsetPursuitBehavior
This steering behavior produces a force that keeps a vehicle at a specified offset from a leader vehicle. Useful for creating formations.
OnPathBehavior
This steering behavior produces a force that keeps a vehicle close to its path. It is intended to use it in combination with {@link FollowPathBehavior} in order to realize a more strict path following.
Parser
Path
Class for representing a walkable path.
Plane
Class representing a plane in 3D space. The plane is specified in Hessian normal form.
Polygon
Class for representing a planar polygon with an arbitrary amount of edges.
Polyhedron
Base class for polyhedra. It is primarily designed for the internal usage in Yuka. Objects of this class are always build up from faces. The edges, vertices and the polyhedron's centroid have to be derived from a valid face definition with the respective methods.
PriorityQueue
Class for representing a binary heap priority queue that enables more efficient sorting of arrays. The implementation is based on { @link https://github.com/mourner/tinyqueue tinyqueue}.
PursuitBehavior
This steering behavior is useful when an agent is required to intercept a moving agent.
Quaternion
Class representing a quaternion.
Ray
Class representing a ray in 3D space.
RectangularTriggerRegion
Class for representing a rectangular trigger region as an AABB.
Regulator
Not all components of an AI system need to be updated in each simulation step. This class can be used to control the update process by defining how many updates should be executed per second.
RightSCurveFuzzySet
Class for representing a fuzzy set that has a s-shape membership function with values from lowest to highest.
RightShoulderFuzzySet
Class for representing a fuzzy set that has a right shoulder shape. The range between the midpoint and right border point represents the same DOM.
SAT
Implementation of the separating axis theorem (SAT). Used to detect intersections between convex polyhedra. The code is based on the presentation {@link http://twvideo01.ubm-us.net/o1/vault/gdc2013/slides/822403Gregorius_Dirk_TheSeparatingAxisTest.pdf The Separating Axis Test between convex polyhedra} by Dirk Gregorius (Valve Software) from GDC 2013.
SeekBehavior
This steering behavior produces a force that directs an agent toward a target position.
SeparationBehavior
This steering produces a force that steers a vehicle away from those in its neighborhood region.
SingletonFuzzySet
Class for representing a fuzzy set that is a singleton. In its range, the degree of membership is always one.
Smoother
This class can be used to smooth the result of a vector calculation. One use case is the smoothing of the velocity vector of game entities in order to avoid a shaky movements due to conflicting forces.
SphericalTriggerRegion
Class for representing a spherical trigger region as a bounding sphere.
State
Base class for representing a state in context of State-driven agent design.
StateMachine
Finite state machine (FSM) for implementing State-driven agent design.
SteeringBehavior
Base class for all concrete steering behaviors. They produce a force that describes where an agent should move and how fast it should travel to get there.
SteeringManager
This class is responsible for managing the steering of a single vehicle. The steering manager can manage multiple steering behaviors and combine their produced force into a single one used by the vehicle.
Task
TaskQueue
This class is used for task management. Tasks are processed in an asynchronous way when there is idle time within a single simulation step or after a defined amount of time (deadline). The class is a wrapper around {@link https://w3.org/TR/requestidlecallback|requestidlecallback()}, a JavaScript API for cooperative scheduling of background tasks.
Telegram
Class for representing a telegram, an envelope which contains a message and certain metadata like sender and receiver. Part of the messaging system for game entities.
Think
Class for representing the brain of a game entity.
Time
Class for representing a timer.
TriangularFuzzySet
Class for representing a fuzzy set that has a triangular shape. It can be defined by a left point, a midpoint (peak) and a right point.
Trigger
Base class for representing triggers. A trigger generates an action if a game entity touches its trigger region, a predefine area in 3D space.
TriggerRegion
Base class for representing trigger regions. It's a predefine region in 3D space, owned by one or more triggers. The shape of the trigger can be arbitrary.
Vector3
Class representing a 3D vector.
Vehicle
This type of game entity implements a special type of locomotion, the so called Vehicle Model. The class uses basic physical metrics in order to implement a realistic movement.
Vertex
VertexList
Vision
Class for representing the vision component of a game entity.
WanderBehavior
This steering behavior produces a steering force that will give the impression of a random walk through the agent’s environment. The behavior only produces a 2D force (XZ).
YukaConsole

Extensions

MapReverseLookup on Map<K, V>

Properties

currentLevel LoggerLevel
getter/setter pair
desiredVelocity Vector3
final
yukaConsole YukaConsole
getter/setter pair