misc
This commit is contained in:
parent
8ec96ec4f0
commit
a2cd885c7f
|
@ -5,7 +5,6 @@
|
|||
# 000 000 000 000
|
||||
# 000 0000000 0000000
|
||||
|
||||
log = require '/Users/kodi/s/ko/js/tools/log'
|
||||
Vector = require './vector'
|
||||
|
||||
class Pos
|
||||
|
|
|
@ -34,7 +34,7 @@ class Pushable extends Item
|
|||
pushAction = @getActionWithId Action.PUSH
|
||||
@pusher = object
|
||||
@move_action = pushAction
|
||||
@direction = dir
|
||||
@direction = new Vector dir
|
||||
pushAction.duration = world.unmapMsTime duration
|
||||
Timer.addAction pushAction
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class Wall extends Item
|
|||
|
||||
geom = Cage.wallTiles new Pos(1,1,1), 'outside', Cage.gap
|
||||
geom.translate -0.5, -0.5, -0.5
|
||||
@plates = new THREE.Mesh geom, Material.plate
|
||||
@plates = new THREE.Mesh geom, Material.plate.clone()
|
||||
@plates.receiveShadow = true
|
||||
|
||||
@mesh = new THREE.Object3D
|
||||
|
|
|
@ -37,6 +37,7 @@ Pos = require './lib/pos'
|
|||
_ = require 'lodash'
|
||||
now = require 'performance-now'
|
||||
{
|
||||
Wall,
|
||||
Wire,
|
||||
Gear,
|
||||
Stone,
|
||||
|
@ -685,12 +686,21 @@ class World extends Actor
|
|||
for o in @objects
|
||||
if o instanceof Stone
|
||||
stones.push o
|
||||
stones.sort (a,b) => b.getPos().minus(@player.camera.getPosition()).length() - a.getPos().minus(@player.camera.getPosition()).length()
|
||||
stones.sort (a,b) => b.position.minus(@player.camera.getPosition()).length() - a.position.minus(@player.camera.getPosition()).length()
|
||||
|
||||
order = 100
|
||||
for stone in stones
|
||||
stone.mesh.renderOrder = order
|
||||
order += 1
|
||||
|
||||
d = stone.position.minus(@player.camera.getPosition()).length()
|
||||
if d < 1.0
|
||||
console.log 'd', d
|
||||
stone.mesh.material.orig_opacity = stone.mesh.material.opacity if not stone.mesh.material.orig_opacity?
|
||||
stone.mesh.material.opacity = 0.2 + d * 0.5
|
||||
else if stone.mesh.material.orig_opacity?
|
||||
stone.mesh.material.opacity = stone.mesh.material.orig_opacity
|
||||
delete stone.mesh.material.orig_opacity
|
||||
|
||||
@sun.position.copy camera.position
|
||||
@renderer.autoClearColor = false
|
||||
|
|
Loading…
Reference in New Issue
Block a user