Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parser rewrite. Need Feedback!
09-30-2010, 02:24 PM,
#9
 
Wheel graphics(rotating parts):

Code:
import xs.car

[mesh.tire]
name = fl_tire_mesh
tire = front_tire
scale = 1, -1, 1
;position = 0, 0, 0
;rotation = 0, 0, 0

[mesh.wheel]
name = fl_wheel_mesh
tire = front_tire
mesh = oem_wheel.joe
scale = 1, -1, 1

[mesh.brake]
name = fl_brake_mesh
brake = front_brake
scale = 1, -1, 1

[drawable]
name = fl_tire_draw
mesh = fl_tire_mesh
texture = touring.png
;color = 1, 1, 1, 1

[drawable]
name = fl_wheel_draw
mesh = fr_wheel_mesh
texture = oem_wheel.png

[drawable]
name = fl_brake_draw
mesh = fr_brake_mesh
texture = slotted_shiny.png

[scenenode]
name = fl_wheel_node
drawable = fl_tire_draw, fl_wheel_draw, fl_brake_draw
transform = front_left_wheel.transform
;parent = scene_node

The import directive is needed to get front_tire, front_brake, front_left_wheel objects. The scale is mirroring the mesh. We don't support scaling in the scenenodes(it would affect the normals). This means the above code has to be replicated for each wheel for a default car configuration, doh.

Looks like a lot of boilerplate code. The good thing is that it could be shared using import.

I have to admit that the readability goes down with the number of objects as you have to look for the referenced entities. Any proposals to enhance this are very welcomed. I could compile a list of objects I'd like to expose if there is interest.
Reply


Messages In This Thread
Parser rewrite. Need Feedback! - by NaN - 09-23-2010, 06:21 AM
[No subject] - by cologne - 09-23-2010, 06:54 AM
[No subject] - by NaN - 09-23-2010, 07:30 AM
[No subject] - by NaN - 09-24-2010, 07:45 AM
[No subject] - by cologne - 09-24-2010, 05:46 PM
[No subject] - by NaN - 09-25-2010, 05:43 AM
[No subject] - by cologne - 09-25-2010, 03:51 PM
[No subject] - by NaN - 09-25-2010, 05:12 PM
[No subject] - by NaN - 09-30-2010, 02:24 PM
[No subject] - by NaN - 09-30-2010, 03:39 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)