Let's Play: Guess what this Variable should be!

So, basically we are trying to find the distance between a plane and the center of a ball in a 2D view of a pooltable program that shoots a ball that bounces the walls of the pooltable.

 
??? distance = pool_table.plane[pl] * Vector4D(center, 1)


What variable type should this be? I guessed Scalar, but my program gives errors with that.
Last edited on
auto?

Are you asking a question or playing a game?

If you are asking a question, ask a friggin question :p If it's a game, please move it to the lounge.

[..]my program gives errors[..]

I am assuming that it would be something like:

"Hey, you gave me *blank* but I was expecting *blank*", in which case you should be able to determine what type distance should be.
I was adding humor to my question haha. But only because my professor gave that line of code as a clue to what would be inside one of the functions. I tried using auto and it gave the same result as when using Scalar for distance.

I guess its safe to say the flaw is with other parts of my code, and not because of the variable type.

Thanks for playing though :)
I was adding humor to my question haha.

I realized (after I decided to go to bed) that my post could be taken the wrong way, almost offensively (which is not how I intended it, I swear) so I have to say I'm glad you didn't take it too heavily :D

Are you compiling with C++11 support (some compilers default to the 98/ 03 standard). For example, g++ would require that you use the -std=c++11 flag. If auto still doesn't work, then there maybe something else wrong (hard to believe, right? haha).

Could you post the error messages that you get? You may also need to post more code (or just explain what Scalar, plane and what Vector4D represent if you aren't allowed/ comfortable with actually posting [which can be expected with school assignments]). Without further context it will be hard to tell what is happening (and the people who actually know what they are talking about [so pretty much anyone but me] will have a much more difficult time helping you).
Last edited on
Speaking of humour, I like this a lot :+D

Danny Toledo wrote:
auto?


@jheard901

When you say scalar - guessing you meant double ? You could use Scalar if you typedef 'd it, or made a class out it.
Topic archived. No new replies allowed.