Space Engineers

Space Engineers

View Stats:
This topic has been locked
Samathy Nov 22, 2016 @ 4:18pm
What is Raycast?
Self explanatory question, I cant find info about what it actually is.
< >
Showing 1-8 of 8 comments
Hornedmarten Nov 22, 2016 @ 5:26pm 
its not 3d, its bascily a sudo 3d computer grpahics style that projects 2 images as 3d enviroments, its how doom has that weird almost 3d but not quite effect
Samathy Nov 22, 2016 @ 5:36pm 
Originally posted by CGNHornedmarten:
its not 3d, its bascily a sudo 3d computer grpahics style that projects 2 images as 3d enviroments, its how doom has that weird almost 3d but not quite effect
But how would that be implemented in a 3D game?
Avatar Nov 22, 2016 @ 6:32pm 
What exactly can raycasting allow you to do that you could not before its implementation?
lblackthorne Nov 22, 2016 @ 8:14pm 
CCTV cameras.
Fury6 Nov 22, 2016 @ 8:38pm 
Raycasting was initially developed as a rendering technique back in the early 80's, though the technical aspects of the solution it provides lends itself to being useful in solving other problems as well (e.g. line-of-sight/boresight calculation).

I haven't looked into the specifics of how it's used in Space Engineers but there are many potential uses (eg. target tracking for comms or weapon systems). I'm assuming it's user exposed at some level, which would be truly awesome.
Last edited by Fury6; Nov 22, 2016 @ 8:42pm
Loues.S.Cat Nov 22, 2016 @ 9:25pm 
You weren't here when I started going slightly crazy and breaching how raycasting is the best thing since the laser antenna? XD

http://steamcommunity.com/app/244850/discussions/0/215439774860017710/?ctp=2

Well in case you missed it Raycasting is the best thing since the laser antenna! ^.^

Don't use it the way I did XD
Well... do, because it is fun. but don't because it is horribly efficient XD

  • Raycasting projects a 1 dimensional ray at an angle through 3d space.
  • The origin point is a camera you choose.
  • If the ray intersects another object it returns a dataobject containing information about the object it intersected.
  • A ray only returns information about the first object it intersects and after that the calculation ends so no detecting the ship hiding behind that moon. (this also lets you know if a ray hits nothing)
  • The rays use charge from the camera told to project the ray. the charge used is equivalent to the length of the ray regardless of if or where it hit something.
  • Cameras charge at a rate of 2000 units per second (once raycasting is enabled for them).
  • A camera has to be told to start charging for raycasting (by the programable block)
  • Once charging a camera will build up charge every second forever (or so it seems)
  • A raycasting camera will use 1000W of power compared to the non raycasting camera using only 30W (this power is used while charging not just while projecting rays)
  • cameras have an ark range which they can project rays in. the default camera offers an ark of 45 degrees and that is from positive to negative on both the horizontal and vertical plane relative to the cameras orientation so cameras can project rays from -25 to +45 degrees vertical and -45 to +45 degrees horizontal relative to the direction they are pointing.
  • Ohh and the dataobjects returned by a raycast attempt will contain data about the object it hit such as unique id (long), name, velocity, position (roughly bounding box centre (I think)), orientation, relationship to the camera (friend, foe, allie, neutral) it's type (asteroid, large ship, small ships, metier, missile, floating object), where it was hit (where the ray itself intersected as opposed to the object bounding box centre), bounding box, and time stamp (of data object creation). It also has an IsEmpty method that tells you if it actually contains data on an object or you hit nothing.

Ohh and you can use it to navigate:
http://steamcommunity.com/sharedfiles/filedetails/?id=802399363
I flew though an asteroid using nothing but raycasting to guide me! ^.^
I have no idea why I did, but it was fun! ... wait that is why I did it.
Last edited by Loues.S.Cat; Nov 22, 2016 @ 9:31pm
Da_MLG_man May 28, 2023 @ 11:15am 
Originally posted by Loues.S.Cat:
You weren't here when I started going slightly crazy and breaching how raycasting is the best thing since the laser antenna? XD
  • The rays use charge from the camera told to project the ray. the charge used is equivalent to the length of the ray regardless of if or where it hit something.
Is this length measured in some arbitrary unit or in meters?
yellow51 May 28, 2023 @ 11:32am 
Originally posted by Da_MLG_man:
Originally posted by Loues.S.Cat:
You weren't here when I started going slightly crazy and breaching how raycasting is the best thing since the laser antenna? XD
  • The rays use charge from the camera told to project the ray. the charge used is equivalent to the length of the ray regardless of if or where it hit something.
Is this length measured in some arbitrary unit or in meters?
https://forum.unity.com/threads/what-is-raycast.400698/
https://en.wikipedia.org/wiki/Ray_casting#:~:text=Ray%20casting%20is%20the%20most,scenes%20to%20two-dimensional%20images.

Also, this thread will get locked. It's better to start a new thread, as this thread is 7-8 years old now.
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Nov 22, 2016 @ 4:18pm
Posts: 8