User Tools

Site Tools


en:tutorials:physics:raycasting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:tutorials:physics:raycasting [2022/05/08 11:44 (3 years ago)] – Minor edits iarwainen:tutorials:physics:raycasting [2022/05/08 23:03 (3 years ago)] (current) sausage
Line 73: Line 73:
 {{ :en:tutorials:physics:ore.png?nolink |}} {{ :en:tutorials:physics:ore.png?nolink |}}
  
-Change the default [Object] section to use the ore.png texture (and make it smaller):+Change the default ''[Object]'' section to use the ore.png texture (and make it smaller):
  
 <code ini> <code ini>
Line 84: Line 84:
 </code> </code>
  
-Change the application to be a standard window so that you can easily get to the console window behind. We'll need to see our logging later.+Give that a quick run and you should get a rotating rock: 
 + 
 +{{ :en:tutorials:physics:object-for-raycasting.png?nolink |}} 
 + 
 +Change the application to be a standard window so that you can easily get to the console window behind. We'll need be able to see our logging later
 + 
 +<code ini> 
 +[Display] 
 +Decoration      = true 
 +... 
 +... 
 +</code>
  
 Add a body to the object so that physics will be enabled on it. Raycasts can only locate objects with bodies: Add a body to the object so that physics will be enabled on it. Raycasts can only locate objects with bodies:
Line 114: Line 125:
 ShowDebug = true ShowDebug = true
 </code> </code>
- 
-Give that a quick run and you should get a rotating rock with the physics debug border surrounding the object. 
- 
-{{ :en:tutorials:physics:object-for-raycasting.png?nolink |}} 
  
 Now to do the raycast on every frame. Add to the Update() function: Now to do the raycast on every frame. Add to the Update() function:
en/tutorials/physics/raycasting.1652035446.txt.gz · Last modified: 2022/05/08 11:44 (3 years ago) by iarwain