roc/enums.py
2011-06-15 19:21:13 -06:00

58 lines
1.9 KiB
Python
Executable file

class enum(object):
pass
def reverse(enumobj, value):
for name in dir(enumobj):
if name[0] == '_':
continue
if value == eval("enumobj.%s" % (name,)):
return name
return None
# render types (for model.renderable_layer)
rt = enum()
rt.model = 0 # a 3d model made out of triangles, go figure!
rt.sprite = 1 # a 2d texture applied to a 2d plane.
rt.beam = 2 # a 2d plane between two points, similar to a sprite
# rendering billboard modes (for model.renderable_layer)
rtbb = enum()
rtbb.none = 0 # not billboarded, has its own independent rotation
rtbb.full = 1 # the sprite always squarely faces the camera with no rotation, only its position is relevant
rtbb.yaxis = 2 # pitch and yaw axes are available for rotation, but rotation around the roll axis is always fixed to face the camera.
# coordinate mode
cm = enum()
cm.universe = 0
cm.camera = 1
cm.relative = 2
cm.aa_relative = 3
# log level
logl = enum()
logl.debug = 9
logl.info = 8
logl.warn = 4
logl.err = 2
logl.crit = 0
# pipelines
pl = enum()
pl.camera = 0
pl.player = 1
pl.model = 2
pl.shadow = 3
pl.particle = 4
pl.sprite = 5
pl.composite1 = 6
pl.composite2 = 7
tt = enum()
tt.diffuse = 0 # the diffuse texture sets the colors and general brightness of the texture. if the same texture is used as the emissive texture, the model is effectively "fullbright"
tt.emissive = 1 # this texture is blended with the diffuse texture as the light level drops (this can be used to add running lights or glow to a ship, or light up the dark side of a planet, otherwise pure "black" is a good choice)
tt.specular = 2 # adding a specular map allows you to add areas of low or high reflectivity to your texture
tt.normal = 3 # normal maps allow bump mapping and other tweaks, with each channel representing the direction of the normal (red = -1x to 1x, green = -1y to 1y, blue = 0z to 1z)