View unanswered posts | View active topics It is currently Sat Dec 28, 2024 4:52 am



Reply to topic  [ 3 posts ] 
 Request: Tutorial 
Author Message
User avatar

Joined: Fri Mar 13, 2009 2:31 am
Posts: 217
Location: Earth... I think
Reply with quote
Post Request: Tutorial
I have searched for a tutorial on Ray casting and Can not seem to find one.

So if anyone could make a tutorial on rays that would be very very very helpful.

Possible ideas:

Example code and indepth documentation of every (or the non-self explanatory) lines

Description of what to use Rays for and how to use them

Update the Documentation in the Wiki (that is the first thing I go to when I want to make Lua but I can't seem to figure out Ray casting from the wiki)

Thank you very much! and if anyone knows of a tutorial that I didn't find (I searched) then let me know (link to it or something). Also Please if you make this keep the jargon to a minimum I have a basic understanding of Lua and C++ however I am quite good at Visual Basic and .ini coding (who isn't) :)


Thu Oct 22, 2009 3:07 pm
Profile
User avatar

Joined: Wed Mar 24, 2010 4:24 pm
Posts: 13
Reply with quote
Post Re: Request: Tutorial
Ray Casting Tutorial

G'luck, mate, hope this helps.


Fri Mar 26, 2010 1:39 pm
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: Request: Tutorial
Zylos Xenos wrote:
hope this helps.[/center]

No. No, that doesn't work.

MINI-MINI tutorial: How to use an ObstacleRay (the only one I've ever used, but the same should apply to other types)

An ObstacleRayCast returns a number corresponding to how long the ray went before it collided with an object, and the syntax is as follows:
(variable) = SceneMan:CastObstacleRay(
[Vector starting position],
[Vector direction to cast ray along],
[Vector reference (you can make an empty vector) to fill in the coordinates of the first obstacle encountered, if applicable, or end of ray],
[Vector reference (can make empty) to fill in the last free coordinates before the ray hit non-MOs, if applicable, or end of ray],
[A MOID to ignore, children will also be ignored],
[Material ID to ignore hits with],
[How many pixels to skip in between checks (0 will check every pixel, IE, slower)]
);

Put it all together and it looks like this:
self.length = SceneMan:CastObstacleRay(self.Pos, self.Vel * 150, Vector(0, 0), Vector(0, 0), self.ID, 0, 5);

In case you haven't found it already, that and other types of rays can be found documented here.


Fri Mar 26, 2010 4:17 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.033s | 14 Queries | GZIP : Off ]