This commit is contained in:
monsterkodi 2016-08-20 19:18:37 +02:00
parent b9cb4c7759
commit bd6e7823e4
9 changed files with 553 additions and 392 deletions

View File

@ -11,15 +11,21 @@ class Face
@orientationForFace: (face) ->
switch face % 6
when 0 then return Quaternion.rot_90_Y
when 1 then return Quaternion.rot_0
when 2 then return Quaternion.rot_270_X
when 3 then return Quaternion.rot_270_Y
when 4 then return Quaternion.rot_90_X
when 5 then return Quaternion.rot_180_X
# when 0 then return Quaternion.rot_90_Y
# when 1 then return Quaternion.rot_0
# when 2 then return Quaternion.rot_270_X
# when 3 then return Quaternion.rot_270_Y
# when 4 then return Quaternion.rot_90_X
# when 5 then return Quaternion.rot_180_X
when 0 then return Quaternion.rot_90_Y
when 1 then return Quaternion.rot_90_X
when 2 then return Quaternion.rot_0
when 3 then return Quaternion.rot_270_Y
when 4 then return Quaternion.rot_270_X
when 5 then return Quaternion.rot_180_X
@normalVectorForFace: (face) ->
o = (face < 3) and -1 or 1
o = (face < 3) and 1 or -1
switch face % 3
when 0 then return new Vector o, 0, 0
when 1 then return new Vector 0, o, 0

View File

@ -54,10 +54,10 @@ class Gate extends Switch
bulletImpact: ->
newCellMate: (object) ->
log "gate.newCellMate --------------------------- #{object.name} #{@active}"
# log "gate.newCellMate --------------------------- #{object.name} #{@active}"
if object.name == 'player' and @active
world.playSound 'GATE_WARP'
log "gate.newCellMate --------------------------- trigger enter event actions"
# log "gate.newCellMate --------------------------- trigger enter event actions"
@events[@ENTER_EVENT].triggerActions()
renderBar: (r,b,h) ->

View File

@ -4,6 +4,7 @@
# 000 000 000 000 000 000 000
# 0000000 00000000 000 000 000 000
log = require '/Users/kodi/s/ko/js/tools/log'
Valve = require './valve'
Action = require './action'
Pos = require './lib/pos'
@ -12,13 +13,15 @@ Geom = require './geom'
class Gear extends Valve
constructor: (face) ->
constructor: (@face) ->
geom = Geom.gear()
@mesh = new THREE.Mesh geom, Cage.cageMat
@mesh.receiveShadow = true
super face
super @face
# log "gear.constructor #{@face}"
@updateMesh()
getNeighborDirections: (face) ->
neighbors = [

View File

@ -1,385 +1,496 @@
# 0000000 00000000 0000000 00 00
# 000 000 000 000 000 000
# 000 0000 0000000 000 000 000000000
# 000 000 000 000 000 000 0 000
# 0000000 00000000 0000000 000 000
log = require '/Users/kodi/s/ko/js/tools/log'
Vector = require './lib/vector'
class Geom
@gear: ->
# glInterleavedArrays (GL_N3F_V3F, 0, gearInterleavedQuads)
# glDrawArrays (GL_QUADS, 0, gearNumQuads*4)
# glInterleavedArrays (GL_N3F_V3F, 0, gearInterleavedQuadStrips)
# for (int i = 0; i < gearNumQuadStrips; i++)
# glDrawArrays (GL_QUAD_STRIP, gearQuadStripIndices[i]/6
# (gearQuadStripIndices[i+1] - gearQuadStripIndices[i])/6)
quads = @gearInterleavedQuads
numQuads = quads.length/24
triangles = numQuads * 2
positions = new Float32Array triangles * 3 * 3
normals = new Float32Array triangles * 3 * 3
quads = 48 + 16 * 3
quads += 4 + 5*8 # valve
pi = -1
triangles = quads * 2
positions = new Float32Array triangles * 9
normals = new Float32Array triangles * 9
pi = -1
pi = @quadList positions, normals, pi, @valveQuads
pi = @quadStrip positions, normals, pi, @valveQuadStrip1
pi = @quadStrip positions, normals, pi, @valveQuadStrip2
pi = @quadStrip positions, normals, pi, @valveQuadStrip3
pi = @quadStrip positions, normals, pi, @valveQuadStrip4
pi = @quadStrip positions, normals, pi, @valveQuadStrip5
pi = @quadList positions, normals, pi, @gearQuads
pi = @quadStrip positions, normals, pi, @gearQuadStrip1
pi = @quadStrip positions, normals, pi, @gearQuadStrip2
pi = @quadStrip positions, normals, pi, @gearQuadStrip3
geom = new THREE.BufferGeometry
geom.addAttribute 'position', new THREE.BufferAttribute positions, 3
geom.addAttribute 'normal', new THREE.BufferAttribute normals, 3
geom.translate 0,0,0.4
geom
@quadList: (positions, normals, pi, quads) ->
numQuads = quads.length/24
for q in [0...numQuads]
qi = q * 24
for j in [0,1,2,0,2,3]
jj = j * 6
for i in [0...3]
positions[pi+=1] = quads[qi+jj+i+3]; normals[pi] = quads[qi+jj+i]
geom = new THREE.BufferGeometry
geom.addAttribute 'position', new THREE.BufferAttribute positions, 3
geom.addAttribute 'normal', new THREE.BufferAttribute normals, 3
geom
@gearInterleavedQuads = [ # 1152 = 48 * 24
0.981, 0.195, -0.000, 0.375, 0.155, 0.087,
0.981, 0.195, -0.000, 0.406, -0.000, 0.087,
0.981, 0.195, -0.000, 0.406, -0.000, -0.087,
0.981, 0.195, -0.000, 0.375, 0.155, -0.087,
positions[pi+=1] = quads[qi+jj+i+3]
normals[pi] = quads[qi+jj+i]
pi
0.556, 0.831, -0.000, 0.155, 0.375, 0.087,
0.556, 0.831, -0.000, 0.287, 0.287, 0.087,
0.556, 0.831, -0.000, 0.287, 0.287, -0.087,
0.556, 0.831, -0.000, 0.155, 0.375, -0.087,
@quadStrip: (positions, normals, pi, strip) ->
numQuads = strip.length/12-2
for q in [0...numQuads]
qi = q * 12
for j in [0,1,2,2,1,3]
jj = j*6
for i in [0...3]
positions[pi+=1] = strip[qi+jj+i+3]
normals[pi] = strip[qi+jj+i]
pi
-0.195, 0.981, -0.000,-0.155, 0.375, 0.087,
-0.195, 0.981, -0.000, 0.000, 0.406, 0.087,
-0.195, 0.981, -0.000, 0.000, 0.406, -0.087,
-0.195, 0.981, -0.000,-0.155, 0.375, -0.087,
-0.831, 0.556, -0.000,-0.375, 0.155, 0.087,
-0.831, 0.556, -0.000,-0.287, 0.287, 0.087,
-0.831, 0.556, -0.000,-0.287, 0.287, -0.087,
-0.831, 0.556, -0.000,-0.375, 0.155, -0.087,
-0.981, -0.195, 0.000,-0.375, -0.155, 0.087,
-0.981, -0.195, 0.000,-0.406, 0.000, 0.087,
-0.981, -0.195, 0.000,-0.406, 0.000, -0.087,
-0.981, -0.195, 0.000,-0.375, -0.155, -0.087,
-0.556, -0.831, 0.000,-0.155, -0.375, 0.087,
-0.556, -0.831, 0.000,-0.287, -0.287, 0.087,
-0.556, -0.831, 0.000,-0.287, -0.287, -0.087,
-0.556, -0.831, 0.000,-0.155, -0.375, -0.087,
0.195, -0.981, 0.000, 0.155, -0.375, 0.087,
0.195, -0.981, 0.000,-0.000, -0.406, 0.087,
0.195, -0.981, 0.000,-0.000, -0.406, -0.087,
0.195, -0.981, 0.000, 0.155, -0.375, -0.087,
0.831, -0.556, 0.000, 0.375, -0.155, 0.087,
0.831, -0.556, 0.000, 0.287, -0.287, 0.087,
0.831, -0.556, 0.000, 0.287, -0.287, -0.087,
0.831, -0.556, 0.000, 0.375, -0.155, -0.087,
-0.021, -1.000, 0.000, 0.534, -0.159, -0.056,
-0.021, -1.000, 0.000, 0.534, -0.159, 0.056,
-0.021, -1.000, 0.000, 0.375, -0.155, 0.087,
-0.021, -1.000, 0.000, 0.375, -0.155, -0.087,
0.187, -0.037, -0.982, 0.554, -0.058, -0.056,
0.187, -0.037, -0.982, 0.534, -0.159, -0.056,
0.143, -0.046, -0.989, 0.375, -0.155, -0.087,
0.149, -0.012, -0.989, 0.406, -0.000, -0.087,
0.363, 0.932, -0.000, 0.554, -0.058, 0.056,
0.363, 0.932, -0.000, 0.554, -0.058, -0.056,
0.363, 0.932, -0.000, 0.406, -0.000, -0.087,
0.363, 0.932, -0.000, 0.406, -0.000, 0.087,
0.981, -0.195, 0.000, 0.554, -0.058, 0.056,
0.981, -0.195, 0.000, 0.534, -0.159, 0.056,
0.981, -0.195, 0.000, 0.534, -0.159, -0.056,
0.981, -0.195, 0.000, 0.554, -0.058, -0.056,
0.187, -0.037, 0.982, 0.534, -0.159, 0.056,
0.187, -0.037, 0.982, 0.554, -0.058, 0.056,
0.149, -0.012, 0.989, 0.406, -0.000, 0.087,
0.143, -0.046, 0.989, 0.375, -0.155, 0.087,
-0.722, -0.692, 0.000, 0.266, -0.490, -0.056,
-0.722, -0.692, 0.000, 0.266, -0.490, 0.056,
-0.722, -0.692, 0.000, 0.155, -0.375, 0.087,
-0.722, -0.692, 0.000, 0.155, -0.375, -0.087,
0.106, -0.159, -0.982, 0.351, -0.433, -0.056,
0.106, -0.159, -0.982, 0.266, -0.490, -0.056,
0.069, -0.133, -0.989, 0.155, -0.375, -0.087,
0.097, -0.114, -0.989, 0.287, -0.287, -0.087,
0.916, 0.402, -0.000, 0.351, -0.433, 0.056,
0.916, 0.402, -0.000, 0.351, -0.433, -0.056,
0.916, 0.402, -0.000, 0.287, -0.287, -0.087,
0.916, 0.402, -0.000, 0.287, -0.287, 0.087,
0.556, -0.831, 0.000, 0.351, -0.433, 0.056,
0.556, -0.831, 0.000, 0.266, -0.490, 0.056,
0.556, -0.831, 0.000, 0.266, -0.490, -0.056,
0.556, -0.831, 0.000, 0.351, -0.433, -0.056,
0.106, -0.159, 0.982, 0.266, -0.490, 0.056,
0.106, -0.159, 0.982, 0.351, -0.433, 0.056,
0.097, -0.114, 0.989, 0.287, -0.287, 0.087,
0.069, -0.133, 0.989, 0.155, -0.375, 0.087,
-1.000, 0.021, -0.000,-0.159, -0.534, -0.056,
-1.000, 0.021, -0.000,-0.159, -0.534, 0.056,
-1.000, 0.021, -0.000,-0.155, -0.375, 0.087,
-1.000, 0.021, -0.000,-0.155, -0.375, -0.087,
-0.037, -0.187, -0.982,-0.058, -0.554, -0.056,
-0.037, -0.187, -0.982,-0.159, -0.534, -0.056,
-0.046, -0.143, -0.989,-0.155, -0.375, -0.087,
-0.012, -0.149, -0.989,-0.000, -0.406, -0.087,
0.932, -0.363, 0.000,-0.058, -0.554, 0.056,
0.932, -0.363, 0.000,-0.058, -0.554, -0.056,
0.932, -0.363, 0.000,-0.000, -0.406, -0.087,
0.932, -0.363, 0.000,-0.000, -0.406, 0.087,
-0.195, -0.981, 0.000,-0.058, -0.554, 0.056,
-0.195, -0.981, 0.000,-0.159, -0.534, 0.056,
-0.195, -0.981, 0.000,-0.159, -0.534, -0.056,
-0.195, -0.981, 0.000,-0.058, -0.554, -0.056,
-0.037, -0.187, 0.982,-0.159, -0.534, 0.056,
-0.037, -0.187, 0.982,-0.058, -0.554, 0.056,
-0.012, -0.149, 0.989,-0.000, -0.406, 0.087,
-0.046, -0.143, 0.989,-0.155, -0.375, 0.087,
-0.692, 0.722, -0.000,-0.490, -0.266, -0.056,
-0.692, 0.722, -0.000,-0.490, -0.266, 0.056,
-0.692, 0.722, -0.000,-0.375, -0.155, 0.087,
-0.692, 0.722, -0.000,-0.375, -0.155, -0.087,
-0.159, -0.106, -0.982,-0.433, -0.351, -0.056,
-0.159, -0.106, -0.982,-0.490, -0.266, -0.056,
-0.133, -0.069, -0.989,-0.375, -0.155, -0.087,
-0.114, -0.097, -0.989,-0.287, -0.287, -0.087,
0.402, -0.916, 0.000,-0.433, -0.351, 0.056,
0.402, -0.916, 0.000,-0.433, -0.351, -0.056,
0.402, -0.916, 0.000,-0.287, -0.287, -0.087,
0.402, -0.916, 0.000,-0.287, -0.287, 0.087,
-0.831, -0.556, 0.000,-0.433, -0.351, 0.056,
-0.831, -0.556, 0.000,-0.490, -0.266, 0.056,
-0.831, -0.556, 0.000,-0.490, -0.266, -0.056,
-0.831, -0.556, 0.000,-0.433, -0.351, -0.056,
-0.159, -0.106, 0.982,-0.490, -0.266, 0.056,
-0.159, -0.106, 0.982,-0.433, -0.351, 0.056,
-0.114, -0.097, 0.989,-0.287, -0.287, 0.087,
-0.133, -0.069, 0.989,-0.375, -0.155, 0.087,
0.021, 1.000, -0.000,-0.534, 0.159, -0.056,
0.021, 1.000, -0.000,-0.534, 0.159, 0.056,
0.021, 1.000, -0.000,-0.375, 0.155, 0.087,
0.021, 1.000, -0.000,-0.375, 0.155, -0.087,
-0.187, 0.037, -0.982,-0.554, 0.058, -0.056,
-0.187, 0.037, -0.982,-0.534, 0.159, -0.056,
-0.143, 0.046, -0.989,-0.375, 0.155, -0.087,
-0.149, 0.012, -0.989,-0.406, 0.000, -0.087,
-0.363, -0.932, 0.000,-0.554, 0.058, 0.056,
-0.363, -0.932, 0.000,-0.554, 0.058, -0.056,
-0.363, -0.932, 0.000,-0.406, 0.000, -0.087,
-0.363, -0.932, 0.000,-0.406, 0.000, 0.087,
-0.981, 0.195, -0.000,-0.554, 0.058, 0.056,
-0.981, 0.195, -0.000,-0.534, 0.159, 0.056,
-0.981, 0.195, -0.000,-0.534, 0.159, -0.056,
-0.981, 0.195, -0.000,-0.554, 0.058, -0.056,
-0.187, 0.037, 0.982,-0.534, 0.159, 0.056,
-0.187, 0.037, 0.982,-0.554, 0.058, 0.056,
-0.149, 0.012, 0.989,-0.406, 0.000, 0.087,
-0.143, 0.046, 0.989,-0.375, 0.155, 0.087,
0.722, 0.692, -0.000,-0.266, 0.490, -0.056,
0.722, 0.692, -0.000,-0.266, 0.490, 0.056,
0.722, 0.692, -0.000,-0.155, 0.375, 0.087,
0.722, 0.692, -0.000,-0.155, 0.375, -0.087,
-0.106, 0.159, -0.982,-0.351, 0.433, -0.056,
-0.106, 0.159, -0.982,-0.266, 0.490, -0.056,
-0.069, 0.133, -0.989,-0.155, 0.375, -0.087,
-0.097, 0.114, -0.989,-0.287, 0.287, -0.087,
-0.916, -0.402, 0.000,-0.351, 0.433, 0.056,
-0.916, -0.402, 0.000,-0.351, 0.433, -0.056,
-0.916, -0.402, 0.000,-0.287, 0.287, -0.087,
-0.916, -0.402, 0.000,-0.287, 0.287, 0.087,
-0.556, 0.831, -0.000,-0.351, 0.433, 0.056,
-0.556, 0.831, -0.000,-0.266, 0.490, 0.056,
-0.556, 0.831, -0.000,-0.266, 0.490, -0.056,
-0.556, 0.831, -0.000,-0.351, 0.433, -0.056,
-0.106, 0.159, 0.982,-0.266, 0.490, 0.056,
-0.106, 0.159, 0.982,-0.351, 0.433, 0.056,
-0.097, 0.114, 0.989,-0.287, 0.287, 0.087,
-0.069, 0.133, 0.989,-0.155, 0.375, 0.087,
1.000, -0.021, 0.000, 0.159, 0.534, -0.056,
1.000, -0.021, 0.000, 0.159, 0.534, 0.056,
1.000, -0.021, 0.000, 0.155, 0.375, 0.087,
1.000, -0.021, 0.000, 0.155, 0.375, -0.087,
0.037, 0.187, -0.982, 0.058, 0.554, -0.056,
0.037, 0.187, -0.982, 0.159, 0.534, -0.056,
0.046, 0.143, -0.989, 0.155, 0.375, -0.087,
0.012, 0.149, -0.989, 0.000, 0.406, -0.087,
-0.932, 0.363, -0.000, 0.058, 0.554, 0.056,
-0.932, 0.363, -0.000, 0.058, 0.554, -0.056,
-0.932, 0.363, -0.000, 0.000, 0.406, -0.087,
-0.932, 0.363, -0.000, 0.000, 0.406, 0.087,
0.195, 0.981, -0.000, 0.058, 0.554, 0.056,
0.195, 0.981, -0.000, 0.159, 0.534, 0.056,
0.195, 0.981, -0.000, 0.159, 0.534, -0.056,
0.195, 0.981, -0.000, 0.058, 0.554, -0.056,
0.037, 0.187, 0.982, 0.159, 0.534, 0.056,
0.037, 0.187, 0.982, 0.058, 0.554, 0.056,
0.012, 0.149, 0.989, 0.000, 0.406, 0.087,
0.046, 0.143, 0.989, 0.155, 0.375, 0.087,
0.692, -0.722, 0.000, 0.490, 0.266, -0.056,
0.692, -0.722, 0.000, 0.490, 0.266, 0.056,
0.692, -0.722, 0.000, 0.375, 0.155, 0.087,
0.692, -0.722, 0.000, 0.375, 0.155, -0.087,
0.159, 0.106, -0.982, 0.433, 0.351, -0.056,
0.159, 0.106, -0.982, 0.490, 0.266, -0.056,
0.133, 0.069, -0.989, 0.375, 0.155, -0.087,
0.114, 0.097, -0.989, 0.287, 0.287, -0.087,
-0.402, 0.916, -0.000, 0.433, 0.351, 0.056,
-0.402, 0.916, -0.000, 0.433, 0.351, -0.056,
-0.402, 0.916, -0.000, 0.287, 0.287, -0.087,
-0.402, 0.916, -0.000, 0.287, 0.287, 0.087,
0.831, 0.556, -0.000, 0.433, 0.351, 0.056,
0.831, 0.556, -0.000, 0.490, 0.266, 0.056,
0.831, 0.556, -0.000, 0.490, 0.266, -0.056,
0.831, 0.556, -0.000, 0.433, 0.351, -0.056,
0.159, 0.106, 0.982, 0.490, 0.266, 0.056,
0.159, 0.106, 0.982, 0.433, 0.351, 0.056,
0.114, 0.097, 0.989, 0.287, 0.287, 0.087,
0.133, 0.069, 0.989, 0.375, 0.155, 0.087]
@valveQuads = [
0, 0, 1, 0.100, 0, 0.500,
0, 0, 1, 0.071, 0.071, 0.500,
0, 0, 1, 0, 0.100, 0.500,
0, 0, 1, 0.071, -0.071, 0.500,
0, 0, 1,-0.100, 0, 0.500,
0, 0, 1,-0.071, -0.071, 0.500,
0, 0, 1, 0, -0.100, 0.500,
0, 0, 1,-0.071, 0.071, 0.500,
0, 0, -1, 0.100, 0, -0.500,
0, 0, -1, 0.071, -0.071, -0.500,
0, 0, -1, 0, -0.100, -0.500,
0, 0, -1, 0.071, 0.071, -0.500,
0, 0, -1,-0.100, 0, -0.500,
0, 0, -1,-0.071, 0.071, -0.500,
0, 0, -1, 0, 0.100, -0.500,
0, 0, -1,-0.071, -0.071, -0.500]
@gearNumQuadStrips = 3
@gearQuadStripIndices = [ 0, 216, 432, 648 ]
@gearInterleavedQuadStrips = [ # 648
0.120, -0.050, 0.991, 0.208, -0.086, 0.111,
0.143, -0.046, 0.989, 0.375, -0.155, 0.087,
0.130, 0.000, 0.991, 0.226, 0.000, 0.111,
0.149, -0.012, 0.989, 0.406, -0.000, 0.087,
0.120, 0.050, 0.991, 0.208, 0.086, 0.111,
0.133, 0.069, 0.989, 0.375, 0.155, 0.087,
0.092, 0.092, 0.991, 0.160, 0.160, 0.111,
0.114, 0.097, 0.989, 0.287, 0.287, 0.087,
0.050, 0.120, 0.991, 0.086, 0.208, 0.111,
0.046, 0.143, 0.989, 0.155, 0.375, 0.087,
-0.000, 0.130, 0.991, -0.000, 0.226, 0.111,
0.012, 0.149, 0.989, 0.000, 0.406, 0.087,
@valveQuadStrip1 = [
0.673, 0.673, 0.308, 0.071, 0.071, -0.346,
0.673, 0.673, 0.308, 0.042, 0.042, -0.220,
0.951, -0.000, 0.308, 0.100, 0.000, -0.346,
0.951, -0.000, 0.308, 0.059, 0.000, -0.220,
0.673, -0.673, 0.308, 0.071, -0.071, -0.346,
0.673, -0.673, 0.308, 0.042, -0.042, -0.220,
-0.000, -0.951, 0.308, 0.000, -0.100, -0.346,
-0.000, -0.951, 0.308, 0.000, -0.059, -0.220,
-0.673, -0.673, 0.308, -0.071, -0.071, -0.346,
-0.673, -0.673, 0.308, -0.042, -0.042, -0.220,
-0.951, -0.000, 0.308, -0.100, 0.000, -0.346,
-0.951, -0.000, 0.308, -0.059, 0.000, -0.220,
-0.673, 0.673, 0.308, -0.071, 0.071, -0.346,
-0.673, 0.673, 0.308, -0.042, 0.042, -0.220,
-0.000, 0.951, 0.308, -0.000, 0.100, -0.346,
-0.000, 0.951, 0.308, -0.000, 0.059, -0.220,
0.673, 0.673, 0.308, 0.071, 0.071, -0.346,
0.673, 0.673, 0.308, 0.042, 0.042, -0.220,
0.951, -0.000, 0.308, 0.100, 0.000, -0.346,
0.951, -0.000, 0.308, 0.059, 0.000, -0.220]
@valveQuadStrip2 = [
0.707, 0.707, 0.000, 0.042, 0.042, -0.220,
0.707, 0.707, 0.000, 0.042, 0.042, 0.220,
1.000, 0.000, 0.000, 0.059, 0.000, -0.220,
1.000, 0.000, 0.000, 0.059, -0.000, 0.220,
0.707, -0.707, -0.000, 0.042, -0.042, -0.220,
0.707, -0.707, -0.000, 0.042, -0.042, 0.220,
0.000, -1.000, -0.000, 0.000, -0.059, -0.220,
0.000, -1.000, -0.000, 0.000, -0.059, 0.220,
-0.707, -0.707, -0.000, -0.042, -0.042, -0.220,
-0.707, -0.707, -0.000, -0.042, -0.042, 0.220,
-1.000, -0.000, 0.000, -0.059, 0.000, -0.220,
-1.000, -0.000, 0.000, -0.059, -0.000, 0.220,
-0.707, 0.707, 0.000, -0.042, 0.042, -0.220,
-0.707, 0.707, 0.000, -0.042, 0.042, 0.220,
-0.000, 1.000, 0.000, -0.000, 0.059, -0.220,
-0.000, 1.000, 0.000, -0.000, 0.059, 0.220,
0.707, 0.707, 0.000, 0.042, 0.042, -0.220,
0.707, 0.707, 0.000, 0.042, 0.042, 0.220,
1.000, 0.000, 0.000, 0.059, 0.000, -0.220,
1.000, 0.000, 0.000, 0.059, -0.000, 0.220]
@valveQuadStrip3 = [
0.707, 0.707, 0.000, 0.071, 0.071, -0.500,
0.707, 0.707, 0.000, 0.071, 0.071, -0.346,
1.000, -0.000, 0.000, 0.100, 0.000, -0.500,
1.000, -0.000, 0.000, 0.100, 0.000, -0.346,
0.707, -0.707, -0.000, 0.071, -0.071, -0.500,
0.707, -0.707, -0.000, 0.071, -0.071, -0.346,
0.000, -1.000, -0.000, 0.000, -0.100, -0.500,
0.000, -1.000, -0.000, 0.000, -0.100, -0.346,
-0.707, -0.707, -0.000, -0.071, -0.071, -0.500,
-0.707, -0.707, -0.000, -0.071, -0.071, -0.346,
-1.000, -0.000, -0.000, -0.100, 0.000, -0.500,
-1.000, -0.000, -0.000, -0.100, 0.000, -0.346,
-0.707, 0.707, 0.000, -0.071, 0.071, -0.500,
-0.707, 0.707, 0.000, -0.071, 0.071, -0.346,
-0.000, 1.000, 0.000, -0.000, 0.100, -0.500,
-0.000, 1.000, 0.000, -0.000, 0.100, -0.346,
0.707, 0.707, 0.000, 0.071, 0.071, -0.500,
0.707, 0.707, 0.000, 0.071, 0.071, -0.346,
1.000, -0.000, 0.000, 0.100, 0.000, -0.500,
1.000, -0.000, 0.000, 0.100, 0.000, -0.346]
@valveQuadStrip4 = [
-0.000, 1.000, 0.000, -0.000, 0.100, 0.354,
-0.000, 1.000, 0.000, -0.000, 0.100, 0.500,
0.707, 0.707, 0.000, 0.071, 0.071, 0.354,
0.707, 0.707, 0.000, 0.071, 0.071, 0.500,
1.000, 0.000, -0.000, 0.100, -0.000, 0.354,
1.000, 0.000, -0.000, 0.100, -0.000, 0.500,
0.707, -0.707, -0.000, 0.071, -0.071, 0.354,
0.707, -0.707, -0.000, 0.071, -0.071, 0.500,
0.000, -1.000, -0.000, 0.000, -0.100, 0.354,
0.000, -1.000, -0.000, 0.000, -0.100, 0.500,
-0.707, -0.707, -0.000, -0.071, -0.071, 0.354,
-0.707, -0.707, -0.000, -0.071, -0.071, 0.500,
-1.000, -0.000, 0.000, -0.100, -0.000, 0.354,
-1.000, -0.000, 0.000, -0.100, -0.000, 0.500,
-0.707, 0.707, 0.000, -0.071, 0.071, 0.354,
-0.707, 0.707, 0.000, -0.071, 0.071, 0.500,
-0.000, 1.000, 0.000, -0.000, 0.100, 0.354,
-0.000, 1.000, 0.000, -0.000, 0.100, 0.500,
0.707, 0.707, 0.000, 0.071, 0.071, 0.354,
0.707, 0.707, 0.000, 0.071, 0.071, 0.500]
@valveQuadStrip5 = [
0.676, 0.676, -0.291, 0.042, 0.042, 0.220,
0.676, 0.676, -0.291, 0.071, 0.071, 0.354,
0.957, 0.000, -0.291, 0.059, -0.000, 0.220,
0.957, 0.000, -0.291, 0.100, -0.000, 0.354,
0.676, -0.676, -0.291, 0.042, -0.042, 0.220,
0.676, -0.676, -0.291, 0.071, -0.071, 0.354,
0.000, -0.957, -0.291, 0.000, -0.059, 0.220,
0.000, -0.957, -0.291, 0.000, -0.100, 0.354,
-0.676, -0.676, -0.291, -0.042, -0.042, 0.220,
-0.676, -0.676, -0.291, -0.071, -0.071, 0.354,
-0.957, 0.000, -0.291, -0.059, -0.000, 0.220,
-0.957, 0.000, -0.291, -0.100, -0.000, 0.354,
-0.676, 0.676, -0.291, -0.042, 0.042, 0.220,
-0.676, 0.676, -0.291, -0.071, 0.071, 0.354,
0.000, 0.957, -0.291, -0.000, 0.059, 0.220,
0.000, 0.957, -0.291, -0.000, 0.100, 0.354,
0.676, 0.676, -0.291, 0.042, 0.042, 0.220,
0.676, 0.676, -0.291, 0.071, 0.071, 0.354,
0.957, 0.000, -0.291, 0.059, -0.000, 0.220,
0.957, 0.000, -0.291, 0.100, -0.000, 0.354]
@gearQuadStrip1 = [
0.120, -0.050, 0.991, 0.208, -0.086, 0.111,
0.143, -0.046, 0.989, 0.375, -0.155, 0.087,
0.130, 0, 0.991, 0.226, 0, 0.111,
0.149, -0.012, 0.989, 0.406, 0, 0.087,
0.120, 0.050, 0.991, 0.208, 0.086, 0.111,
0.133, 0.069, 0.989, 0.375, 0.155, 0.087,
0.092, 0.092, 0.991, 0.160, 0.160, 0.111,
0.114, 0.097, 0.989, 0.287, 0.287, 0.087,
0.050, 0.120, 0.991, 0.086, 0.208, 0.111,
0.046, 0.143, 0.989, 0.155, 0.375, 0.087,
0, 0.130, 0.991, 0, 0.226, 0.111,
0.012, 0.149, 0.989, 0, 0.406, 0.087,
-0.050, 0.120, 0.991, -0.086, 0.208, 0.111,
-0.069, 0.133, 0.989, -0.155, 0.375, 0.087,
-0.092, 0.092, 0.991, -0.160, 0.160, 0.111,
-0.097, 0.114, 0.989, -0.287, 0.287, 0.087,
-0.120, 0.050, 0.991, -0.208, 0.086, 0.111,
-0.143, 0.046, 0.989, -0.375, 0.155, 0.087,
-0.130, 0.000, 0.991, -0.226, 0.000, 0.111,
-0.149, 0.012, 0.989, -0.406, 0.000, 0.087,
-0.130, 0, 0.991, -0.226, 0, 0.111,
-0.149, 0.012, 0.989, -0.406, 0, 0.087,
-0.120, -0.050, 0.991, -0.208, -0.086, 0.111,
-0.133, -0.069, 0.989, -0.375, -0.155, 0.087,
-0.092, -0.092, 0.991, -0.160, -0.160, 0.111,
-0.114, -0.097, 0.989, -0.287, -0.287, 0.087,
-0.050, -0.120, 0.991, -0.086, -0.208, 0.111,
-0.046, -0.143, 0.989, -0.155, -0.375, 0.087,
0.000, -0.130, 0.991, 0.000, -0.226, 0.111,
-0.012, -0.149, 0.989, -0.000, -0.406, 0.087,
0.050, -0.120, 0.991, 0.086, -0.208, 0.111,
0.069, -0.133, 0.989, 0.155, -0.375, 0.087,
0.092, -0.092, 0.991, 0.160, -0.160, 0.111,
0.097, -0.114, 0.989, 0.287, -0.287, 0.087,
0.120, -0.050, 0.991, 0.208, -0.086, 0.111,
0.143, -0.046, 0.989, 0.375, -0.155, 0.087,
0.130, 0.000, 0.991, 0.226, 0.000, 0.111,
0.149, -0.012, 0.989, 0.406, -0.000, 0.087,
-1.000, -0.000, -0.000, 0.226, -0.000, -0.111,
-1.000, -0.000, -0.000, 0.226, 0.000, 0.111,
-0.924, -0.383, 0.000, 0.208, 0.086, -0.111,
-0.924, -0.383, 0.000, 0.208, 0.086, 0.111,
-0.707, -0.707, 0.000, 0.160, 0.160, -0.111,
-0.707, -0.707, 0.000, 0.160, 0.160, 0.111,
-0.383, -0.924, 0.000, 0.086, 0.208, -0.111,
-0.383, -0.924, 0.000, 0.086, 0.208, 0.111,
0.000, -1.000, 0.000, -0.000, 0.226, -0.111,
0.000, -1.000, 0.000, -0.000, 0.226, 0.111,
0.383, -0.924, 0.000, -0.086, 0.208, -0.111,
0.383, -0.924, 0.000, -0.086, 0.208, 0.111,
0.707, -0.707, 0.000, -0.160, 0.160, -0.111,
0.707, -0.707, 0.000, -0.160, 0.160, 0.111,
0.924, -0.383, 0.000, -0.208, 0.086, -0.111,
0.924, -0.383, 0.000, -0.208, 0.086, 0.111,
1.000, 0.000, 0.000, -0.226, -0.000, -0.111,
1.000, 0.000, 0.000, -0.226, 0.000, 0.111,
0.924, 0.383, -0.000, -0.208, -0.086, -0.111,
0.924, 0.383, -0.000, -0.208, -0.086, 0.111,
0.707, 0.707, -0.000, -0.160, -0.160, -0.111,
0.707, 0.707, -0.000, -0.160, -0.160, 0.111,
0.383, 0.924, -0.000, -0.086, -0.208, -0.111,
0.383, 0.924, -0.000, -0.086, -0.208, 0.111,
-0.000, 1.000, -0.000, 0.000, -0.226, -0.111,
-0.000, 1.000, -0.000, 0.000, -0.226, 0.111,
-0.383, 0.924, -0.000, 0.086, -0.208, -0.111,
-0.383, 0.924, -0.000, 0.086, -0.208, 0.111,
-0.707, 0.707, -0.000, 0.160, -0.160, -0.111,
-0.707, 0.707, -0.000, 0.160, -0.160, 0.111,
-0.924, 0.383, -0.000, 0.208, -0.086, -0.111,
-0.924, 0.383, -0.000, 0.208, -0.086, 0.111,
-1.000, -0.000, -0.000, 0.226, -0.000, -0.111,
-1.000, -0.000, -0.000, 0.226, 0.000, 0.111,
-0.924, -0.383, 0.000, 0.208, 0.086, -0.111,
-0.924, -0.383, 0.000, 0.208, 0.086, 0.111,
0.149, -0.012, -0.989, 0.406, -0.000, -0.087,
0.130, -0.000, -0.991, 0.226, -0.000, -0.111,
0.133, 0.069, -0.989, 0.375, 0.155, -0.087,
0.120, 0.050, -0.991, 0.208, 0.086, -0.111,
0.114, 0.097, -0.989, 0.287, 0.287, -0.087,
0.092, 0.092, -0.991, 0.160, 0.160, -0.111,
0.046, 0.143, -0.989, 0.155, 0.375, -0.087,
0.050, 0.120, -0.991, 0.086, 0.208, -0.111,
0.012, 0.149, -0.989, 0.000, 0.406, -0.087,
-0.000, 0.130, -0.991, -0.000, 0.226, -0.111,
0, -0.130, 0.991, 0, -0.226, 0.111,
-0.012, -0.149, 0.989, 0, -0.406, 0.087,
0.050, -0.120, 0.991, 0.086, -0.208, 0.111,
0.069, -0.133, 0.989, 0.155, -0.375, 0.087,
0.092, -0.092, 0.991, 0.160, -0.160, 0.111,
0.097, -0.114, 0.989, 0.287, -0.287, 0.087,
0.120, -0.050, 0.991, 0.208, -0.086, 0.111,
0.143, -0.046, 0.989, 0.375, -0.155, 0.087,
0.130, 0, 0.991, 0.226, 0, 0.111,
0.149, -0.012, 0.989, 0.406, 0, 0.087]
@gearQuadStrip2 = [
-1, 0, 0, 0.226, 0, -0.111,
-1, 0, 0, 0.226, 0, 0.111,
-0.924, -0.383, 0, 0.208, 0.086, -0.111,
-0.924, -0.383, 0, 0.208, 0.086, 0.111,
-0.707, -0.707, 0, 0.160, 0.160, -0.111,
-0.707, -0.707, 0, 0.160, 0.160, 0.111,
-0.383, -0.924, 0, 0.086, 0.208, -0.111,
-0.383, -0.924, 0, 0.086, 0.208, 0.111,
0, -1, 0, 0, 0.226, -0.111,
0, -1, 0, 0, 0.226, 0.111,
0.383, -0.924, 0, -0.086, 0.208, -0.111,
0.383, -0.924, 0, -0.086, 0.208, 0.111,
0.707, -0.707, 0, -0.160, 0.160, -0.111,
0.707, -0.707, 0, -0.160, 0.160, 0.111,
0.924, -0.383, 0, -0.208, 0.086, -0.111,
0.924, -0.383, 0, -0.208, 0.086, 0.111,
1, 0, 0, -0.226, 0, -0.111,
1, 0, 0, -0.226, 0, 0.111,
0.924, 0.383, 0, -0.208, -0.086, -0.111,
0.924, 0.383, 0, -0.208, -0.086, 0.111,
0.707, 0.707, 0, -0.160, -0.160, -0.111,
0.707, 0.707, 0, -0.160, -0.160, 0.111,
0.383, 0.924, 0, -0.086, -0.208, -0.111,
0.383, 0.924, 0, -0.086, -0.208, 0.111,
0, 1, 0, 0, -0.226, -0.111,
0, 1, 0, 0, -0.226, 0.111,
-0.383, 0.924, 0, 0.086, -0.208, -0.111,
-0.383, 0.924, 0, 0.086, -0.208, 0.111,
-0.707, 0.707, 0, 0.160, -0.160, -0.111,
-0.707, 0.707, 0, 0.160, -0.160, 0.111,
-0.924, 0.383, 0, 0.208, -0.086, -0.111,
-0.924, 0.383, 0, 0.208, -0.086, 0.111,
-1, 0, 0, 0.226, 0, -0.111,
-1, 0, 0, 0.226, 0, 0.111,
-0.924, -0.383, 0, 0.208, 0.086, -0.111,
-0.924, -0.383, 0, 0.208, 0.086, 0.111]
@gearQuadStrip3 = [
0.149, -0.012, -0.989, 0.406, 0, -0.087,
0.130, 0, -0.991, 0.226, 0, -0.111,
0.133, 0.069, -0.989, 0.375, 0.155, -0.087,
0.120, 0.050, -0.991, 0.208, 0.086, -0.111,
0.114, 0.097, -0.989, 0.287, 0.287, -0.087,
0.092, 0.092, -0.991, 0.160, 0.160, -0.111,
0.046, 0.143, -0.989, 0.155, 0.375, -0.087,
0.050, 0.120, -0.991, 0.086, 0.208, -0.111,
0.012, 0.149, -0.989, 0, 0.406, -0.087,
0, 0.130, -0.991, 0, 0.226, -0.111,
-0.069, 0.133, -0.989, -0.155, 0.375, -0.087,
-0.050, 0.120, -0.991, -0.086, 0.208, -0.111,
-0.097, 0.114, -0.989, -0.287, 0.287, -0.087,
-0.092, 0.092, -0.991, -0.160, 0.160, -0.111,
-0.143, 0.046, -0.989, -0.375, 0.155, -0.087,
-0.120, 0.050, -0.991, -0.208, 0.086, -0.111,
-0.149, 0.012, -0.989, -0.406, 0.000, -0.087,
-0.130, -0.000, -0.991, -0.226, -0.000, -0.111,
-0.149, 0.012, -0.989, -0.406, 0, -0.087,
-0.130, 0, -0.991, -0.226, 0, -0.111,
-0.133, -0.069, -0.989, -0.375, -0.155, -0.087,
-0.120, -0.050, -0.991, -0.208, -0.086, -0.111,
-0.114, -0.097, -0.989, -0.287, -0.287, -0.087,
-0.092, -0.092, -0.991, -0.160, -0.160, -0.111,
-0.046, -0.143, -0.989, -0.155, -0.375, -0.087,
-0.050, -0.120, -0.991, -0.086, -0.208, -0.111,
-0.012, -0.149, -0.989, -0.000, -0.406, -0.087,
0.000, -0.130, -0.991, 0.000, -0.226, -0.111,
0.069, -0.133, -0.989, 0.155, -0.375, -0.087,
0.050, -0.120, -0.991, 0.086, -0.208, -0.111,
0.097, -0.114, -0.989, 0.287, -0.287, -0.087,
0.092, -0.092, -0.991, 0.160, -0.160, -0.111,
0.143, -0.046, -0.989, 0.375, -0.155, -0.087,
0.120, -0.050, -0.991, 0.208, -0.086, -0.111,
0.149, -0.012, -0.989, 0.406, -0.000, -0.087,
0.130, -0.000, -0.991, 0.226, -0.000, -0.111,
0.133, 0.069, -0.989, 0.375, 0.155, -0.087,
0.120, 0.050, -0.991, 0.208, 0.086, -0.111]
-0.012, -0.149, -0.989, 0, -0.406, -0.087,
0, -0.130, -0.991, 0, -0.226, -0.111,
0.069, -0.133, -0.989, 0.155, -0.375, -0.087,
0.050, -0.120, -0.991, 0.086, -0.208, -0.111,
0.097, -0.114, -0.989, 0.287, -0.287, -0.087,
0.092, -0.092, -0.991, 0.160, -0.160, -0.111,
0.143, -0.046, -0.989, 0.375, -0.155, -0.087,
0.120, -0.050, -0.991, 0.208, -0.086, -0.111,
0.149, -0.012, -0.989, 0.406, 0, -0.087,
0.130, 0, -0.991, 0.226, 0, -0.111,
0.133, 0.069, -0.989, 0.375, 0.155, -0.087,
0.120, 0.050, -0.991, 0.208, 0.086, -0.111]
@gearQuads = [
0.981, 0.195, 0, 0.375, 0.155, 0.087,
0.981, 0.195, 0, 0.406, 0, 0.087,
0.981, 0.195, 0, 0.406, 0, -0.087,
0.981, 0.195, 0, 0.375, 0.155, -0.087,
0.556, 0.831, 0, 0.155, 0.375, 0.087,
0.556, 0.831, 0, 0.287, 0.287, 0.087,
0.556, 0.831, 0, 0.287, 0.287, -0.087,
0.556, 0.831, 0, 0.155, 0.375, -0.087,
-0.195, 0.981, 0,-0.155, 0.375, 0.087,
-0.195, 0.981, 0, 0, 0.406, 0.087,
-0.195, 0.981, 0, 0, 0.406, -0.087,
-0.195, 0.981, 0,-0.155, 0.375, -0.087,
-0.831, 0.556, 0,-0.375, 0.155, 0.087,
-0.831, 0.556, 0,-0.287, 0.287, 0.087,
-0.831, 0.556, 0,-0.287, 0.287, -0.087,
-0.831, 0.556, 0,-0.375, 0.155, -0.087,
-0.981, -0.195, 0,-0.375, -0.155, 0.087,
-0.981, -0.195, 0,-0.406, 0, 0.087,
-0.981, -0.195, 0,-0.406, 0, -0.087,
-0.981, -0.195, 0,-0.375, -0.155, -0.087,
-0.556, -0.831, 0,-0.155, -0.375, 0.087,
-0.556, -0.831, 0,-0.287, -0.287, 0.087,
-0.556, -0.831, 0,-0.287, -0.287, -0.087,
-0.556, -0.831, 0,-0.155, -0.375, -0.087,
0.195, -0.981, 0, 0.155, -0.375, 0.087,
0.195, -0.981, 0, 0, -0.406, 0.087,
0.195, -0.981, 0, 0, -0.406, -0.087,
0.195, -0.981, 0, 0.155, -0.375, -0.087,
0.831, -0.556, 0, 0.375, -0.155, 0.087,
0.831, -0.556, 0, 0.287, -0.287, 0.087,
0.831, -0.556, 0, 0.287, -0.287, -0.087,
0.831, -0.556, 0, 0.375, -0.155, -0.087,
-0.021, -1, 0, 0.534, -0.159, -0.056,
-0.021, -1, 0, 0.534, -0.159, 0.056,
-0.021, -1, 0, 0.375, -0.155, 0.087,
-0.021, -1, 0, 0.375, -0.155, -0.087,
0.187, -0.037, -0.982, 0.554, -0.058, -0.056,
0.187, -0.037, -0.982, 0.534, -0.159, -0.056,
0.143, -0.046, -0.989, 0.375, -0.155, -0.087,
0.149, -0.012, -0.989, 0.406, 0, -0.087,
0.363, 0.932, 0, 0.554, -0.058, 0.056,
0.363, 0.932, 0, 0.554, -0.058, -0.056,
0.363, 0.932, 0, 0.406, 0, -0.087,
0.363, 0.932, 0, 0.406, 0, 0.087,
0.981, -0.195, 0, 0.554, -0.058, 0.056,
0.981, -0.195, 0, 0.534, -0.159, 0.056,
0.981, -0.195, 0, 0.534, -0.159, -0.056,
0.981, -0.195, 0, 0.554, -0.058, -0.056,
0.187, -0.037, 0.982, 0.534, -0.159, 0.056,
0.187, -0.037, 0.982, 0.554, -0.058, 0.056,
0.149, -0.012, 0.989, 0.406, 0, 0.087,
0.143, -0.046, 0.989, 0.375, -0.155, 0.087,
-0.722, -0.692, 0, 0.266, -0.490, -0.056,
-0.722, -0.692, 0, 0.266, -0.490, 0.056,
-0.722, -0.692, 0, 0.155, -0.375, 0.087,
-0.722, -0.692, 0, 0.155, -0.375, -0.087,
0.106, -0.159, -0.982, 0.351, -0.433, -0.056,
0.106, -0.159, -0.982, 0.266, -0.490, -0.056,
0.069, -0.133, -0.989, 0.155, -0.375, -0.087,
0.097, -0.114, -0.989, 0.287, -0.287, -0.087,
0.916, 0.402, 0, 0.351, -0.433, 0.056,
0.916, 0.402, 0, 0.351, -0.433, -0.056,
0.916, 0.402, 0, 0.287, -0.287, -0.087,
0.916, 0.402, 0, 0.287, -0.287, 0.087,
0.556, -0.831, 0, 0.351, -0.433, 0.056,
0.556, -0.831, 0, 0.266, -0.490, 0.056,
0.556, -0.831, 0, 0.266, -0.490, -0.056,
0.556, -0.831, 0, 0.351, -0.433, -0.056,
0.106, -0.159, 0.982, 0.266, -0.490, 0.056,
0.106, -0.159, 0.982, 0.351, -0.433, 0.056,
0.097, -0.114, 0.989, 0.287, -0.287, 0.087,
0.069, -0.133, 0.989, 0.155, -0.375, 0.087,
-1, 0.021, 0,-0.159, -0.534, -0.056,
-1, 0.021, 0,-0.159, -0.534, 0.056,
-1, 0.021, 0,-0.155, -0.375, 0.087,
-1, 0.021, 0,-0.155, -0.375, -0.087,
-0.037, -0.187, -0.982,-0.058, -0.554, -0.056,
-0.037, -0.187, -0.982,-0.159, -0.534, -0.056,
-0.046, -0.143, -0.989,-0.155, -0.375, -0.087,
-0.012, -0.149, -0.989, 0, -0.406, -0.087,
0.932, -0.363, 0,-0.058, -0.554, 0.056,
0.932, -0.363, 0,-0.058, -0.554, -0.056,
0.932, -0.363, 0, 0, -0.406, -0.087,
0.932, -0.363, 0, 0, -0.406, 0.087,
-0.195, -0.981, 0,-0.058, -0.554, 0.056,
-0.195, -0.981, 0,-0.159, -0.534, 0.056,
-0.195, -0.981, 0,-0.159, -0.534, -0.056,
-0.195, -0.981, 0,-0.058, -0.554, -0.056,
-0.037, -0.187, 0.982,-0.159, -0.534, 0.056,
-0.037, -0.187, 0.982,-0.058, -0.554, 0.056,
-0.012, -0.149, 0.989, 0, -0.406, 0.087,
-0.046, -0.143, 0.989,-0.155, -0.375, 0.087,
-0.692, 0.722, 0,-0.490, -0.266, -0.056,
-0.692, 0.722, 0,-0.490, -0.266, 0.056,
-0.692, 0.722, 0,-0.375, -0.155, 0.087,
-0.692, 0.722, 0,-0.375, -0.155, -0.087,
-0.159, -0.106, -0.982,-0.433, -0.351, -0.056,
-0.159, -0.106, -0.982,-0.490, -0.266, -0.056,
-0.133, -0.069, -0.989,-0.375, -0.155, -0.087,
-0.114, -0.097, -0.989,-0.287, -0.287, -0.087,
0.402, -0.916, 0,-0.433, -0.351, 0.056,
0.402, -0.916, 0,-0.433, -0.351, -0.056,
0.402, -0.916, 0,-0.287, -0.287, -0.087,
0.402, -0.916, 0,-0.287, -0.287, 0.087,
-0.831, -0.556, 0,-0.433, -0.351, 0.056,
-0.831, -0.556, 0,-0.490, -0.266, 0.056,
-0.831, -0.556, 0,-0.490, -0.266, -0.056,
-0.831, -0.556, 0,-0.433, -0.351, -0.056,
-0.159, -0.106, 0.982,-0.490, -0.266, 0.056,
-0.159, -0.106, 0.982,-0.433, -0.351, 0.056,
-0.114, -0.097, 0.989,-0.287, -0.287, 0.087,
-0.133, -0.069, 0.989,-0.375, -0.155, 0.087,
0.021, 1, 0,-0.534, 0.159, -0.056,
0.021, 1, 0,-0.534, 0.159, 0.056,
0.021, 1, 0,-0.375, 0.155, 0.087,
0.021, 1, 0,-0.375, 0.155, -0.087,
-0.187, 0.037, -0.982,-0.554, 0.058, -0.056,
-0.187, 0.037, -0.982,-0.534, 0.159, -0.056,
-0.143, 0.046, -0.989,-0.375, 0.155, -0.087,
-0.149, 0.012, -0.989,-0.406, 0, -0.087,
-0.363, -0.932, 0,-0.554, 0.058, 0.056,
-0.363, -0.932, 0,-0.554, 0.058, -0.056,
-0.363, -0.932, 0,-0.406, 0, -0.087,
-0.363, -0.932, 0,-0.406, 0, 0.087,
-0.981, 0.195, 0,-0.554, 0.058, 0.056,
-0.981, 0.195, 0,-0.534, 0.159, 0.056,
-0.981, 0.195, 0,-0.534, 0.159, -0.056,
-0.981, 0.195, 0,-0.554, 0.058, -0.056,
-0.187, 0.037, 0.982,-0.534, 0.159, 0.056,
-0.187, 0.037, 0.982,-0.554, 0.058, 0.056,
-0.149, 0.012, 0.989,-0.406, 0, 0.087,
-0.143, 0.046, 0.989,-0.375, 0.155, 0.087,
0.722, 0.692, 0,-0.266, 0.490, -0.056,
0.722, 0.692, 0,-0.266, 0.490, 0.056,
0.722, 0.692, 0,-0.155, 0.375, 0.087,
0.722, 0.692, 0,-0.155, 0.375, -0.087,
-0.106, 0.159, -0.982,-0.351, 0.433, -0.056,
-0.106, 0.159, -0.982,-0.266, 0.490, -0.056,
-0.069, 0.133, -0.989,-0.155, 0.375, -0.087,
-0.097, 0.114, -0.989,-0.287, 0.287, -0.087,
-0.916, -0.402, 0,-0.351, 0.433, 0.056,
-0.916, -0.402, 0,-0.351, 0.433, -0.056,
-0.916, -0.402, 0,-0.287, 0.287, -0.087,
-0.916, -0.402, 0,-0.287, 0.287, 0.087,
-0.556, 0.831, 0,-0.351, 0.433, 0.056,
-0.556, 0.831, 0,-0.266, 0.490, 0.056,
-0.556, 0.831, 0,-0.266, 0.490, -0.056,
-0.556, 0.831, 0,-0.351, 0.433, -0.056,
-0.106, 0.159, 0.982,-0.266, 0.490, 0.056,
-0.106, 0.159, 0.982,-0.351, 0.433, 0.056,
-0.097, 0.114, 0.989,-0.287, 0.287, 0.087,
-0.069, 0.133, 0.989,-0.155, 0.375, 0.087,
1, -0.021, 0, 0.159, 0.534, -0.056,
1, -0.021, 0, 0.159, 0.534, 0.056,
1, -0.021, 0, 0.155, 0.375, 0.087,
1, -0.021, 0, 0.155, 0.375, -0.087,
0.037, 0.187, -0.982, 0.058, 0.554, -0.056,
0.037, 0.187, -0.982, 0.159, 0.534, -0.056,
0.046, 0.143, -0.989, 0.155, 0.375, -0.087,
0.012, 0.149, -0.989, 0, 0.406, -0.087,
-0.932, 0.363, 0, 0.058, 0.554, 0.056,
-0.932, 0.363, 0, 0.058, 0.554, -0.056,
-0.932, 0.363, 0, 0, 0.406, -0.087,
-0.932, 0.363, 0, 0, 0.406, 0.087,
0.195, 0.981, 0, 0.058, 0.554, 0.056,
0.195, 0.981, 0, 0.159, 0.534, 0.056,
0.195, 0.981, 0, 0.159, 0.534, -0.056,
0.195, 0.981, 0, 0.058, 0.554, -0.056,
0.037, 0.187, 0.982, 0.159, 0.534, 0.056,
0.037, 0.187, 0.982, 0.058, 0.554, 0.056,
0.012, 0.149, 0.989, 0, 0.406, 0.087,
0.046, 0.143, 0.989, 0.155, 0.375, 0.087,
0.692, -0.722, 0, 0.490, 0.266, -0.056,
0.692, -0.722, 0, 0.490, 0.266, 0.056,
0.692, -0.722, 0, 0.375, 0.155, 0.087,
0.692, -0.722, 0, 0.375, 0.155, -0.087,
0.159, 0.106, -0.982, 0.433, 0.351, -0.056,
0.159, 0.106, -0.982, 0.490, 0.266, -0.056,
0.133, 0.069, -0.989, 0.375, 0.155, -0.087,
0.114, 0.097, -0.989, 0.287, 0.287, -0.087,
-0.402, 0.916, 0, 0.433, 0.351, 0.056,
-0.402, 0.916, 0, 0.433, 0.351, -0.056,
-0.402, 0.916, 0, 0.287, 0.287, -0.087,
-0.402, 0.916, 0, 0.287, 0.287, 0.087,
0.831, 0.556, 0, 0.433, 0.351, 0.056,
0.831, 0.556, 0, 0.490, 0.266, 0.056,
0.831, 0.556, 0, 0.490, 0.266, -0.056,
0.831, 0.556, 0, 0.433, 0.351, -0.056,
0.159, 0.106, 0.982, 0.490, 0.266, 0.056,
0.159, 0.106, 0.982, 0.433, 0.351, 0.056,
0.114, 0.097, 0.989, 0.287, 0.287, 0.087,
0.133, 0.069, 0.989, 0.375, 0.155, 0.087]
module.exports = Geom

View File

@ -9,6 +9,7 @@ class Levels
constructor: () ->
@dict = {}
@list = [
"test",
# intro
# "steps",
# "start",

62
coffee/levels/test.coffee Normal file
View File

@ -0,0 +1,62 @@
# 000000000 00000000 0000000 000000000
# 000 000 000 000
# 000 0000000 0000000 000
# 000 000 000 000
# 000 00000000 0000000 000
module.exports =
name: "test"
size: [11,11,11]
player:
coordinates: [5,5,0]
exits: [
name: "exit"
active: 0
position: [0,0,0]
]
create: ->
s = world.size
{Gear,Generator,MotorCylinder,MotorGear,Face} = require '../items'
world.addObjectAtPos new Gear(Face.Z), 6, 5, 0
return
world.addObjectAtPos new Gear(Face.Z), 4, 5, 0
world.addObjectAtPos new Gear(Face.Z), 5, 6, 0
world.addObjectAtPos new Gear(Face.Z), 5, 4, 0
world.addObjectAtPos new Gear(Face.Z), 6, 6, 0
world.addObjectAtPos new Gear(Face.Z), 4, 4, 0
world.addObjectAtPos new Gear(Face.Z), 4, 6, 0
world.addObjectAtPos new Gear(Face.Z), 6, 4, 0
world.addObjectAtPos new Gear(Face.NZ), 6, 5, 4
world.addObjectAtPos new Gear(Face.NZ), 4, 5, 4
world.addObjectAtPos new Gear(Face.NZ), 5, 6, 4
world.addObjectAtPos new Gear(Face.NZ), 5, 4, 4
world.addObjectAtPos new Gear(Face.NZ), 6, 6, 4
world.addObjectAtPos new Gear(Face.NZ), 4, 4, 4
world.addObjectAtPos new Gear(Face.NZ), 4, 6, 4
world.addObjectAtPos new Gear(Face.NZ), 6, 4, 4
world.addObjectAtPos new Gear(Face.NY), 6, 3, 2
world.addObjectAtPos new Gear(Face.NY), 4, 3, 2
world.addObjectAtPos new Gear(Face.NY), 5, 3, 3
world.addObjectAtPos new Gear(Face.NY), 5, 3, 1
world.addObjectAtPos new Gear(Face.NY), 6, 3, 3
world.addObjectAtPos new Gear(Face.NY), 4, 3, 1
world.addObjectAtPos new Gear(Face.NY), 4, 3, 3
world.addObjectAtPos new Gear(Face.NY), 6, 3, 1
world.addObjectAtPos new Gear(Face.Y), 6, 7, 2
world.addObjectAtPos new Gear(Face.Y), 4, 7, 2
world.addObjectAtPos new Gear(Face.Y), 5, 7, 3
world.addObjectAtPos new Gear(Face.Y), 5, 7, 1
world.addObjectAtPos new Gear(Face.Y), 6, 7, 3
world.addObjectAtPos new Gear(Face.Y), 4, 7, 1
world.addObjectAtPos new Gear(Face.Y), 4, 7, 3
world.addObjectAtPos new Gear(Face.Y), 6, 7, 1

View File

@ -71,7 +71,6 @@ class Switch extends Item
setActive: (status) ->
if @active != status
log "switch #{@name} active:#{status}"
@active = status
if @active
@ -90,7 +89,7 @@ class Switch extends Item
if @light
@light.del()
@light = null
log 'trigger SWITCHED_EVENT'
@events[@SWITCHED_EVENT].triggerActions()
setPosition: (pos) ->
@ -101,13 +100,11 @@ class Switch extends Item
@angle += f * 360
@mesh.quaternion.copy Quaternion.rotationAroundVector @angle, Vector.unitY
@tors.quaternion.copy Quaternion.rotationAroundVector @angle/2, Vector.unitZ
# @tort.quaternion.copy Quaternion.rotationAroundVector @angle/2, Vector.unitZ
performAction: (action) ->
if action.id == Action.TOGGLE
@toggle()
log "Switch.performAction 'toggle'"
else
@animate action.getRelativeDelta()

View File

@ -4,15 +4,16 @@
# 000 000 000 000 000 000
# 0 000 000 0000000 0 00000000
log = require '/Users/kodi/s/ko/js/tools/log'
Quaternion = require './lib/quaternion'
Pushable = require './pushable'
Action = require './action'
Face = require './face'
class Valve extends Pushable
constructor: (face) ->
constructor: (@face) ->
super
@face = face
@angle = 0.0
@active = false
@clockwise = false
@ -20,17 +21,9 @@ class Valve extends Pushable
@startTimedAction @getActionWithId Action.ROTATE
updateMesh: ->
@mesh.rotation.copy Quaternion.rotationAroundVector (@clockwise and 1 or -1) * @angle, 0,0,1
# display: () ->
# KikiObject::preDisplay();
#
# KMatrix m (KikiFace::orientationForFace (face));
# m.glMultMatrix();
#
# render();
#
# KikiObject::postDisplay();
# log "Valve.updateMesh #{@angle} #{@face}"
rot = Quaternion.rotationAroundVector (@clockwise and 1 or -1) * @angle, 0,0,1
@mesh.quaternion.copy Face.orientationForFace(@face).mul rot
setPosition: (pos) ->
super pos
@ -38,6 +31,7 @@ class Valve extends Pushable
dir = @face % 3
sum = ((dir == Face.Y or dir == Face.Z) and p.x or 0) + ((dir == Face.X or dir == Face.Z) and p.y or 0) + ((dir == Face.X or dir == Face.Y) and p.z or 0)
@clockwise = sum % 2
log "Valve.setPosition sum #{sum} @clockwise #{@clockwise}", pos
performAction: (action) ->
switch action.id
@ -46,10 +40,4 @@ class Valve extends Pushable
@updateMesh()
else super action
render: ->
# colors[0].glColor();
#
# glRotatef (clockwise ? angle : -angle, 0.0, 0.0, 1.0);
# render_valve;
module.exports = Valve

View File

@ -61,7 +61,7 @@ class World extends Actor
super
@noRotations = true
@noRotations = false
@screenSize = new Size @view.clientWidth, @view.clientHeight
# log "view @screenSize:", @screenSize
@ -127,7 +127,6 @@ class World extends Actor
@initGlobal()
log "create world in view:", view
world = new World view
world.name = 'world'
global.world = world
@ -204,15 +203,10 @@ class World extends Actor
# ............................................................ exits
if @dict.exits?
log "exits", @dict.exits
exit_id = 0
for entry in @dict.exits
exit_gate = new Gate entry["active"]
exit_gate.name = entry["name"] ? "exit #{exit_id}"
# exit_action = @once "exit #{exit_id}"
# delay_action = @once (a=exit_action) -> Timer.addAction a
exitAction = new Action
func: @exitLevel
name: "exit #{exit_id}"
@ -230,10 +224,9 @@ class World extends Actor
if @dict.create?
if _.isFunction @dict.create
log "@dict.create function"
@dict.create()
else
log "@dict.create not a function!"
log "World.create [WARNING] @dict.create not a function!"
# exec @dict["create"] in globals()
# ............................................................ player
@ -369,7 +362,7 @@ class World extends Actor
@addObject object
addObjectLine: (object, sx,sy,sz, ex,ey,ez) ->
log "world.addObjectLine sx:#{sx} sy:#{sy} sz:#{sz} ex:#{ex} ey:#{ey} ez:#{ez}"
# log "world.addObjectLine sx:#{sx} sy:#{sy} sz:#{sz} ex:#{ex} ey:#{ey} ez:#{ez}"
if sx instanceof Pos or Array.isArray sx
start = sx
end = sy
@ -385,7 +378,7 @@ class World extends Actor
start = [start.x, start.y, start.z]
[sx, sy, sz] = start
log "world.addObjectLine sx:#{sx} sy:#{sy} sz:#{sz} ex:#{ex} ey:#{ey} ez:#{ez}"
# log "world.addObjectLine sx:#{sx} sy:#{sy} sz:#{sz} ex:#{ex} ey:#{ey} ez:#{ez}"
diff = [ex-sx, ey-sy, ez-sz]
maxdiff = _.max diff.map Math.abs
@ -393,7 +386,7 @@ class World extends Actor
for i in [0...maxdiff]
# pos = apply(Pos, (map (lambda a, b: int(a+i*b), start, deltas)))
pos = new Pos (start[j]+i*deltas[j] for j in [0..2])
log "addObjectLine #{i}:", pos
# log "addObjectLine #{i}:", pos
if @isUnoccupiedPos pos
@addObjectAtPos object, pos
@ -530,7 +523,7 @@ class World extends Actor
object.del()
deleteAllObjects: () ->
log 'world.deleteAllObjects'
# log 'world.deleteAllObjects'
Timer.removeAllActions()