View unanswered posts | View active topics It is currently Fri Apr 19, 2024 2:46 pm



Reply to topic  [ 4 posts ] 
 Vector refence? 
Author Message
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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 ?


Mon May 25, 2009 6:00 pm
Profile
User avatar

Joined: Mon Jun 30, 2008 9:13 pm
Posts: 499
Location: Finland
Reply with quote
Post Re: Vector refence?
I really don't have any idea. There's a working one in luaguns/Guns/swarmer.lua. Maybe that helps.


Mon May 25, 2009 6:07 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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.


Mon May 25, 2009 6:57 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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.


Mon May 25, 2009 10:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.058s | 15 Queries | GZIP : Off ]