Skip to content

Commit

Permalink
add candycane texture to the launcher rod
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmarinacci committed Nov 27, 2018
1 parent bb87a92 commit 689d40c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions physics/FireBallAction.js
@@ -1,3 +1,5 @@
const toRad = (deg) => deg * Math.PI/180

export default class FireBallAction {
constructor(scene, controller, game) {
this.clock = new THREE.Clock()
Expand Down Expand Up @@ -54,10 +56,21 @@ export default class FireBallAction {
}

initLauncher() {
const geo = new THREE.BoxGeometry(0.1,0.1,1.0)
const geo = new THREE.CylinderGeometry(0.05,0.05,1.0,16)
geo.rotateX(toRad(90))
const tex = this.game.texture_loader.load('./textures/candycane.png')
tex.wrapS = THREE.RepeatWrapping
tex.wrapT = THREE.RepeatWrapping
tex.repeat.set(1,10)

const launcher = new THREE.Mesh(
geo,
new THREE.MeshLambertMaterial({color:'green'})
new THREE.MeshStandardMaterial({
color:'white',
metalness:0.3,
roughness:0.3,
map:tex
})
)
launcher.position.z = -0.5
this.resetBall()
Expand Down
Binary file added physics/textures/candycane.acorn
Binary file not shown.
Binary file added physics/textures/candycane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 689d40c

Please sign in to comment.