Skip to content

Commit

Permalink
Updated references to XOf, YOf, and ZOf.
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDeltin committed May 21, 2019
1 parent 690a38c commit c25b7e5
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Deltinteger/Deltinteger/Elements/CustomMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ static MethodResult AngleOfVectors(bool isGlobal, object[] parameters)
ab.SetVariable(
Element.Part<V_Vector>
(
Element.Part<V_Subtract>(Element.Part<V_XComponentOf>(b.GetVariable()), Element.Part<V_XComponentOf>(a.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_YComponentOf>(b.GetVariable()), Element.Part<V_YComponentOf>(a.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_ZComponentOf>(b.GetVariable()), Element.Part<V_ZComponentOf>(a.GetVariable()))
Element.Part<V_Subtract>(Element.Part<V_XOf>(b.GetVariable()), Element.Part<V_XOf>(a.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_YOf>(b.GetVariable()), Element.Part<V_YOf>(a.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_ZOf>(b.GetVariable()), Element.Part<V_ZOf>(a.GetVariable()))
), eventPlayer),

// get bc
// bc[3] = { c[0] - b[0], c[1] - b[1], c[2] - b[2] };
bc.SetVariable(
Element.Part<V_Vector>
(
Element.Part<V_Subtract>(Element.Part<V_XComponentOf>(c.GetVariable()), Element.Part<V_XComponentOf>(b.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_YComponentOf>(c.GetVariable()), Element.Part<V_YComponentOf>(b.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_ZComponentOf>(c.GetVariable()), Element.Part<V_ZComponentOf>(b.GetVariable()))
Element.Part<V_Subtract>(Element.Part<V_XOf>(c.GetVariable()), Element.Part<V_XOf>(b.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_YOf>(c.GetVariable()), Element.Part<V_YOf>(b.GetVariable())),
Element.Part<V_Subtract>(Element.Part<V_ZOf>(c.GetVariable()), Element.Part<V_ZOf>(b.GetVariable()))
), eventPlayer),

// get abVec
Expand All @@ -97,19 +97,19 @@ static MethodResult AngleOfVectors(bool isGlobal, object[] parameters)
abNorm.SetVariable(
Element.Part<V_Vector>
(
Element.Part<V_Divide>(Element.Part<V_XComponentOf>(ab.GetVariable()), abVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_YComponentOf>(ab.GetVariable()), abVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_ZComponentOf>(ab.GetVariable()), abVec.GetVariable())
Element.Part<V_Divide>(Element.Part<V_XOf>(ab.GetVariable()), abVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_YOf>(ab.GetVariable()), abVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_ZOf>(ab.GetVariable()), abVec.GetVariable())
), eventPlayer),

// get bcNorm
// bcNorm[3] = {bc[0] / bcVec, bc[1] / bcVec, bc[2] / bcVec};
bcNorm.SetVariable(
Element.Part<V_Vector>
(
Element.Part<V_Divide>(Element.Part<V_XComponentOf>(bc.GetVariable()), bcVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_YComponentOf>(bc.GetVariable()), bcVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_ZComponentOf>(bc.GetVariable()), bcVec.GetVariable())
Element.Part<V_Divide>(Element.Part<V_XOf>(bc.GetVariable()), bcVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_YOf>(bc.GetVariable()), bcVec.GetVariable()),
Element.Part<V_Divide>(Element.Part<V_ZOf>(bc.GetVariable()), bcVec.GetVariable())
), eventPlayer),
},
// get res
Expand All @@ -119,10 +119,10 @@ static MethodResult AngleOfVectors(bool isGlobal, object[] parameters)
(
Element.Part<V_Add>
(
Element.Part<V_Multiply>(Element.Part<V_XComponentOf>(abNorm.GetVariable()), Element.Part<V_XComponentOf>(bcNorm.GetVariable())),
Element.Part<V_Multiply>(Element.Part<V_YComponentOf>(abNorm.GetVariable()), Element.Part<V_YComponentOf>(bcNorm.GetVariable()))
Element.Part<V_Multiply>(Element.Part<V_XOf>(abNorm.GetVariable()), Element.Part<V_XOf>(bcNorm.GetVariable())),
Element.Part<V_Multiply>(Element.Part<V_YOf>(abNorm.GetVariable()), Element.Part<V_YOf>(bcNorm.GetVariable()))
),
Element.Part<V_Multiply>(Element.Part<V_ZComponentOf>(abNorm.GetVariable()), Element.Part<V_ZComponentOf>(bcNorm.GetVariable()))
Element.Part<V_Multiply>(Element.Part<V_ZOf>(abNorm.GetVariable()), Element.Part<V_ZOf>(bcNorm.GetVariable()))
),
CustomMethodType.MultiAction_Value
);
Expand Down

0 comments on commit c25b7e5

Please sign in to comment.