playMaker

Author Topic: Vector3 Operator - Dot Product  (Read 2502 times)

emmcd3

  • Playmaker Newbie
  • *
  • Posts: 8
Vector3 Operator - Dot Product
« on: July 04, 2016, 08:46:25 PM »
Hi,

Familiar with how the mechanics and code in C# ...works and going along fine.  Just curious how to implement in PM.  Got as far as  the vectors banging out a nice big number, but, that's nowhere really. Ah, so, I'm just trying get it into in a tidy FSM with use case being a detection of local Z orientation to approximate whether I(player) am with an opponents FOV.  As mentioned, okay with C#, just unsure what PM actions would be necessary for the vector inputs in PM.

Thanks much.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Vector3 Operator - Dot Product
« Reply #1 on: July 05, 2016, 03:01:17 AM »
Hi,

 if you have the line of code in c# to do this, I'll make an fsm template for you.

 Bye,

 Jean

emmcd3

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Vector3 Operator - Dot Product
« Reply #2 on: July 05, 2016, 01:23:57 PM »
Appreciate it much.

I've enclosed the snippet and a visual of the interaction.  In the pic will one GO (bottom) recognizes another GO(top) as being in LOS contact.  In something more realistic there 100 meters or more separating them as well as several contacts.  The bottom would sequence through the list of contacts and modify a threat evaluation method with a float which would help with determining the likelihood of being in the FOV of the enemy.

The mosaic is just a helper routine used from a cover system.  Sorry if a makes a bit confusion.  One ray horizon is coming from each GO and projecting outwards in an arc of ~ 70 degrees.

Thanks 

emmcd3

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Vector3 Operator - Dot Product
« Reply #3 on: July 08, 2016, 01:50:00 PM »
If I were to use the Vector3 Operator FSM and replace the vector3 variable reference with one for a transform.forward reference , what would the be in PM parlance?  Is does seem as simple as that.  Give me a clue and I can go forward from there unless there is something else I'm missing.

Thanks and cheers