Godot Nature of Code  1.2.0
Nature of Code implemented in Godot Engine
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Oscillation.SimpleWave Class Reference

Simple wave. More...

Inherits Node2D.

Public Member Functions

 SimpleWave ()
 Create a default wave. More...
 

Public Attributes

float Radius = 30
 Component radius More...
 
int Separation = 24
 Component separation More...
 
float AngularVelocity = 0.1f
 Wave angular velocity More...
 
float StartAngle
 Wave start angle More...
 
float StartAngleFactor = 1
 Wave start angle update factor More...
 
float Length = 300
 Wave length More...
 
float Amplitude = 100
 Wave amplitude More...
 

Protected Member Functions

virtual float ComputeY (float angle)
 Compute Y coordinate from angle. More...
 

Detailed Description

Simple wave.

Definition at line 10 of file SimpleWave.cs.

Constructor & Destructor Documentation

◆ SimpleWave()

Oscillation.SimpleWave.SimpleWave ( )
inline

Create a default wave.

Definition at line 47 of file SimpleWave.cs.

48  {
49  components = new List<WaveComponent>();
50  }

Member Function Documentation

◆ ComputeY()

virtual float Oscillation.SimpleWave.ComputeY ( float  angle)
inlineprotectedvirtual

Compute Y coordinate from angle.

Parameters
angleAngle in radians
Returns
Y coordinate

Definition at line 57 of file SimpleWave.cs.

58  {
59  return MathUtils.Map(Mathf.Sin(angle), -1, 1, -Amplitude, Amplitude);
60  }
Math utility functions
Definition: MathUtils.cs:7
static float Map(float value, float istart, float istop, float ostart, float ostop)
Map a value from one bound to another.
Definition: MathUtils.cs:17
float Amplitude
Wave amplitude
Definition: SimpleWave.cs:40

Member Data Documentation

◆ Amplitude

float Oscillation.SimpleWave.Amplitude = 100

Wave amplitude

Definition at line 40 of file SimpleWave.cs.

◆ AngularVelocity

float Oscillation.SimpleWave.AngularVelocity = 0.1f

Wave angular velocity

Definition at line 28 of file SimpleWave.cs.

◆ Length

float Oscillation.SimpleWave.Length = 300

Wave length

Definition at line 37 of file SimpleWave.cs.

◆ Radius

float Oscillation.SimpleWave.Radius = 30

Component radius

Definition at line 22 of file SimpleWave.cs.

◆ Separation

int Oscillation.SimpleWave.Separation = 24

Component separation

Definition at line 25 of file SimpleWave.cs.

◆ StartAngle

float Oscillation.SimpleWave.StartAngle

Wave start angle

Definition at line 31 of file SimpleWave.cs.

◆ StartAngleFactor

float Oscillation.SimpleWave.StartAngleFactor = 1

Wave start angle update factor

Definition at line 34 of file SimpleWave.cs.


The documentation for this class was generated from the following file: