Page 1 of 1

Getting camera position

Posted: Tue Apr 06, 2004 4:34 pm
by Tyn
Hey

I am trying to get the camera position with

Code: Select all

irr::core::vector3df* = camera->getPosition();
But VC++ is spitting out a C2679 error, I think it means that it doesn't like the conversion but the API says it should be right. Anyone got any ideas?

Posted: Tue Apr 06, 2004 4:37 pm
by enforceman
Hi!

getPosition() doesn't return a pointer. It just returns a irr::core::vector3df.

it must be:

irr::core::vector3df = camera->getPosition();


regards, Tom

Posted: Tue Apr 06, 2004 4:40 pm
by Tyn
Oops, I missed a bit out there. It should be:

Code: Select all

irr::core::vector3df* camPos = camera->getPosition();
Note to self: Always copy straight from source :D

Posted: Tue Apr 06, 2004 9:08 pm
by enforceman
sorry... I made a mistake... ;( I forgot the variable

it must be

irr::core::vector3df camPos = camera->getPosition();

so, now we got it!

Posted: Tue Apr 06, 2004 11:11 pm
by Guest
Nope, I wasn't clear last time soz, I did irr::core::vector3df* camPos = camera->getPosition(); but that caused the error, the first one I posted was a typo :oops: