stone
This commit is contained in:
parent
30f8389a2c
commit
4f82dec18e
|
@ -30,39 +30,44 @@ class Bot extends Pushable
|
||||||
geom = new THREE.SphereGeometry 0.5, 32, 32, 16, Math.PI
|
geom = new THREE.SphereGeometry 0.5, 32, 32, 16, Math.PI
|
||||||
geom = new THREE.SphereGeometry 0.5, 32, 32, 0, 2*Math.PI, 0, 2.2
|
geom = new THREE.SphereGeometry 0.5, 32, 32, 0, 2*Math.PI, 0, 2.2
|
||||||
|
|
||||||
noseMat = new THREE.Matrix4()
|
nmatr = new THREE.Matrix4()
|
||||||
trans = new THREE.Vector3 0,-0.543,0
|
trans = new THREE.Vector3 0,-0.543,0
|
||||||
rot = new THREE.Quaternion().setFromEuler new THREE.Euler Vector.DEG2RAD(180), 0, 0
|
rot = new THREE.Quaternion().setFromEuler new THREE.Euler Vector.DEG2RAD(180), 0, 0
|
||||||
|
|
||||||
noseMat.compose trans, rot, new THREE.Vector3 1,1,1
|
nmatr.compose trans, rot, new THREE.Vector3 1,1,1
|
||||||
geom.merge nose, noseMat
|
geom.merge nose, nmatr
|
||||||
geom.rotateX Vector.DEG2RAD -90
|
geom.rotateX Vector.DEG2RAD -90
|
||||||
geom.scale 0.7, 0.7, 0.7
|
geom.scale 0.7, 0.7, 0.7
|
||||||
|
|
||||||
botMat = new THREE.MeshPhongMaterial
|
@botMat = new THREE.MeshPhongMaterial
|
||||||
color: 0x2222ff
|
color: 0x2222ff
|
||||||
side: THREE.FrontSide
|
side: THREE.FrontSide
|
||||||
shading: THREE.SmoothShading
|
shading: THREE.SmoothShading
|
||||||
|
transparent: true
|
||||||
|
opacity: 1
|
||||||
shininess: 5
|
shininess: 5
|
||||||
|
|
||||||
@mesh = new THREE.Mesh geom, botMat
|
@mesh = new THREE.Mesh geom, @botMat
|
||||||
|
|
||||||
geom = new THREE.TorusGeometry 0.5-tireRadius, tireRadius, 16, 32
|
geom = new THREE.TorusGeometry 0.5-tireRadius, tireRadius, 16, 32
|
||||||
geom.scale 1,1,2.5
|
geom.scale 1,1,2.5
|
||||||
|
|
||||||
tireMat = new THREE.MeshPhongMaterial
|
@tireMat = new THREE.MeshPhongMaterial
|
||||||
color: 0x000066
|
color: 0x000066
|
||||||
specular: 0x222255
|
specular: 0x222255
|
||||||
side: THREE.FrontSide
|
side: THREE.FrontSide
|
||||||
shading: THREE.FlatShading
|
shading: THREE.FlatShading
|
||||||
|
transparent: true
|
||||||
|
opacity: 1
|
||||||
shininess: 4
|
shininess: 4
|
||||||
|
alphaTest: 0.1
|
||||||
|
|
||||||
@leftTire = new THREE.Mesh geom, tireMat
|
@leftTire = new THREE.Mesh geom, @tireMat
|
||||||
@leftTire.position.set 0.35,0,0
|
@leftTire.position.set 0.35,0,0
|
||||||
@leftTire.rotation.set 0, Vector.DEG2RAD(90), 0
|
@leftTire.rotation.set 0, Vector.DEG2RAD(90), 0
|
||||||
@mesh.add @leftTire
|
@mesh.add @leftTire
|
||||||
|
|
||||||
@rightTire = new THREE.Mesh geom, tireMat
|
@rightTire = new THREE.Mesh geom, @tireMat
|
||||||
@rightTire.position.set -0.35,0,0
|
@rightTire.position.set -0.35,0,0
|
||||||
@rightTire.rotation.set 0, Vector.DEG2RAD(-90), 0
|
@rightTire.rotation.set 0, Vector.DEG2RAD(-90), 0
|
||||||
@mesh.add @rightTire
|
@mesh.add @rightTire
|
||||||
|
@ -108,6 +113,10 @@ class Bot extends Pushable
|
||||||
|
|
||||||
@startTimedAction @getActionWithId(Action.NOOP), 500
|
@startTimedAction @getActionWithId(Action.NOOP), 500
|
||||||
|
|
||||||
|
setOpacity: (opacity) ->
|
||||||
|
@botMat.opacity = opacity
|
||||||
|
@tireMat.opacity = opacity
|
||||||
|
|
||||||
# 0000000 000 00000000 00000000 0000000 000000000 000 0000000 000 000
|
# 0000000 000 00000000 00000000 0000000 000000000 000 0000000 000 000
|
||||||
# 000 000 000 000 000 000 000 000 000 000 000 0000 000
|
# 000 000 000 000 000 000 000 000 000 000 000 0000 000
|
||||||
# 000 000 000 0000000 0000000 000 000 000 000 000 000 0 000
|
# 000 000 000 0000000 0000000 000 000 000 000 000 000 0 000
|
||||||
|
|
|
@ -11,15 +11,16 @@ class Stone extends Pushable
|
||||||
constructor: (@slippery=false) ->
|
constructor: (@slippery=false) ->
|
||||||
|
|
||||||
@geom = new THREE.BoxGeometry 0.98,0.98,0.98
|
@geom = new THREE.BoxGeometry 0.98,0.98,0.98
|
||||||
# @geom.translate 0.01, 0.01, 0.01
|
|
||||||
|
|
||||||
@mat = new THREE.MeshPhongMaterial
|
@mat = new THREE.MeshPhongMaterial
|
||||||
color: 0xff8800
|
color: 0xff8800
|
||||||
side: THREE.DoubleSide
|
side: THREE.DoubleSide
|
||||||
shading: THREE.FlatShading
|
shading: THREE.SmoothShading
|
||||||
transparent: true
|
transparent: true
|
||||||
opacity: 0.8
|
opacity: 0.8
|
||||||
shininess: 15
|
shininess: 20
|
||||||
|
# alphaTest: 0.05
|
||||||
|
depthWrite: false
|
||||||
|
|
||||||
@mesh = new THREE.Mesh @geom, @mat
|
@mesh = new THREE.Mesh @geom, @mat
|
||||||
super
|
super
|
||||||
|
|
|
@ -63,8 +63,9 @@ class World extends Actor
|
||||||
|
|
||||||
@renderer = new THREE.WebGLRenderer
|
@renderer = new THREE.WebGLRenderer
|
||||||
antialias: true
|
antialias: true
|
||||||
logarithmicDepthBuffer: true
|
logarithmicDepthBuffer: false
|
||||||
autoClear: true
|
autoClear: true
|
||||||
|
sortObjects: true
|
||||||
|
|
||||||
@renderer.setClearColor 0x000000
|
@renderer.setClearColor 0x000000
|
||||||
@renderer.setSize @view.offsetWidth, @view.offsetHeight
|
@renderer.setSize @view.offsetWidth, @view.offsetHeight
|
||||||
|
@ -680,6 +681,7 @@ class World extends Actor
|
||||||
when World.CAMERA_INSIDE then @projection = @player.getInsideProjection()
|
when World.CAMERA_INSIDE then @projection = @player.getInsideProjection()
|
||||||
when World.CAMERA_BEHIND then @projection = @player.getBehindProjection()
|
when World.CAMERA_BEHIND then @projection = @player.getBehindProjection()
|
||||||
when World.CAMERA_FOLLOW then @projection = @player.getFollowProjection()
|
when World.CAMERA_FOLLOW then @projection = @player.getFollowProjection()
|
||||||
|
@player.setOpacity clamp 0, 1, @projection.getPosition().minus(@player.current_position).length()-0.4
|
||||||
@projection.apply @camera
|
@projection.apply @camera
|
||||||
@sun.position.copy @camera.position
|
@sun.position.copy @camera.position
|
||||||
@renderer.render @scene, @camera
|
@renderer.render @scene, @camera
|
||||||
|
|
Loading…
Reference in New Issue
Block a user