Home | Tutorials | Wiki | Issues
Ask Your Question
0

Why is the sun added twice to a world file?

asked 2018-01-16 04:24:24 -0500

Knueppl gravatar image

When I have created a new world using the GUI and save this world as .world file then the sun is added twice. I found at the top of the world file:

 <light name='sun' type='directional'>
  <cast_shadows>1</cast_shadows>
  <pose frame=''>0 0 10 0 -0 0</pose>
  <diffuse>0.8 0.8 0.8 1</diffuse>
  <specular>0.1 0.1 0.1 1</specular>
  <attenuation>
    <range>1000</range>
    <constant>0.9</constant>
    <linear>0.01</linear>
    <quadratic>0.001</quadratic>
  </attenuation>
  <direction>-0.5 0.5 -1</direction>
</light>

and at the bottom of the file this:

<light name='sun'>
  <pose frame=''>0 0 10 0 -0 0</pose>
</light>

Why is the sun added twice?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-01-16 11:22:16 -0500

When you save a world, the initial state of the world is recorded together with its current state. The first sun in your file describes the initial sun position, the second one describes the sun state the moment the world was saved, note how it is inside a <state> tag.

If you move the sun and save the world again, this change will be reflected on the state (2nd sun), but not on the first one.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-16 04:24:24 -0500

Seen: 62 times

Last updated: Jan 16