Support_ContainerRayCast - Making raycasting easier, one line at a time

View previous topic View next topic Go down

Support_ContainerRayCast - Making raycasting easier, one line at a time

Post  Meshiest on Fri Jan 04, 2013 2:42 am

Title:
Support for Container Raycasts

Author:
Meshiest

Description:
Shortens the amount of lines used in container Raycasts for players
This is also a resource

Usage:
Turning this:
Code:
%start = %this.getEyePoint();
%vec  = %this.getEyeVector();
%end  = vectorAdd(%start,vectorScale(%vec,%distance));
%ray = containerRaycast(%start,%end,%type,%this);
%col = firstWord(%ray);
into this:
Code:
%playerObject.getRayCastObject(%distance,"TypeMask [player/p,vehicle/v,brick/b,alwaysbrick/ab]")

FOR EXAMPLE, if you wanted to get the first vehicle in sight for 64 bricks (32 torque units) you would do:
Code:
talk(findclientbyname("Meshiest").player.getRayCastObject(32,"vehicle"));
and it would return the ID of the first vehicle in front of the player within 64 bricks (32 torque units)

Download:
>>Download<<
or
Download: mediafire.com download.php?h12rzlu5i2463w9


Last edited by Meshiest on Sun Jan 06, 2013 6:34 pm; edited 1 time in total

Meshiest
Blocklandian

Posts : 68
Join date : 2013-01-02
Age : 20
Location : The Internet

View user profile http://marblemodz.forumotion.com

Back to top Go down

Re: Support_ContainerRayCast - Making raycasting easier, one line at a time

Post  Innocent on Fri Jan 04, 2013 6:44 pm

Might be really useful, thanks!
avatar
Innocent
Blocklandian

Posts : 17
Join date : 2012-12-31
Age : 21
Location : Montreal

View user profile

Back to top Go down

Re: Support_ContainerRayCast - Making raycasting easier, one line at a time

Post  Meshiest on Fri Jan 04, 2013 7:26 pm

Innocent wrote:Might be really useful, thanks!
I know, I always forgot the code for container raycasts Razz

Meshiest
Blocklandian

Posts : 68
Join date : 2013-01-02
Age : 20
Location : The Internet

View user profile http://marblemodz.forumotion.com

Back to top Go down

Re: Support_ContainerRayCast - Making raycasting easier, one line at a time

Post  Honor on Sat Jan 05, 2013 2:30 pm

Might use this sometime..
avatar
Honor
Admin

Posts : 56
Join date : 2012-12-27
Age : 20

View user profile http://elitesq.forumotion.com

Back to top Go down

Re: Support_ContainerRayCast - Making raycasting easier, one line at a time

Post  Meshiest on Sat Jan 05, 2013 4:39 pm

Honor wrote:Might use this sometime..
for v2, i might add support for any object instead of just players Razz

Meshiest
Blocklandian

Posts : 68
Join date : 2013-01-02
Age : 20
Location : The Internet

View user profile http://marblemodz.forumotion.com

Back to top Go down

Re: Support_ContainerRayCast - Making raycasting easier, one line at a time

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum