Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - DarthBuzzKill

Pages: [1]
1
General / Making a sprite rotate in the direction of the mouse position
« on: November 21, 2014, 12:13:21 am »
So I need to narrow down just how to do this.

I keep seeing different answers which confuse me.

So I assume this means I need to create 2 vectors, one that goes from the sprite to the mouse position, and another that is the unit vector of the sprite, and then work out the cross product, and then get the angle using the cross product.

Is that correct? Or can I also use the dot product to find the angle? From what I've gathered, the Dot Product only takes two vectors that are in the (X, Y) format and are not unit vectors. This is what confuses me about the dot product, because I can only see how to calculate 1 vector when using dot instead of cross. with cross I simply use a unit vector in addition to the other vector. Whereas with dot you apparently can't use a unit vector to find the angle. So in that case, what other vector do I need to calculate, so I can find the angle between that one and the one going to the mouse position.

To add on, what I'm trying to say is: What vectors do I need to create and what product do I need to use to find the angle between those vectors?
The way I see it, no matter which product, I need a distance vector from the sprite to the mouse position. But the 2nd vector seems to differ between the 2 products. So what should the 2nd vector be?

Also, I wouldn't be surprised if thor had some functions to handle all this easily, but I want to do it manually at first.

2
General / How do I represent a mathematical 2D Vector in SFML C++?
« on: November 19, 2014, 06:43:36 pm »
Newbie question I know, but how do I do this in SFML? Since SF::Vectors are not mathematical vectors, just placeholders for multiple parameters.

3
General / Rotating the Y Axis with the rotation of a Sprite (C++)
« on: November 17, 2014, 09:09:49 pm »
How would I go about doing this in SFML? So if I have a ship that rotates, it's missiles should fire based on it's direction. If I can't rotate the Y axis with the sprite, what other method could I use to achieve this?

4
Full message as follows:

The program can't start because OpenAL32.dll is missing from your computer. Try reinstalling the program to fix this problem.   

This happened when I included the audio library and correctly setup a sound to play after placing it into my project's folder. Even after removing the audio file from the project folder and the audio library, it still gives me the error. Any suggestions?

I am using SFML 2.1

Pages: [1]
anything