This file contains hidden or 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
| function createJointObjects(){ | |
| let pos1 = {x: -1, y: 15, z: 0}; | |
| let pos2 = {x: -1, y: 10, z: 0}; | |
| let radius = 2; | |
| let scale = {x: 5, y: 2, z: 2}; | |
| let quat = {x: 0, y: 0, z: 0, w: 1}; | |
| let mass1 = 0; | |
| let mass2 = 1; |
This file contains hidden or 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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> | |
| <script src="js/three.js"></script> |
This file contains hidden or 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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Move JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> |
This file contains hidden or 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
| function setupEventHandlers(){ | |
| window.addEventListener( 'keydown', handleKeyDown, false); | |
| window.addEventListener( 'keyup', handleKeyUp, false); | |
| } | |
| function handleKeyDown(event){ |
This file contains hidden or 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
| function moveBall(){ | |
| let scalingFactor = 20; | |
| let moveX = moveDirection.right - moveDirection.left; | |
| let moveZ = moveDirection.back - moveDirection.forward; | |
| let moveY = 0; | |
| if( moveX == 0 && moveY == 0 && moveZ == 0) return; |
This file contains hidden or 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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Move JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> |
This file contains hidden or 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
| function createKinematicBox(){ | |
| let pos = {x: 40, y: 6, z: 5}; | |
| let scale = {x: 10, y: 10, z: 10}; | |
| let quat = {x: 0, y: 0, z: 0, w: 1}; | |
| let mass = 0; | |
| //threeJS Section | |
| kObject = new THREE.Mesh(new THREE.BoxBufferGeometry(), new THREE.MeshPhongMaterial({color: 0x30ab78})); |
This file contains hidden or 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
| function moveKinematic(){ | |
| let scalingFactor = 0.3; | |
| let moveX = kMoveDirection.right - kMoveDirection.left; | |
| let moveZ = kMoveDirection.back - kMoveDirection.forward; | |
| let moveY = 0; | |
This file contains hidden or 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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Move JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> |
This file contains hidden or 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
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Move JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> |