Skip to main content
GameDev.net gamedev.net
🔒 Locked

Probably a very simple problem

Started by Nibbles Jul 30, 2001 at 3:41 PM 2 replies 250+ views
Original Post
Nibbles
Nibbles
hi, I''m working on a camera and I can''t get this to work:
  
void Init_Camera(CCamera Camera)
{
	CVector PositionVectorTemp =	{ 0.0f, 0.0f, 0.0f };
	CVector UpVectorTemp =			{ 0.0f, 1.0f, 0.0f };
	CVector ViewVectorTemp =		{ 0.0f, 0.0f, 1.0f };

	Camera.PositionVector = PositionVectorTemp;
	Camera.UpVector = UpVectorTemp;
	Camera.ViewVector = ViewVectorTemp;
}
  
getting Camera.PositionVector (or any other one), doesn''t get the data from PositionVectorTemp (or any other). Was wondering why. Thanks, Scott Email Website
"If you try and don''t succeed, destroy all evidence that you tried."
Stoffel
Stoffel
Because your original version is "pass by value", meaning a new camera is copied from your argument and passed to the function. The second version is "pass by reference", where the actual argument is passed into the function. Without using "*" or "&" on your arguments, they are all passed by value.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.