Skip to content

Instantly share code, notes, and snippets.

@yoavlt
Created July 1, 2013 18:16
Show Gist options
  • Save yoavlt/5903227 to your computer and use it in GitHub Desktop.
Save yoavlt/5903227 to your computer and use it in GitHub Desktop.
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