Home | Tutorials | Wiki | Issues
Ask Your Question

Why is the sun added twice to a world file?

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

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'>
  <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>
  <direction>-0.5 0.5 -1</direction>

and at the bottom of the file this:

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

Why is the sun added twice?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

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


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

Seen: 44 times

Last updated: Jan 16