Data Realms Fan Forums
http://45.55.195.193/

Vector refence?
http://45.55.195.193/viewtopic.php?f=73&t=14955
Page 1 of 1

Author:  mail2345 [ Mon May 25, 2009 6:00 pm ]
Post subject:  Vector refence?

I have been trying to use SceneMan:CastObstacleRay().

Unforntuantly, I have no idea how in lua to pass a reference to a C++ function.

The console says
Code:
ERROR: no overload of  'SceneManager:CastObstacleRay' matched the arguments (SceneManager, const Vector, Vector, const Vector, const Vector, number, number, number)
candidates are:
SceneManager:CastObstacleRay(const Vector&, const Vector&, Vector&, Vector&, number, number, number)


How do I send it a Vector reference ?

Author:  piipu [ Mon May 25, 2009 6:07 pm ]
Post subject:  Re: Vector refence?

I really don't have any idea. There's a working one in luaguns/Guns/swarmer.lua. Maybe that helps.

Author:  Grif [ Mon May 25, 2009 6:57 pm ]
Post subject:  Re: Vector refence?

The problem is with Data just passing C++ functions through Lua.

Apparently he's working on documenting this further, as of an email sent to Daman last night.

Author:  mail2345 [ Mon May 25, 2009 10:16 pm ]
Post subject:  Re: Vector refence?

I managed to fix it!

Instead of the last two vectors being a copy of another vector, I just put in Vector(0,0) as the arguments.

For the first argument, changing it from
Code:
projectile.Pos

to
Code:
Vector(projectile.Pos.X,projectile.Pos.Y)

fixed it.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/