Created
July 1, 2013 18:16
-
-
Save yoavlt/5903227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define -> | |
class Ground | |
constructor: (shape) -> | |
geometry = new THREE.CubeGeometry(shape.x, shape.y, shape.z) | |
material = Physijs.createMaterial( | |
new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture('images/rocks.jpg') }), | |
8, # high friction | |
4 # low restitution | |
) | |
material.map.wrapS = material.map.wrapT = THREE.RepeatWrapping | |
material.map.repeat.set(3, 3) | |
@body = new Physijs.BoxMesh( | |
geometry, | |
material, | |
0 # mass (static) | |
) | |
@body.receiveShadow = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment