Empeld
Empeld plugin documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase Class Reference

A base class used to represent a standard orbital in the sky More...

Inheritance diagram for pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase:
pluginbase.Objects.World.Environment.Orbitals.OrbitalBase pluginbase.Objects.World.Environment.IOrbital pluginbase.Objects.World.Environment.IEnvironmentSimulatable essentials.Environment.Orbital.Moon essentials.Environment.Orbital.Sun

Public Member Functions

override void Simulate (double time, double x, double y, double z)
 Simulate the environment with the time, and an x/y/z More...
 
- Public Member Functions inherited from pluginbase.Objects.World.Environment.Orbitals.OrbitalBase
 OrbitalBase ()
 Initializes a new instance of the pluginbase.Objects.World.Environment.Orbitals.OrbitalBase class. More...
 

Protected Member Functions

 OrbitalRevolutionBase (float secondsPerCycle, float timeOffset, float inclination=MathHelper.Pi, float ascendingRotation=MathHelper.PiOver4, Vector3 offset=default(Vector3))
 Initializes a new instance of the pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase class. More...
 

Protected Attributes

readonly float TimeMult
 The time multiplier More...
 
readonly float TimeOffset
 The time offset. More...
 

Properties

override Vector3 Direction [get]
 Gets the direction that the object is rendered in Needs to be normalized More...
 
- Properties inherited from pluginbase.Objects.World.Environment.Orbitals.OrbitalBase
virtual OrbitalRenderMode RenderMode [get]
 Gets the render mode of the orbital More...
 
virtual int RenderDetail [get]
 
virtual EnvironmentBlendMode BlendMode [get]
 
virtual Rgba Color [get]
 
virtual bool ReceivesLight [get]
 
virtual bool HasEmittance [get]
 
virtual Rgba EmittanceDiffuse [get]
 
virtual Rgba EmittanceSpecular [get]
 
virtual Rgba EmittanceAmbient [get]
 
virtual Rgba OrbitalEmittance [get]
 
virtual string Resource [get]
 
virtual float Size [get]
 
virtual Vector3 Direction [get]
 
virtual int Layer [get]
 
virtual float Rotation [get]
 
- Properties inherited from pluginbase.Objects.World.Environment.IOrbital
OrbitalRenderMode RenderMode [get]
 Gets the render mode. More...
 
int RenderDetail [get]
 Gets the render detail. Currently only applies to sphere rendering. Default 12 More...
 
Rgba EmittanceDiffuse [get]
 Gets the emittance color for lighting More...
 
Rgba EmittanceAmbient [get]
 Gets the emittance ambient for lighting More...
 
Rgba EmittanceSpecular [get]
 Gets the emmitance specular for lighting More...
 
Rgba OrbitalEmittance [get]
 The color that affects other orbitals. Defaults to emittance More...
 
bool HasEmittance [get]
 Gets a value indicating whether this instance has emittance. More...
 
string Resource [get]
 Gets the resource. In most cases this is a texture More...
 
EnvironmentBlendMode BlendMode [get]
 Gets the blend mode. More...
 
Rgba Color [get]
 Gets the color that the orbital is affected by More...
 
bool ReceivesLight [get]
 Gets a value indicating whether this pluginbase.Objects.World.Environment.IOrbital receives light from other orbitals during environmental rendering More...
 
float Size [get]
 Gets the relative size More...
 
Vector3 Direction [get]
 Gets the direction that the object is rendered in Needs to be normalized More...
 
int Layer [get]
 Gets the layer that the object is drawn on More...
 
float Rotation [get]
 Gets the rotation around the direction More...
 

Detailed Description

A base class used to represent a standard orbital in the sky

Constructor & Destructor Documentation

pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase.OrbitalRevolutionBase ( float  secondsPerCycle,
float  timeOffset,
float  inclination = MathHelper.Pi,
float  ascendingRotation = MathHelper.PiOver4,
Vector3  offset = default(Vector3) 
)
protected

Initializes a new instance of the pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase class.

Parameters
secondsPerCycleSeconds it takes the orbital to do a full 360
timeOffsetTime offset from the base-time
inclinationInclination in radians. eg. the angle at which the sun is seen in the sky
ascendingRotationAscending rotation in radians. eg. where in the sky the sun rises and sets
offsetThe offset of the final vector. Used for offsetting orbital times, eg, caused by tilt of planet
43  {
44  TimeMult = MathHelper.TwoPi / secondsPerCycle;
45  TimeOffset = timeOffset;
46 
47  _u = new Vector3((float)Math.Sin(ascendingRotation), (float)Math.Cos(ascendingRotation), 0f);
48  Matrix4 inclinationMatrix = Matrix4.CreateFromAxisAngle(_u, inclination);
49  _n = Vector3.Transform(Math.Abs(Math.Cos(ascendingRotation)) > 0.9f ? Vector3.UnitX : Vector3.UnitY, inclinationMatrix);
50 
51  _offset = offset;
52  }
readonly float TimeOffset
The time offset.
Definition: OrbitalRevolutionBase.cs:29
readonly float TimeMult
The time multiplier
Definition: OrbitalRevolutionBase.cs:24

Member Function Documentation

override void pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase.Simulate ( double  time,
double  x,
double  y,
double  z 
)
virtual

Simulate the environment with the time, and an x/y/z

Parameters
timeTime.
xX.
yY.
zZ.

Reimplemented from pluginbase.Objects.World.Environment.Orbitals.OrbitalBase.

62  {
63  double t = (TimeOffset + time) * TimeMult;
64  var unitDirection = Vector3.Multiply(_u, (float)Math.Cos(t)) + Vector3.Multiply(Vector3.Cross(_n, _u), (float)Math.Sin(t)) + _offset;
65  float length = unitDirection.Length;
66  if (length >= 0.001f)
67  _direction = unitDirection / length;
68  }
readonly float TimeOffset
The time offset.
Definition: OrbitalRevolutionBase.cs:29
readonly float TimeMult
The time multiplier
Definition: OrbitalRevolutionBase.cs:24

Member Data Documentation

readonly float pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase.TimeMult
protected

The time multiplier

readonly float pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase.TimeOffset
protected

The time offset.

Property Documentation

override Vector3 pluginbase.Objects.World.Environment.Orbitals.OrbitalRevolutionBase.Direction
get

Gets the direction that the object is rendered in Needs to be normalized

The direction.


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