Raycasting in the C++ source
by Quentin Headen · in General Discussion · 06/08/2010 (1:10 am) · 6 replies
Hello everyone! I know how to use the containerRaycast function in Torque Script, but I wanted to do some raycasting with my custom Torque class. How can I do a container raycast in the C++ source side of things?
I am using TGE 1.5.2.
Thanks
I am using TGE 1.5.2.
Thanks
About the author
Just your average programmer who tries to finish the projects he starts. :) I am currently focused on creating games with Torque engines. My website is http://phaseshiftsoftware.com
#2
This seems like the way to go.
Thanks
06/08/2010 (12:11 pm)
Thanks for your quick response. From what I see in this resource, would it be possible to create the start and ending points in C++ and call the Con::execute method to call the containerRaycast script function in the source?This seems like the way to go.
Thanks
#3
06/09/2010 (5:30 am)
You are Welcome.
#4
Calling Con::executef to access an engine-side function is a very backwards solution.
06/10/2010 (12:16 am)
Quentin: Look at Projectile::processTick. It's a matter of calling Container::castRay directly, which means you need a Container object to call it on. Assuming you're inheriting from something like SceneObject, this should be as simple as calling getContainer().Calling Con::executef to access an engine-side function is a very backwards solution.
#5
Thanks again.
06/10/2010 (11:17 am)
Beautiful solution Daniel! I was pretty sure that a raycasting method existed in the source, but I just didn't know where.Thanks again.
#6
06/10/2010 (3:36 pm)
Pleasure! Sometimes the source is quite a jungle to work with ;P.
CloudFire
The Below forum will help you.
http://www.torquepowered.com/community/resources/view/2173