Nano Brain for Unity

AUTHOR
Version v0.1

Table of Contents

Table of contents

Nano Brain for Unity

Table of Contents

Installation
Technical Documentation
Models
Animations 

Package Installation
You can import the NanoBrain Ant package in Unity directly with the Package Manager git package importer.
See Unity: Installing from a Git URL
Use the link from 'Clone with HTTP' (for example: https://git.passer.life/CreatureControl/Ant.git) In this way you can always retrieve the latest version by pressing the Update button in the Package Manager.
Optionally, you can use a tag to retrieve a specific version. For example: https://git.passer.life/CreatureControl/Ant.git#0.1.0. This will give you a stable version which does not change. Updating can be done by retrieving the package with a link to a new release.
Samples Installation
In the Unity Package manager, select the NanoBrain Ant package and look for the Samples  tab in the details pane on the right. There you can import the Models . 

Models
The package comes with a number of models which can be found in the Samples folder. These models are rigged and can be used in combination with the Animations.
Custom Models
To use custom insect models, the Insect component2  should be added to the model. Additionally, the leg bones of the insect should be configured as the package is not able to find these automatically. In most cases, only the upper leg bone (the femur) need to be configures, the lower leg (tibia) and foot (tarsus) bones are then assumed to be the descendant bones of the femur if those bones have only one child bone each. If this approach does not work, it is always possible to override the identified bones by manually replacing them by the correct bone.

1.	or any other component derived from the Insect component 

NanoBrain
 Documentation is found in the Documentation folder 

Hierarchical Index
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
LinearAlgebra.Angles	pagenum
NanoBrain.Brain	pagenum
NanoBrain.ClusterPrefab	pagenum
LinearAlgebra.Direction	pagenum
LinearAlgebra.Float	pagenum
NanoBrain.Nucleus	pagenum
NanoBrain.Cluster	pagenum
NanoBrain.Neuron	pagenum
NanoBrain.MemoryCell	pagenum

LinearAlgebra.Spherical	pagenum
LinearAlgebra.SwingTwist	pagenum
NanoBrain.Synapse	pagenum
LinearAlgebra.Vector2Float	pagenum
LinearAlgebra.Vector3Float	pagenum
LinearAlgebra.Vector3Int	pagenum

Class Index
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
LinearAlgebra.Angles (Angle utilities ) 	pagenum
NanoBrain.Brain (The NanoBrain Unity Componnent ) 	pagenum
NanoBrain.Cluster (A Cluster combines a collection of Nuclei to implement reusable behaviour ) 	pagenum
NanoBrain.ClusterPrefab (The Unity ScriptableObject to implement re-usable Cluster Prefabs ) 	pagenum
LinearAlgebra.Direction (A direction in 3D space ) 	pagenum
LinearAlgebra.Float (Float number utilities ) 	pagenum
NanoBrain.MemoryCell (A MemoryCell stored its value for one update ) 	pagenum
NanoBrain.Neuron (A neuron is a basic Nucleus ) 	pagenum
NanoBrain.Nucleus (A Nucleus is a basic element in a brain cluster ) 	pagenum
LinearAlgebra.Spherical (A spherical vector ) 	pagenum
LinearAlgebra.SwingTwist (An orientation using swing and twist angles ) 	pagenum
NanoBrain.Synapse (A Synapse connects the ouput of a Neuron to another Neuron ) 	pagenum
LinearAlgebra.Vector2Float (2-dimensional vectors ) 	pagenum
LinearAlgebra.Vector3Float (3-dimensional vectors ) 	pagenum
LinearAlgebra.Vector3Int (3-dimensional vectors ) 	pagenum

Namespace Documentation
LinearAlgebra Namespace Reference
Classes
class AnglesAngle utilities 
struct DirectionA direction in 3D space. 
class FloatFloat number utilities. 
struct SphericalA spherical vector. 
struct SwingTwistAn orientation using swing and twist angles. 
struct Vector2Float2-dimensional vectors 
struct Vector3Float3-dimensional vectors 
struct Vector3Int3-dimensional vectors 

LinearAlgebra.Test Namespace Reference
Typedefs
using Vector2 = Vector2Float
using Vector3 = Vector3Float

NanoBrain Namespace Reference

The Nanobrain namespace. 
Classes
class BrainThe NanoBrain Unity Componnent. 
class ClusterA Cluster combines a collection of Nuclei to implement reusable behaviour. 
class ClusterPrefabThe Unity ScriptableObject to implement re-usable Cluster Prefabs. 
class MemoryCellA MemoryCell stored its value for one update. 
class NeuronA neuron is a basic Nucleus. 
class NucleusA Nucleus is a basic element in a brain cluster. 
class SynapseA Synapse connects the ouput of a Neuron to another Neuron. 

Detailed Description
The Nanobrain namespace. 

Class Documentation
LinearAlgebra.Angles Class Reference

Description
Angle utilities 
Static Public Member Functions
static float Difference (float a, float b)
Determine the angle difference, result is a normalized angle. 

static float Normalize (float angle)
Normalize an angle to the range -180 < angle <= 180. 

Static Public Attributes
const float pi = 3.1415927410125732421875F

Member Function Documentation
static float LinearAlgebra.Angles.Difference (float  a, float  b)[static]

Determine the angle difference, result is a normalized angle. 

Parameters
a 	First first angle	
b 	The second angle	
Returns
the angle between the two angles
Angle values should be degrees 
static float LinearAlgebra.Angles.Normalize (float  angle)[static]

Normalize an angle to the range -180 < angle <= 180. 

Parameters
angle 	The angle to normalize	
Returns
The normalized angle in interval (-180..180] 
Angle values should be in degrees 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Angle.cs

NanoBrain.Brain Class Reference

Description
The NanoBrain Unity Componnent. 
This implements the top-level NanoBrain Cluster 

Inherits MonoBehaviour.
Static Public Member Functions
static void UpdateWeight (Cluster brain, string name, float weight)
Update the weight for all Synapses coming from the Neuron with the given name. 

Public Attributes
ClusterPrefab brainPrefab
The Cluster prefab from which the cluster is created. 

Properties
Cluster brain [get]
The cluster isntance. 

Member Function Documentation
static void NanoBrain.Brain.UpdateWeight (Cluster  brain, string  name, float  weight)[static]

Update the weight for all Synapses coming from the Neuron with the given name. 

Parameters
brain 	The cluster in which the synapses are updated	
name 	The name of the Neuron for which the weights are updated	
weight 	The new Synapse weight	

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Brain.cs

NanoBrain.Cluster Class Reference

Description
A Cluster combines a collection of Nuclei to implement reusable behaviour. 
A Cluster is an instantiation of a ClusterPrefab. Clusters can be nested inside other clusters. 
Inheritance diagram for NanoBrain.Cluster:
IMAGE
Public Types
enum Type { None, Neuron, MemoryCell, Cluster }
The types of Nucleus. 
Public Member Functions
Cluster (ClusterPrefab prefab, Cluster parent)
Instantiate a new copy of a ClusterPrefab in the given parent. 

Cluster (ClusterPrefab prefab, ClusterPrefab parent=null)
Add a new cluster to a ClusterPrefab. 

override Nucleus Clone (ClusterPrefab parent)
override Nucleus ShallowCloneTo (Cluster parent)
void AddInstance ()
void AddInstance (ClusterPrefab prefab)
void RemoveInstance ()
bool SameSiblingsAs (Cluster[] otherSiblingClusters)
void AddArrayReceiver (Nucleus receiverToAdd, float weight=1)
void RefreshComputeOrders ()
void RefreshOutputs ()
bool TryGetNucleus (string nucleusName, out Nucleus foundNucleus)
Nucleus GetNucleus (string nucleusName)
Neuron GetNeuron (string neuronName)
Neuron GetNeuron (int thingId, string neuronName, string thingName=null)
bool DeleteNucleus (Nucleus nucleus)
virtual List< Nucleus > CollectReceivers (bool removeDuplicates=false)
List<(Neuron, Nucleus)> CollectConnections ()
List< Synapse > CollectSynapsesTo (Cluster otherCluster)
void MoveReceivers (Cluster newCluster)
void UpdateFromNucleus (Nucleus startNucleus)
override void UpdateStateIsolated ()
void Refresh ()
virtual void Initialize ()
virtual void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Static Public Member Functions
static int GetNucleusIndex (List< Nucleus > nuclei, Nucleus nucleus)
static int GetNucleusIndex (List< Nucleus > nuclei, string nucleusName)
Public Attributes
ClusterPrefab prefab
Cluster[] siblingClusters
int instanceCount = 1
Dictionary< int, Cluster > thingClusters = new()
List< Nucleus > nuclei = new()
List< Nucleus > sortedNuclei
List< Nucleus > _inputs = null
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Protected Member Functions
int GetNucleusIndex (Nucleus[] nuclei, Nucleus nucleus)
Protected Attributes
List< Neuron > _outputs = null
Properties
string baseName [get]
The base name of the cluster. I don't think this is actively used at this moment. 

virtual List< Nucleus > inputs [get]
Dictionary< Nucleus, List< Nucleus > > computeOrders [get]
virtual Neuron defaultOutput [get]
List< Neuron > outputs [get]

Constructor & Destructor Documentation
NanoBrain.Cluster.Cluster (ClusterPrefab  prefab, Cluster  parent)

Instantiate a new copy of a ClusterPrefab in the given parent. 

Parameters
prefab 	The prefab to use	
parent 	The cluster in which this new cluster will be placed	
NanoBrain.Cluster.Cluster (ClusterPrefab  prefab, ClusterPrefab  parent = null)

Add a new cluster to a ClusterPrefab. 

Parameters
prefab 	The prefab to copy	
parent 	The prefab in which the new copy is placed	

Member Function Documentation
virtual void NanoBrain.Nucleus.UpdateNuclei ()[virtual], [inherited]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented in NanoBrain.MemoryCell.

Member Data Documentation
Cluster NanoBrain.Nucleus.parent[inherited]

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Cluster.cs

NanoBrain.ClusterPrefab Class Reference

Description
The Unity ScriptableObject to implement re-usable Cluster Prefabs. 

Inherits ScriptableObject.
Public Member Functions
Nucleus GetNucleus (string nucleusName)
Retrieve a nucleus in this cluster. 

void EnsureInitialization ()
void GarbageCollection ()
Public Attributes
Cluster cluster

Member Function Documentation
Nucleus NanoBrain.ClusterPrefab.GetNucleus (string  nucleusName)

Retrieve a nucleus in this cluster. 

Parameters
nucleusName 	The name of the nucleus	
Returns
The Nucleus with the given name or null if no such Nucleus could be found

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/ScriptableObjects/ClusterPrefab.cs

LinearAlgebra.Direction Struct Reference

Description
A direction in 3D space. 
A direction is represented using two angles:
The horizontal angle ranging from -180 (inclusive) to 180 (exclusive) degrees which is a rotation in the horizontal plane
A vertical angle ranging from -90 (inclusive) to 90 (exclusive) degrees which is the rotation in the up/down direction applied after the horizontal rotation has been applied. The angles are automatically normalized to stay within the abovenmentioned ranges. 

Public Member Functions
Direction (AngleFloat horizontal, AngleFloat vertical)
Create a new direction. 

override readonly string ToString ()
readonly UnityEngine.Vector3 ToVector3 ()
Convert the direction into a carthesian vector. 

readonly Vector3Float ToVector3 ()
Convert the direction into a carthesian vector. 

override readonly bool Equals (object obj)
override readonly int GetHashCode ()
Static Public Member Functions
static Direction Degrees (float horizontal, float vertical)
Create a direction using angle values in degrees. 

static Direction Radians (float horizontal, float vertical)
Create a direction using angle values in radians. 

static Direction FromVector3 (UnityEngine.Vector3 v)
Convert a carthesian vector into a direction. 

static Direction FromVector3 (Vector3Float v)
Convert a carthesian vector into a direction. 

static Direction operator- (Direction d)
static bool operator== (Direction d1, Direction d2)
Tests the equality of two directions. 

static bool operator!= (Direction d1, Direction d2)
Tests the inequality of two directions. 

static AngleFloat UnsignedAngle (Direction d1, Direction d2)
Public Attributes
AngleFloat horizontal
horizontal angle, range = (-180..180] degrees 

AngleFloat vertical
vertical angle, range in degrees = (-90..90] degrees 

Static Public Attributes
static readonly Direction forward = Degrees(0, 0)
A forward direction with zero for both angles. 

static readonly Direction backward = Degrees(-180, 0)
A backward direction with horizontal angle -180 and zero vertical angle. 

static readonly Direction up = Degrees(0, 90)
A upward direction with zero horizontal angle and vertical angle 90. 

static readonly Direction down = Degrees(0, -90)
A downward direction with zero horizontal angle and vertical angle -90. 

static readonly Direction left = Degrees(-90, 0)
A left-pointing direction with horizontal angle -90 and zero vertical angle. 

static readonly Direction right = Degrees(90, 0)
A right-pointing direction with horizontal angle 90 and zero vertical angle. 

Constructor & Destructor Documentation
LinearAlgebra.Direction.Direction (AngleFloat  horizontal, AngleFloat  vertical)

Create a new direction. 

Parameters
horizontal 	The horizontal angle	
vertical 	The vertical angle	
The direction will be normalized automatically to ensure the angles are within the allowed ranges

Member Function Documentation
static Direction LinearAlgebra.Direction.Degrees (float  horizontal, float  vertical)[static]

Create a direction using angle values in degrees. 

Parameters
horizontal 	The horizontal angle in degrees	
vertical 	The vertical angle in degrees	
Returns
The direction
The direction will be normalized automatically to ensure the angles are within the allowed ranges
static Direction LinearAlgebra.Direction.Radians (float  horizontal, float  vertical)[static]

Create a direction using angle values in radians. 

Parameters
horizontal 	The horizontal angle in radians	
vertical 	The vertical angle in radians	
Returns
The direction
readonly UnityEngine.Vector3 LinearAlgebra.Direction.ToVector3 ()

Convert the direction into a carthesian vector. 

Returns
The carthesian vector corresponding to this direction.
static Direction LinearAlgebra.Direction.FromVector3 (UnityEngine::Vector3  v)[static]

Convert a carthesian vector into a direction. 

Parameters
v 	The carthesian vector	
Returns
The direction
Information about the length of the carthesian vector is not included in this transformation
readonly Vector3Float LinearAlgebra.Direction.ToVector3 ()

Convert the direction into a carthesian vector. 

Returns
The carthesian vector corresponding to this direction.
static Direction LinearAlgebra.Direction.FromVector3 (Vector3Float  v)[static]

Convert a carthesian vector into a direction. 

Parameters
v 	The carthesian vector	
Returns
The direction
Information about the length of the carthesian vector is not included in this transformation
static bool LinearAlgebra.Direction.operator== (Direction  d1, Direction  d2)[static]

Tests the equality of two directions. 

Parameters
d1 		
d2 		
Returns
True when the direction angles are equal, false otherwise.
static bool LinearAlgebra.Direction.operator!= (Direction  d1, Direction  d2)[static]

Tests the inequality of two directions. 

Parameters
d1 		
d2 		
Returns
True when the direction angles are not equal, false otherwise.

The documentation for this struct was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Direction.cs

LinearAlgebra.Float Class Reference

Description
Float number utilities. 
Static Public Member Functions
static float Clamp (float f, float min, float max)
Clamp the value between the given minimum and maximum values. 

static float Clamp01 (float f)
Clamp the value between to the interval [0..1]. 

Static Public Attributes
const float epsilon = 1E-05f
The precision of float numbers. 

const float sqrEpsilon = 1e-10f
The square of the float number precision. 

Member Function Documentation
static float LinearAlgebra.Float.Clamp (float  f, float  min, float  max)[static]

Clamp the value between the given minimum and maximum values. 

Parameters
f 	The value to clamp	
min 	The minimum value	
max 	The maximum value	
Returns
The clamped value
static float LinearAlgebra.Float.Clamp01 (float  f)[static]

Clamp the value between to the interval [0..1]. 

Parameters
f 	The value to clamp	
Returns
The clamped value

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Float.cs

NanoBrain.MemoryCell Class Reference

Description
A MemoryCell stored its value for one update. 
When the input for a Memory Cell changes, it will output the previous value 
 
Inheritance diagram for NanoBrain.MemoryCell:
IMAGE
Public Types
enum CombinatorType { Sum, Product }
The type of combinators. 
enum ActivationType { Linear, Power, Sqrt, Reciprocal, Tanh, Binary, Normalized, Custom }
The type of. 
enum Type { None, Neuron, MemoryCell, Cluster }
The types of Nucleus. 
Public Member Functions
MemoryCell (Cluster parent, string name)
override Nucleus ShallowCloneTo (Cluster newParent)
override void UpdateStateIsolated ()
override void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Synapse AddSynapse (Neuron sendingNucleus, float weight=1)
Add a new synapse to this nuclues. 

Synapse GetSynapse (Nucleus sender)
Find a synapse. 

void RemoveSynapse (Nucleus sendingNucleus)
Remove a synapse from a Nucleus. 

virtual void SetBias (Vector3 inputValue)
Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

AnimationCurve GenerateCurve ()
void SleepCheck ()
override Nucleus Clone (ClusterPrefab prefab)
Function to clone a nucleus to a Cluster prefab.   

float3 CombinatorSum ()
Vector3 CombinatorSum ()
float3 CombinatorProduct ()
Vector3 CombinatorProduct ()
Vector3 CombinatorMax ()
virtual void AddReceiver (Nucleus receiverToAdd, float weight=1)
virtual void RemoveReceiver (Nucleus receiverToRemove)
virtual void ProcessStimulus (Vector3 inputValue)
Process an external stimulus. 

virtual void Initialize ()
Static Public Member Functions
static void Delete (Nucleus nucleus)
Public Attributes
bool staticMemory = false
Vector3 bias = Vector3.zero
Create a new Neuron in a Cluster Prefab. 

CombinatorType combinator = CombinatorType.Sum
The type of combinator used for this Neuron. 

ActivationType _curvePreset
AnimationCurve curve
float curveMax = 1.0f
Action WhenFiring
bool persistOutput = false
float lastUpdate = 0
Toggle for printing debugging trace data. 

readonly float timeToSleep = 1f
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Protected Member Functions
virtual void CloneFields (Neuron clone)
void CheckSleepingSynapses ()
float3 ActivatorLinear (float3 input)
Vector3 ActivatorLinear (Vector3 input)
float3 ActivatorSqrt (float3 input)
Vector3 ActivatorSqrt (Vector3 input)
float3 ActivatorPower (float3 input)
Vector3 ActivatorPower (Vector3 input)
float3 ActivatorReciprocal (float3 input)
Vector3 ActivatorReciprocal (Vector3 input)
float3 ActivatorTanh (float3 input)
float3 ActivatorBinary (float3 input)
float3 ActivatorNormalized (float3 input)
float3 ActivatorCustom (float3 input)
Vector3 ActivatorCustom (Vector3 input)
Protected Attributes
float3 _outputValue
Vector3 _outputValue
Properties
override bool isSleeping [get]
List< Synapse > synapses [get]
The synapses of the nucleus. 

ActivationType curvePreset [get, set]
virtual float3 outputValue [get, set]
virtual Vector3 outputValue [get, set]
float outputMagnitude [get]
float outputSqrMagnitude [get]
bool isFiring [get]
Func< float3 > Combinator [get]
Func< Vector3 > Combinator [get]
Func< float3, float3 > Activator [get]
Func< Vector3, Vector3 > Activator [get]
virtual List< Nucleus > receivers [get, set]

Member Enumeration Documentation
enum NanoBrain.Neuron.CombinatorType[inherited]

The type of combinators. 
A combinator combines the weighted values of the synapses to a single value 

Enumerator:
Sum	Add the weighted values together. 
	
Product	Multiply the weighted values. 

Member Function Documentation
override void NanoBrain.MemoryCell.UpdateNuclei ()[virtual]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented from NanoBrain.Nucleus.
Synapse NanoBrain.Neuron.AddSynapse (Neuron  sendingNucleus, float  weight = 1)[inherited]

Add a new synapse to this nuclues. 

Parameters
sendingNucleus 	The nucleus from which the signals may originate	
weight 	The weight applied to the input. Default value = 1	
Returns
The created Synapse
This will add a new input to this nucleus with the given weight. 
Synapse NanoBrain.Neuron.GetSynapse (Nucleus  sender)[inherited]

Find a synapse. 

Parameters
sender 	The sender of the input to the Synapse	
Returns
The found Synapse or null when the sender has no synapse to this nucleus.
void NanoBrain.Neuron.RemoveSynapse (Nucleus  sendingNucleus)[inherited]

Remove a synapse from a Nucleus. 

Parameters
sendingNucleus 	Remote the synapse connecting to this Nucleus	
virtual void NanoBrain.Neuron.SetBias (Vector3  inputValue)[virtual], [inherited]

Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

Parameters
inputValue 		
override Nucleus NanoBrain.Neuron.Clone (ClusterPrefab  prefab)[inherited]

Function to clone a nucleus to a Cluster prefab.   

Parameters
prefab 		
Returns

virtual void NanoBrain.Neuron.ProcessStimulus (Vector3  inputValue)[virtual], [inherited]

Process an external stimulus. 

Parameters
inputValue 	The value of the stimulus	
thingId 	The id of the thing causing the stimulus	
thingName 	The name of the thing causing the stimulus	

Member Data Documentation
Vector3 NanoBrain.Neuron.bias = Vector3.zero[inherited]

Create a new Neuron in a Cluster Prefab. 

Parameters
prefab 	The Cluster Preafb in which the new Neuron should be created	
name 	The name of the new Neuron	
The bias
The bias which a value which is always added to the combined value of the neuron It does not have a synapse and therefore no weight of source nucleus 
Cluster NanoBrain.Nucleus.parent[inherited]

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/MemoryCell.cs

NanoBrain.Neuron Class Reference

Description
A neuron is a basic Nucleus. 
Inheritance diagram for NanoBrain.Neuron:
IMAGE
Public Types
enum CombinatorType { Sum, Product }
The type of combinators. 
enum ActivationType { Linear, Power, Sqrt, Reciprocal, Tanh, Binary, Normalized, Custom }
The type of. 
enum Type { None, Neuron, MemoryCell, Cluster }
The types of Nucleus. 
Public Member Functions
Neuron (Cluster parent, string name)
Create a new Neuron in a Cluster instance. 

Synapse AddSynapse (Neuron sendingNucleus, float weight=1)
Add a new synapse to this nuclues. 

Synapse GetSynapse (Nucleus sender)
Find a synapse. 

void RemoveSynapse (Nucleus sendingNucleus)
Remove a synapse from a Nucleus. 

virtual void SetBias (Vector3 inputValue)
Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

AnimationCurve GenerateCurve ()
void SleepCheck ()
override Nucleus ShallowCloneTo (Cluster newParent)
Toggle for printing debugging trace data.   

override Nucleus Clone (ClusterPrefab prefab)
Function to clone a nucleus to a Cluster prefab.   

override void UpdateStateIsolated ()
float3 CombinatorSum ()
float3 CombinatorProduct ()
Vector3 CombinatorSum ()
Vector3 CombinatorProduct ()
Vector3 CombinatorMax ()
virtual void AddReceiver (Nucleus receiverToAdd, float weight=1)
virtual void RemoveReceiver (Nucleus receiverToRemove)
virtual void ProcessStimulus (Vector3 inputValue)
Process an external stimulus. 

virtual void Initialize ()
virtual void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Static Public Member Functions
static void Delete (Nucleus nucleus)
Public Attributes
Vector3 bias = Vector3.zero
Create a new Neuron in a Cluster Prefab. 

CombinatorType combinator = CombinatorType.Sum
The type of combinator used for this Neuron. 

ActivationType _curvePreset
AnimationCurve curve
float curveMax = 1.0f
Action WhenFiring
bool persistOutput = false
float lastUpdate = 0
Toggle for printing debugging trace data. 

readonly float timeToSleep = 1f
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Protected Member Functions
virtual void CloneFields (Neuron clone)
void CheckSleepingSynapses ()
float3 ActivatorLinear (float3 input)
float3 ActivatorSqrt (float3 input)
float3 ActivatorPower (float3 input)
float3 ActivatorReciprocal (float3 input)
float3 ActivatorTanh (float3 input)
float3 ActivatorBinary (float3 input)
float3 ActivatorNormalized (float3 input)
float3 ActivatorCustom (float3 input)
Vector3 ActivatorLinear (Vector3 input)
Vector3 ActivatorSqrt (Vector3 input)
Vector3 ActivatorPower (Vector3 input)
Vector3 ActivatorReciprocal (Vector3 input)
Vector3 ActivatorCustom (Vector3 input)
Protected Attributes
float3 _outputValue
Vector3 _outputValue
Properties
List< Synapse > synapses [get]
The synapses of the nucleus. 

ActivationType curvePreset [get, set]
virtual float3 outputValue [get, set]
float outputMagnitude [get]
float outputSqrMagnitude [get]
virtual Vector3 outputValue [get, set]
bool isFiring [get]
virtual bool isSleeping [get]
Func< float3 > Combinator [get]
Func< Vector3 > Combinator [get]
Func< float3, float3 > Activator [get]
Func< Vector3, Vector3 > Activator [get]
virtual List< Nucleus > receivers [get, set]

Member Enumeration Documentation
enum NanoBrain.Neuron.CombinatorType

The type of combinators. 
A combinator combines the weighted values of the synapses to a single value 

Enumerator:
Sum	Add the weighted values together. 
	
Product	Multiply the weighted values. 

Constructor & Destructor Documentation
NanoBrain.Neuron.Neuron (Cluster  parent, string  name)

Create a new Neuron in a Cluster instance. 

Parameters
parent 	The parent cluster in which the new Neuron should be created	
name 	The name of the new Neuron	

Member Function Documentation
Synapse NanoBrain.Neuron.AddSynapse (Neuron  sendingNucleus, float  weight = 1)

Add a new synapse to this nuclues. 

Parameters
sendingNucleus 	The nucleus from which the signals may originate	
weight 	The weight applied to the input. Default value = 1	
Returns
The created Synapse
This will add a new input to this nucleus with the given weight. 
Synapse NanoBrain.Neuron.GetSynapse (Nucleus  sender)

Find a synapse. 

Parameters
sender 	The sender of the input to the Synapse	
Returns
The found Synapse or null when the sender has no synapse to this nucleus.
void NanoBrain.Neuron.RemoveSynapse (Nucleus  sendingNucleus)

Remove a synapse from a Nucleus. 

Parameters
sendingNucleus 	Remote the synapse connecting to this Nucleus	
virtual void NanoBrain.Neuron.SetBias (Vector3  inputValue)[virtual]

Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

Parameters
inputValue 		
override Nucleus NanoBrain.Neuron.ShallowCloneTo (Cluster  newParent)

Toggle for printing debugging trace data.   
Function to make a partial clone of this nucleus
Parameters
parent 	The cluster in which the cloned nucleus should be placed	
Returns

override Nucleus NanoBrain.Neuron.Clone (ClusterPrefab  prefab)

Function to clone a nucleus to a Cluster prefab.   

Parameters
prefab 		
Returns

virtual void NanoBrain.Neuron.ProcessStimulus (Vector3  inputValue)[virtual]

Process an external stimulus. 

Parameters
inputValue 	The value of the stimulus	
thingId 	The id of the thing causing the stimulus	
thingName 	The name of the thing causing the stimulus	
virtual void NanoBrain.Nucleus.UpdateNuclei ()[virtual], [inherited]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented in NanoBrain.MemoryCell.

Member Data Documentation
Vector3 NanoBrain.Neuron.bias = Vector3.zero

Create a new Neuron in a Cluster Prefab. 

Parameters
prefab 	The Cluster Preafb in which the new Neuron should be created	
name 	The name of the new Neuron	
The bias
The bias which a value which is always added to the combined value of the neuron It does not have a synapse and therefore no weight of source nucleus 
Cluster NanoBrain.Nucleus.parent[inherited]

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Neuron.cs

NanoBrain.Nucleus Class Reference

Description
A Nucleus is a basic element in a brain cluster. 
Inheritance diagram for NanoBrain.Nucleus:
IMAGE
Public Types
enum Type { None, Neuron, MemoryCell, Cluster }
The types of Nucleus. 
Public Member Functions
Nucleus ShallowCloneTo (Cluster parent)
Toggle for printing debugging trace data. 

Nucleus Clone (ClusterPrefab prefab)
Function to clone a nucleus to a Cluster prefab. 

virtual void Initialize ()
void UpdateStateIsolated ()
Update the state without updating other Nuclei. 

virtual void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Public Attributes
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Member Function Documentation
Nucleus NanoBrain.Nucleus.ShallowCloneTo (Cluster  parent)[abstract]

Toggle for printing debugging trace data. 
Function to make a partial clone of this nucleus
Parameters
parent 	The cluster in which the cloned nucleus should be placed	
Returns

Nucleus NanoBrain.Nucleus.Clone (ClusterPrefab  prefab)[abstract]

Function to clone a nucleus to a Cluster prefab. 

Parameters
prefab 		
Returns

virtual void NanoBrain.Nucleus.UpdateNuclei ()[virtual]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented in NanoBrain.MemoryCell.

Member Data Documentation
Cluster NanoBrain.Nucleus.parent

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Nucleus.cs

LinearAlgebra.Spherical Struct Reference

Description
A spherical vector. 
<remark>This is a struct such that it is a value type and cannot be null 
 
Public Member Functions
Spherical (float distance, Direction direction)
Create a spherical vector. 

readonly Vector3 ToVector3 ()
readonly Vector3Float ToVector3 ()
override readonly string ToString ()
override readonly bool Equals (object o)
override readonly int GetHashCode ()
Static Public Member Functions
static Spherical Degrees (float distance, float horizontal, float vertical)
Create spherical vector. All given angles are in degrees. 

static Spherical Radians (float distance, float horizontal, float vertical)
static Spherical FromVector3 (Vector3 v)
static Spherical FromVector3 (Vector3Float v)
static Spherical operator+ (Spherical s1, Spherical s2)
static Spherical operator* (Spherical v, float d)
static bool operator== (Spherical v1, Spherical v2)
static bool operator!= (Spherical v1, Spherical v2)
static float Distance (Spherical v1, Spherical v2)
static Spherical Average (Spherical v1, Spherical v2)
static Spherical Sum (List< Spherical > vectors)
static Spherical Average (List< Spherical > vectors)
Public Attributes
float distance
The distance in meters. 

Direction direction
The direction of the vector. 

Static Public Attributes
static readonly Spherical zero = new(0, Direction.forward)
A spherical vector with zero degree angles and distance. 

static readonly Spherical forward = new(1, Direction.forward)
A normalized forward-oriented vector. 

Properties
readonly float magnitude [get]
Spherical normalized [get]

Constructor & Destructor Documentation
LinearAlgebra.Spherical.Spherical (float  distance, Direction  direction)

Create a spherical vector. 

Parameters
distance 	The distance in meters	
direction 	The direction of the vector	

Member Function Documentation
static Spherical LinearAlgebra.Spherical.Degrees (float  distance, float  horizontal, float  vertical)[static]

Create spherical vector. All given angles are in degrees. 

Parameters
distance 	The distance in meters	
horizontal 	The horizontal angle in degrees	
vertical 	The vertical angle in degrees	
Returns

Member Data Documentation
float LinearAlgebra.Spherical.distance

The distance in meters. 

Remarks
The distance should never be negative 

The documentation for this struct was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Spherical.cs

LinearAlgebra.SwingTwist Struct Reference

Description
An orientation using swing and twist angles. 

Parameters
swing 	The swing rotation	
twist 	The twist rotation	
Public Member Functions
SwingTwist (Direction swing, AngleFloat twist)
Spherical ToAngleAxis ()
UnityEngine.Quaternion ToQuaternion ()
Spherical ToAngleAxis ()
LinearAlgebra.Quaternion ToQuaternion ()
Static Public Member Functions
static SwingTwist Degrees (float horizontalSwing, float verticalSwing, float twist)
Create a swing/twist rotation using angles in degrees. 

static SwingTwist Radians (float horizontalSwing, float verticalSwing, float twist)
Create a swing/twist rotation using angles in degrees. 

static SwingTwist FromAngleAxis (Spherical r)
static SwingTwist FromQuaternion (UnityEngine.Quaternion q)
Convert a quaternion in a swing/twist rotation. 

static SwingTwist FromAngleAxis (Spherical r)
static SwingTwist FromQuaternion (LinearAlgebra.Quaternion q)
Convert a quaternion in a swing/twist rotation. 

static SwingTwist FromQuat32 (Quat32 q32)
Public Attributes
Direction swing
AngleFloat twist
Static Public Attributes
static readonly SwingTwist zero = Degrees(0, 0, 0)
A zero angle rotation. 

Member Function Documentation
static SwingTwist LinearAlgebra.SwingTwist.Degrees (float  horizontalSwing, float  verticalSwing, float  twist)[static]

Create a swing/twist rotation using angles in degrees. 

Parameters
horizontalSwing 	The swing angle in the horizontal plane in degrees	
verticalSwing 	The swing angle in the vertical plan in degrees	
twist 	The twist angle in degrees	
Returns
The swing/twist rotation
static SwingTwist LinearAlgebra.SwingTwist.Radians (float  horizontalSwing, float  verticalSwing, float  twist)[static]

Create a swing/twist rotation using angles in degrees. 

Parameters
horizontalSwing 	The swing angle in the horizontal plane in degrees	
verticalSwing 	The swing angle in the vertical plan in degrees	
twist 	The twist angle in degrees	
Returns
The swing/twist rotation
static SwingTwist LinearAlgebra.SwingTwist.FromQuaternion (UnityEngine::Quaternion  q)[static]

Convert a quaternion in a swing/twist rotation. 

Parameters
q 	The quaternion to convert	
Returns
The swing/twist rotation
static SwingTwist LinearAlgebra.SwingTwist.FromQuaternion (LinearAlgebra::Quaternion  q)[static]

Convert a quaternion in a swing/twist rotation. 

Parameters
q 	The quaternion to convert	
Returns
The swing/twist rotation

The documentation for this struct was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/SwingTwist.cs

NanoBrain.Synapse Class Reference

Description
A Synapse connects the ouput of a Neuron to another Neuron. 
Public Member Functions
Synapse (Neuron nucleus, float weight=1.0f)
Create a new Synapse. 

Public Attributes
Neuron neuron
The neuron from which input is received. 

float weight
The weight value to apply to the Neuron input. 

Properties
bool isSleeping [get]

Constructor & Destructor Documentation
NanoBrain.Synapse.Synapse (Neuron  nucleus, float  weight = 1::0f)

Create a new Synapse. 

Parameters
nucleus 	The neuron from which input is received	
weight 	The weight value to apply to the Neuron input	

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Synapse.cs

LinearAlgebra.Vector2Float Struct Reference

Description
2-dimensional vectors 
Public Member Functions
Vector2Float (float x, float y)
Create a new 2-dimensional vector. 

Vector2Float (Vector2Int v)
Convert a Vector2Int into a Vector2Float. 

override readonly bool Equals (object obj)
Tests if the vector is equal to the given object. 

override readonly int GetHashCode ()
Get an hash code for the vector. 

Static Public Member Functions
static float SqrMagnitudeOf (Vector2Float v)
static float MagnitudeOf (Vector2Float v)
static Vector2Float Normalize (Vector2Float v)
static Vector2Float operator+ (Vector2Float v1, Vector2Float v2)
Add two vectors. 

static Vector2Float operator- (Vector2Float v1, Vector2Float v2)
Subtract two vectors. 

static Vector2Float operator- (Vector2Float v1)
Negate the vector. 

static Vector2Float operator/ (Vector2Float v, float f)
Scale a vector uniformly down. 

static Vector2Float operator* (Vector2Float v1, float f)
Scale a vector uniformly up. 

static Vector2Float operator* (float f, Vector2Float v1)
Scale a vector uniformly up. 

static Vector2Float Scale (Vector2Float v1, Vector2Float v2)
Scale the vector using another vector. 

static bool operator== (Vector2Float v1, Vector2Float v2)
Tests if the vector has equal values as the given vector. 

static bool operator!= (Vector2Float v1, Vector2Float v2)
Tests if two vectors have different values. 

static float Distance (Vector2Float v1, Vector2Float v2)
Get the distance between two vectors. 

static float Dot (Vector2Float v1, Vector2Float v2)
The dot product of two vectors. 

static float SignedAngle (Vector2Float from, Vector2Float to)
Calculate the signed angle between two vectors. 

static float UnsignedAngle (Vector2Float from, Vector2Float to)
static Vector2Float Rotate (Vector2Float v1, AngleFloat angle)
Rotates the vector with the given angle. 

static Vector2Float Lerp (Vector2Float v1, Vector2Float v2, float f)
Lerp between two vectors. 

static float ToFactor (Vector2Float v1, Vector2Float v2)
Map interval of angles between vectors [0..Pi] to interval [0..1]. 

Public Attributes
float horizontal
The right axis of the vector. 

float vertical
The upward/forward axis of the vector. 

Static Public Attributes
static readonly Vector2Float zero = new Vector2Float(0, 0)
A vector with zero for all axis. 

static readonly Vector2Float one = new Vector2Float(1, 1)
A vector with values (1, 1) 

static readonly Vector2Float up = new Vector2Float(0, 1)
A vector with values (0, 1) 

static readonly Vector2Float down = new Vector2Float(0, -1)
A vector with values (0, -1) 

static readonly Vector2Float forward = new Vector2Float(0, 1)
A vector with values (0, 1) 

static readonly Vector2Float back = new Vector2Float(0, -1)
A vector with values (0, -1) 

static readonly Vector2Float left = new Vector2Float(-1, 0)
A vector3 with values (-1, 0) 

static readonly Vector2Float right = new Vector2Float(1, 0)
A vector with values (1, 0) 

Properties
readonly float sqrMagnitude [get]
The squared length of this vector. 

readonly float magnitude [get]
The length of this vector. 

Vector2Float normalized [get]
Convert the vector to a length of a 1. 

Constructor & Destructor Documentation
LinearAlgebra.Vector2Float.Vector2Float (float  x, float  y)

Create a new 2-dimensional vector. 

Parameters
x 	x axis value	
y 	y axis value	
LinearAlgebra.Vector2Float.Vector2Float (Vector2Int  v)

Convert a Vector2Int into a Vector2Float. 

Parameters
v 	The Vector2Int	

Member Function Documentation
static Vector2Float LinearAlgebra.Vector2Float.operator+ (Vector2Float  v1, Vector2Float  v2)[static]

Add two vectors. 

Parameters
v1 	The first vector	
v2 	The second vector	
Returns
The result of adding the two vectors
static Vector2Float LinearAlgebra.Vector2Float.operator- (Vector2Float  v1, Vector2Float  v2)[static]

Subtract two vectors. 

Parameters
v1 	The first vector	
v2 	The second vector	
Returns
The result of adding the two vectors
static Vector2Float LinearAlgebra.Vector2Float.operator- (Vector2Float  v1)[static]

Negate the vector. 

Parameters
v1 	The vector to negate	
Returns
The negated vector
This will result in a vector pointing in the opposite direction 
static Vector2Float LinearAlgebra.Vector2Float.operator/ (Vector2Float  v, float  f)[static]

Scale a vector uniformly down. 

Parameters
v 	The vector to scale	
f 	The scaling factor	
Returns
The scaled vector
Each component of the vector will be devided by the same factor. 
static Vector2Float LinearAlgebra.Vector2Float.operator* (Vector2Float  v1, float  f)[static]

Scale a vector uniformly up. 

Parameters
v1 	The vector to scale	
f 	The scaling factor	
Returns
The scaled vector
Each component of the vector will be multipled with the same factor. 
static Vector2Float LinearAlgebra.Vector2Float.operator* (float  f, Vector2Float  v1)[static]

Scale a vector uniformly up. 

Parameters
f 	The scaling factor	
v1 	The vector to scale	
Returns
The scaled vector
Each component of the vector will be multipled with the same factor. 
static Vector2Float LinearAlgebra.Vector2Float.Scale (Vector2Float  v1, Vector2Float  v2)[static]

Scale the vector using another vector. 

Parameters
v1 	The vector to scale 	
v2 	A vector with the scaling factors 	
Returns
The scaled vector 
Remarks
Each component of the vector v1 will be multiplied with the matching component from the scaling vector v2. 
static bool LinearAlgebra.Vector2Float.operator== (Vector2Float  v1, Vector2Float  v2)[static]

Tests if the vector has equal values as the given vector. 

Parameters
v1 	The vector to compare to	
Returns
true  if the vector values are equal
Tests if the two vectors have equal values
Parameters
v1 	The first vector	
v2 	The second vector	
Returns
true when the vectors have equal values
Note that this uses a Float equality check which cannot be not exact in all cases. In most cases it is better to check if the Vector2.Distance between the vectors is smaller than Float.epsilon Or more efficient: (v1 - v2).sqrMagnitude < Float.sqrEpsilon 
static bool LinearAlgebra.Vector2Float.operator!= (Vector2Float  v1, Vector2Float  v2)[static]

Tests if two vectors have different values. 

Parameters
v1 	The first vector	
v2 	The second vector	
Returns
true when the vectors have different values
Note that this uses a Float equality check which cannot be not exact in all case. In most cases it is better to check if the Vector2.Distance between the vectors is smaller than Float.epsilon. Or more efficient: (v1 - v2).sqrMagnitude < Float.sqrEpsilon 
override readonly bool LinearAlgebra.Vector2Float.Equals (object  obj)

Tests if the vector is equal to the given object. 

Parameters
obj 	The object to compare to	
Returns
false  when the object is not a Vector2 or does not have equal values
override readonly int LinearAlgebra.Vector2Float.GetHashCode ()

Get an hash code for the vector. 

Returns
The hash code
static float LinearAlgebra.Vector2Float.Distance (Vector2Float  v1, Vector2Float  v2)[static]

Get the distance between two vectors. 

Parameters
v1 	The first vector	
v2 	The second vector	
Returns
The distance between the two vectors
static float LinearAlgebra.Vector2Float.Dot (Vector2Float  v1, Vector2Float  v2)[static]

The dot product of two vectors. 

Parameters
v1 	The first vector	
v2 	The second vector	
Returns
The dot product of the two vectors
static float LinearAlgebra.Vector2Float.SignedAngle (Vector2Float  from, Vector2Float  to)[static]

Calculate the signed angle between two vectors. 

Parameters
from 	The starting vector	
to 	The ending vector	
axis 	The axis to rotate around	
Returns
The signed angle in degrees
static Vector2Float LinearAlgebra.Vector2Float.Rotate (Vector2Float  v1, AngleFloat  angle)[static]

Rotates the vector with the given angle. 

Parameters
v1 	The vector to rotate	
angle 	The angle in degrees	
Returns

static Vector2Float LinearAlgebra.Vector2Float.Lerp (Vector2Float  v1, Vector2Float  v2, float  f)[static]

Lerp between two vectors. 

Parameters
v1 	The from vector	
v2 	The to vector	
f 	The interpolation distance [0..1]	
Returns
The lerped vector
The factor f is unclamped. Value 0 matches the v1  vector, Value 1 matches the v2  vector Value -1 is v1  vector minus the difference between v1  and v2  etc. 
static float LinearAlgebra.Vector2Float.ToFactor (Vector2Float  v1, Vector2Float  v2)[static]

Map interval of angles between vectors [0..Pi] to interval [0..1]. 

Parameters
v1 	The first vector	
v2 	The second vector	
Returns
The resulting factor in interval [0..1]
Vectors a and b must be normalized 

Property Documentation
readonly float LinearAlgebra.Vector2Float.sqrMagnitude[get]

The squared length of this vector. 

Returns
The squared length
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C. 
readonly float LinearAlgebra.Vector2Float.magnitude[get]

The length of this vector. 

Returns
The length of this vector
Vector2Float LinearAlgebra.Vector2Float.normalized[get]

Convert the vector to a length of a 1. 

Returns
The vector with length 1

The documentation for this struct was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Vector2Float.cs

LinearAlgebra.Vector3Float Struct Reference

Description
3-dimensional vectors 
This uses the right-handed coordinate system. 
Public Member Functions
Vector3Float (float horizontal, float vertical, float depth)
Create a new 3-dimensional vector. 

Vector3Float (Vector3Int v)
override string ToString ()
override readonly bool Equals (object obj)
override readonly int GetHashCode ()
Static Public Member Functions
static Vector3Float FromSpherical (Spherical s)
static float MagnitudeOf (Vector3Float v)
The vector length. 

static float SqrMagnitudeOf (Vector3Float v)
The squared vector length. 

static Vector3Float Normalize (Vector3Float v)
Convert the vector to a length of 1. 

static Vector3Float operator- (Vector3Float v1)
Negate te vector such that it points in the opposite direction. 

static Vector3Float operator- (Vector3Float v1, Vector3Float v2)
Subtract two vectors. 

static Vector3Float operator+ (Vector3Float v1, Vector3Float v2)
Add two vectors. 

static Vector3Float Scale (Vector3Float v1, Vector3Float v2)
Scale the vector using another vector. 

static Vector3Float operator* (Vector3Float v1, float d)
static Vector3Float operator* (float d, Vector3Float v1)
static Vector3Float operator/ (Vector3Float v1, float d)
static bool operator== (Vector3Float v1, Vector3Float v2)
static bool operator!= (Vector3Float v1, Vector3Float v2)
static float Distance (Vector3Float v1, Vector3Float v2)
The distance between two vectors. 

static float Dot (Vector3Float v1, Vector3Float v2)
The dot product of two vectors. 

static Vector3Float Cross (Vector3Float v1, Vector3Float v2)
The cross product of two vectors. 

static Vector3Float Project (Vector3Float v, Vector3Float n)
Project the vector on another vector. 

static Vector3Float ProjectOnPlane (Vector3Float v, Vector3Float n)
Project the vector on a plane defined by a normal orthogonal to the plane. 

static AngleFloat UnsignedAngle (Vector3Float v1, Vector3Float v2)
The angle between two vectors. 

static AngleFloat SignedAngle (Vector3Float v1, Vector3Float v2, Vector3Float axis)
The signed angle between two vectors. 

static Vector3Float Lerp (Vector3Float v1, Vector3Float v2, float f)
Lerp (linear interpolation) between two vectors. 

Public Attributes
float horizontal
The right axis of the vector. 

float vertical
The upward axis of the vector. 

float depth
The forward axis of the vector. 

Static Public Attributes
static readonly Vector3Float zero = new Vector3Float(0, 0, 0)
A vector with zero for all axis. 

static readonly Vector3Float one = new Vector3Float(1, 1, 1)
A vector with one for all axis. 

static readonly Vector3Float left = new Vector3Float(-1, 0, 0)
A Vector3Float with values (-1, 0, 0) 

static readonly Vector3Float right = new Vector3Float(1, 0, 0)
A vector with values (1, 0, 0) 

static readonly Vector3Float down = new Vector3Float(0, -1, 0)
A vector with values (0, -1, 0) 

static readonly Vector3Float up = new Vector3Float(0, 1, 0)
A vector with values (0, 1, 0) 

static readonly Vector3Float back = new Vector3Float(0, -1, 0)
A vector with values (0, 0, -1) 

static readonly Vector3Float forward = new Vector3Float(0, 1, 0)
A vector with values (0, 0, 1) 

Properties
readonly float magnitude [get]
The vector length. 

readonly float sqrMagnitude [get]
The squared vector length. 

readonly Vector3Float normalized [get]
Convert the vector to a length of 1. 

Constructor & Destructor Documentation
LinearAlgebra.Vector3Float.Vector3Float (float  horizontal, float  vertical, float  depth)

Create a new 3-dimensional vector. 

Parameters
horizontal 	x axis value	
vertical 	y axis value	
depth 	z axis value	

Member Function Documentation
static float LinearAlgebra.Vector3Float.MagnitudeOf (Vector3Float  v)[static]

The vector length. 

Parameters
v 	The vector for which you need the length	
Returns
The vector length
static float LinearAlgebra.Vector3Float.SqrMagnitudeOf (Vector3Float  v)[static]

The squared vector length. 

Parameters
v 	The vector for which you need the squared length	
Returns
The squared vector length
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C.
static Vector3Float LinearAlgebra.Vector3Float.Normalize (Vector3Float  v)[static]

Convert the vector to a length of 1. 

Parameters
v 	The vector to convert 	
Returns
The vector normalized to a length of 1 
static Vector3Float LinearAlgebra.Vector3Float.operator- (Vector3Float  v1)[static]

Negate te vector such that it points in the opposite direction. 

Parameters
v1 		
Returns
The negated vector
static Vector3Float LinearAlgebra.Vector3Float.operator- (Vector3Float  v1, Vector3Float  v2)[static]

Subtract two vectors. 

Parameters
v1 		
v2 		
Returns
The result of the subtraction
static Vector3Float LinearAlgebra.Vector3Float.operator+ (Vector3Float  v1, Vector3Float  v2)[static]

Add two vectors. 

Parameters
v1 		
v2 		
Returns
The result of the addition
static Vector3Float LinearAlgebra.Vector3Float.Scale (Vector3Float  v1, Vector3Float  v2)[static]

Scale the vector using another vector. 

Parameters
v1 	The vector to scale 	
v2 	A vector with the scaling factors 	
Returns
The scaled vector 
Remarks
Each component of the vector v1 will be multiplied with the matching component from the scaling vector v2. 
static float LinearAlgebra.Vector3Float.Distance (Vector3Float  v1, Vector3Float  v2)[static]

The distance between two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The distance between the two vectors 
static float LinearAlgebra.Vector3Float.Dot (Vector3Float  v1, Vector3Float  v2)[static]

The dot product of two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The dot product of the two vectors 
static Vector3Float LinearAlgebra.Vector3Float.Cross (Vector3Float  v1, Vector3Float  v2)[static]

The cross product of two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The cross product of the two vectors 
static Vector3Float LinearAlgebra.Vector3Float.Project (Vector3Float  v, Vector3Float  n)[static]

Project the vector on another vector. 

Parameters
v 	The vector to project 	
n 	The normal vecto to project on 	
Returns
The projected vector 
static Vector3Float LinearAlgebra.Vector3Float.ProjectOnPlane (Vector3Float  v, Vector3Float  n)[static]

Project the vector on a plane defined by a normal orthogonal to the plane. 

Parameters
v 	The vector to project 	
n 	The normal of the plane to project on 	
Returns
Teh projected vector 
static AngleFloat LinearAlgebra.Vector3Float.UnsignedAngle (Vector3Float  v1, Vector3Float  v2)[static]

The angle between two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The angle between the two vectors 
Remarks
This reterns an unsigned angle which is the shortest distance between the two vectors. Use Vector3::SignedAngle if a signed angle is needed. 
static AngleFloat LinearAlgebra.Vector3Float.SignedAngle (Vector3Float  v1, Vector3Float  v2, Vector3Float  axis)[static]

The signed angle between two vectors. 

Parameters
v1 	The starting vector 	
v2 	The ending vector 	
axis 	The axis to rotate around 	
Returns
The signed angle between the two vectors 
static Vector3Float LinearAlgebra.Vector3Float.Lerp (Vector3Float  v1, Vector3Float  v2, float  f)[static]

Lerp (linear interpolation) between two vectors. 

Parameters
v1 	The starting vector 	
v2 	The ending vector 	
f 	The interpolation distance 	
Returns
The lerped vector 
Remarks
The factor f is unclamped. Value 0 matches the vector v1 , Value 1 matches vector v2 . Value -1 is vector v1  minus the difference between v1  and v2  etc. 

Property Documentation
readonly float LinearAlgebra.Vector3Float.magnitude[get]

The vector length. 

Returns
The vector length 
readonly float LinearAlgebra.Vector3Float.sqrMagnitude[get]

The squared vector length. 

Returns
The squared vector length 
Remarks
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C. 
readonly Vector3Float LinearAlgebra.Vector3Float.normalized[get]

Convert the vector to a length of 1. 

Returns
The vector normalized to a length of 1 

The documentation for this struct was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Vector3Float.cs

LinearAlgebra.Vector3Int Struct Reference

Description
3-dimensional vectors 
This uses the right-handed coordinate system. 
Create a new 3-dimensional vector 
Parameters
horizontal 	x axis value	
vertical 	y axis value	
depth 	z axis value	
Public Member Functions
Vector3Int (int horizontal, int vertical, int depth)
bool Equals (Vector3Int v)
override bool Equals (object obj)
override int GetHashCode ()
Static Public Member Functions
static float MagnitudeOf (Vector3Int v)
The vector length. 

static float SqrMagnitudeOf (Vector3Int v)
The squared vector length. 

static Vector3Float Normalize (Vector3Int v)
Convert the vector to a length of 1. 

static Vector3Int operator- (Vector3Int v1)
Negate te vector such that it points in the opposite direction. 

static Vector3Int operator- (Vector3Int v1, Vector3Int v2)
Subtract two vectors. 

static Vector3Int operator+ (Vector3Int v1, Vector3Int v2)
Add two vectors. 

static Vector3Int Scale (Vector3Int v1, Vector3Int v2)
Scale the vector using another vector. 

static Vector3Int operator* (Vector3Int v1, int d)
static Vector3Int operator* (int d, Vector3Int v1)
static Vector3Int operator/ (Vector3Int v1, int d)
static bool operator== (Vector3Int v1, Vector3Int v2)
static bool operator!= (Vector3Int v1, Vector3Int v2)
static float Distance (Vector3Int v1, Vector3Int v2)
The distance between two vectors. 

static float Dot (Vector3Int v1, Vector3Int v2)
The dot product of two vectors. 

static Vector3Int Cross (Vector3Int v1, Vector3Int v2)
The cross product of two vectors. 

static AngleFloat UnsignedAngle (Vector3Int v1, Vector3Int v2)
The angle between two vectors. 

static AngleFloat SignedAngle (Vector3Int v1, Vector3Int v2, Vector3Int axis)
The signed angle between two vectors. 

Public Attributes
int horizontal
The right axis of the vector. 

int vertical
The upward axis of the vector. 

int depth
The forward axis of the vector. 

Static Public Attributes
static readonly Vector3Int zero = new(0, 0, 0)
A vector with zero for all axis. 

static readonly Vector3Int one = new(1, 1, 1)
A vector with one for all axis. 

static readonly Vector3Int left = new(-1, 0, 0)
A Vector3Int with values (-1, 0, 0) 

static readonly Vector3Int right = new(1, 0, 0)
A vector with values (1, 0, 0) 

static readonly Vector3Int down = new(0, -1, 0)
A vector with values (0, -1, 0) 

static readonly Vector3Int up = new(0, 1, 0)
A vector with values (0, 1, 0) 

static readonly Vector3Int back = new(0, -1, 0)
A vector with values (0, 0, -1) 

static readonly Vector3Int forward = new(0, 1, 0)
A vector with values (0, 0, 1) 

Properties
readonly float magnitude [get]
The vector length. 

readonly float sqrMagnitude [get]
The squared vector length. 

readonly Vector3Float normalized [get]
Convert the vector to a length of 1. 

Member Function Documentation
static float LinearAlgebra.Vector3Int.MagnitudeOf (Vector3Int  v)[static]

The vector length. 

Parameters
v 	The vector for which you need the length	
Returns
The vector length
static float LinearAlgebra.Vector3Int.SqrMagnitudeOf (Vector3Int  v)[static]

The squared vector length. 

Parameters
v 	The vector for which you need the squared length	
Returns
The squared vector length
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C.
static Vector3Float LinearAlgebra.Vector3Int.Normalize (Vector3Int  v)[static]

Convert the vector to a length of 1. 

Parameters
v 	The vector to convert 	
Returns
The vector normalized to a length of 1 
static Vector3Int LinearAlgebra.Vector3Int.operator- (Vector3Int  v1)[static]

Negate te vector such that it points in the opposite direction. 

Parameters
v1 		
Returns
The negated vector
static Vector3Int LinearAlgebra.Vector3Int.operator- (Vector3Int  v1, Vector3Int  v2)[static]

Subtract two vectors. 

Parameters
v1 		
v2 		
Returns
The result of the subtraction
static Vector3Int LinearAlgebra.Vector3Int.operator+ (Vector3Int  v1, Vector3Int  v2)[static]

Add two vectors. 

Parameters
v1 		
v2 		
Returns
The result of the addition
static Vector3Int LinearAlgebra.Vector3Int.Scale (Vector3Int  v1, Vector3Int  v2)[static]

Scale the vector using another vector. 

Parameters
v1 	The vector to scale 	
v2 	A vector with the scaling factors 	
Returns
The scaled vector 
Remarks
Each component of the vector v1 will be multiplied with the matching component from the scaling vector v2. 
static float LinearAlgebra.Vector3Int.Distance (Vector3Int  v1, Vector3Int  v2)[static]

The distance between two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The distance between the two vectors 
static float LinearAlgebra.Vector3Int.Dot (Vector3Int  v1, Vector3Int  v2)[static]

The dot product of two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The dot product of the two vectors 
static Vector3Int LinearAlgebra.Vector3Int.Cross (Vector3Int  v1, Vector3Int  v2)[static]

The cross product of two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The cross product of the two vectors 
static AngleFloat LinearAlgebra.Vector3Int.UnsignedAngle (Vector3Int  v1, Vector3Int  v2)[static]

The angle between two vectors. 

Parameters
v1 	The first vector 	
v2 	The second vector 	
Returns
The angle between the two vectors 
Remarks
This reterns an unsigned angle which is the shortest distance between the two vectors. Use Vector3::SignedAngle if a signed angle is needed. 
static AngleFloat LinearAlgebra.Vector3Int.SignedAngle (Vector3Int  v1, Vector3Int  v2, Vector3Int  axis)[static]

The signed angle between two vectors. 

Parameters
v1 	The starting vector 	
v2 	The ending vector 	
axis 	The axis to rotate around 	
Returns
The signed angle between the two vectors 

Property Documentation
readonly float LinearAlgebra.Vector3Int.magnitude[get]

The vector length. 

Returns
The vector length 
readonly float LinearAlgebra.Vector3Int.sqrMagnitude[get]

The squared vector length. 

Returns
The squared vector length 
Remarks
The squared length is computationally simpler than the real length. Think of Pythagoras A^2 + B^2 = C^2. This leaves out the calculation of the squared root of C. 
readonly Vector3Float LinearAlgebra.Vector3Int.normalized[get]

Convert the vector to a length of 1. 

Returns
The vector normalized to a length of 1 

The documentation for this struct was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/LinearAlgebra/src/Vector3Int.cs

Index
INDEX