Home   Help Search Login Register  

Author Topic: Doing Raytracing in ArmA 2 and OFP  (Read 1919 times)

0 Members and 1 Guest are viewing this topic.

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
Doing Raytracing in ArmA 2 and OFP
« on: 08 May 2014, 13:23:26 »
How the hell do you do raytracing? (Calculating the place where a straight-line fired from a position first hits a solid object)

I found an old thread which suggested making a camCreate smokegrenade and giving it a very high setVelocity, then updating its position to a variable when the velocity became zero.
 http://www.ofpec.com/forum/index.php?topic=22254.0
Apparently this worked well. However, I was hoping for something with a bit more finesse.

Someone in the same thread suggested abusing the game's inherent LaserDesignator which accurately paints a spot (whose position can be read by scripts).

For many years I had the idea of creating a new bullet for ArmA 2 or OFP which had no damage, no sound, no tracer and no impact animations - just for the purpose of raytracing.

Does anyone have any ideas? I think the solution would be useful to everybody.
Snarling creature, lurking in the background, still writing in .sqs

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Doing Raytracing in ArmA 2 and OFP
« Reply #1 on: 09 May 2014, 09:49:59 »
In A2 you could try fiddling with lineIntersects or lineIntersectsWith (both OA only).
Obviously this reguires prior knowledge on whether the object type in guestion is solid or not, but basically Strategic and NonStrategic are, etc..

Someone probably has better ideas though.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.