Why is the sun added twice to a world file?
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?
Asked by Knueppl on 2018-01-16 05:24:24 UTC
Answers
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.
Asked by chapulina on 2018-01-16 12:22:16 UTC
Comments