I need to write the application code for my attack spells on my game. One of the attacks that the character class I'm working on now has is called "Shockwave" and is similar to the Shockwave of Warcraft 3. I am able to iterate through a list of all characters to see if they should be damaged or not.
What I want to do is damage the players if they are
-Within 50 units of the player
-Within 15 degrees of the direction the player is facing
So basically it'll be a "cone" of damage that gets done to people in front of the character. I know that I can get a directional vector that points from the character firing the spell to an enemy character by using
Vector3f attackAngle = char.getLocalTranslation().subtract(enemy.getLocalTranslation()).normalize()
And that I could compare that directional vector to the direction the attacking character is looking using
float angle = myDirection.angleBetween(attackAngle);
The only problem is that I can't figure out how to get a directional vector for the direction a spatial is facing. I basically need to do the same thing that cam.getDirection() does, except on a spatial. Let me know if you have any suggestions.