Cuberite Forum
LookVector - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: LookVector (/thread-1371.html)



LookVector - daniel0916 - 02-13-2014

I will check if a Entity is in the LookVector of a player.
Is this possible for MCServer?

And give it a function to get the NearbyEntities?


RE: LookVector - xoft - 02-13-2014

Every cEntity instance has a GetLookVector() function that returns the look vector. However, you will need to implement finding entities being looked at yourself.


RE: LookVector - daniel0916 - 02-15-2014

Okay, this don't belong to this but i will ask for this here:

I become this error on compiling ("unresolved external symbol") when i will make a boolean static.
static bool m_test;

Edit: I added this to a new file.. maybe i need to include something or so?


RE: LookVector - worktycho - 02-15-2014

If you add a file you usually need to rerun cmake to regenerate the makefiles/projectfiles.


RE: LookVector - FakeTruth - 02-15-2014

If it's a member variable you also need to define it in a cpp file. Google should also help a lot with compiler errors Wink


RE: LookVector - daniel0916 - 02-15-2014

After i done "cmake ." the same error.

Edit: I didn't see FakeTruth's comment.

(02-15-2014, 04:27 AM)FakeTruth Wrote: If it's a member variable you also need to define it in a cpp file. Google should also help a lot with compiler errors Wink

I made it static.. i can't define it in the constrcutor when it is static.
I didn't find good answers...


RE: LookVector - FakeTruth - 02-15-2014

See the second answer: http://stackoverflow.com/questions/195207/unresolved-external-symbol-on-static-class-members