6 namespace droid.Runtime.Utilities.Structs {
22 get {
return this._distribution_sampler; }
23 set { this._distribution_sampler = value; }
26 public Int32 DecimalGranularity {
27 get {
return this._decimal_granularity; }
28 set { this._decimal_granularity = value; }
33 public Boolean IsNormalised {
get {
return this.normalised; }
set { this.normalised = value; } }
39 this._decimal_granularity = decimal_granularity;
40 this._Min_Values = Vector3.one * -100f;
41 this._Max_Values = Vector3.one * 100f;
45 public Vector3 Span {
get {
return this._Max_Values - this._Min_Values; } }
52 return new Vector3(x, y, z);
56 if (v.x >
this._Max_Values.x) {
57 v.x = this._Max_Values.x;
58 }
else if (v.x <
this._Min_Values.x) {
59 v.x = this._Min_Values.x;
62 if (this.Span.x > 0) {
63 v.x = this.Round((v.x -
this._Min_Values.x) /
this.Span.x);
68 if (v.y >
this._Max_Values.y) {
69 v.y = this._Max_Values.y;
70 }
else if (v.y <
this._Min_Values.y) {
71 v.y = this._Min_Values.y;
74 if (this.Span.y > 0) {
75 v.y = this.Round((v.y -
this._Min_Values.y) /
this.Span.y);
80 if (v.z >
this._Max_Values.z) {
81 v.z = this._Max_Values.z;
82 }
else if (v.z <
this._Min_Values.z) {
83 v.z = this._Min_Values.z;
86 if (this.Span.z > 0) {
87 v.z = this.Round((v.z -
this._Min_Values.z) /
this.Span.z);
100 public float Round(
float v) {
return (
float)Math.Round(v, this.DecimalGranularity); }
104 return new Space1(this.DecimalGranularity) {
105 _Min_Value = this._Min_Values.x,
106 _Max_Value = this._Max_Values.x
113 return new Space1(this.DecimalGranularity) {
114 _Min_Value = this._Min_Values.y,
115 _Max_Value = this._Max_Values.y
122 return new Space1(this.DecimalGranularity) {
123 _Min_Value = this._Min_Values.z,
124 _Max_Value = this._Max_Values.z
190 _Min_Values = Vector3.one * 0.2f,
191 _Max_Values = Vector3.one * 0.8f
static Space3 operator-(Space3 b, Vector3 c)
Space3(DistributionSampler ds, int decimal_granularity=1)
static Space3 operator+(Vector3 c, Space3 b)
static Space3 operator+(Space3 b, Vector3 c)
Vector3 ClipNormaliseRound(Vector3 v)
DistributionSampler _distribution_sampler
static Space3 operator-(Vector3 c, Space3 b)
float Range(float min, float max)