Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Former-commit-id: ec0c4bc
  • Loading branch information
sasha240100 committed Jun 30, 2017
1 parent f9e7970 commit a956611
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/data/Welcome.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

```bash
# Install npm version
$ npm install whs --save-dev
$ npm install whs
```

It implements a core with component system and plugin support for fast development of 3D scene with physics.
Expand Down
10 changes: 10 additions & 0 deletions docs/template/tmpl/layout.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ const links = document.querySelectorAll('.sidebar a[href]');
[].slice.call(links).forEach(link => {
link.classList.add('scroll');
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-83696871-1', 'auto');
ga('send', 'pageview');

</script>
</body>
</html>
24 changes: 0 additions & 24 deletions src/components/__tests__/line.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,4 @@ describe('Line', () => {
expect(line.geometry.vertices[0]).toEqual({x: 0, y: 0, z: 0});
expect(line.geometry.vertices[1]).toEqual({x: 10, y: 0, z: 0});
});

test('constructs with vertices according to start/end', () => {
const startVect = {x: 10, y: 1, z: 15};
const endVect = {x: 15, y: 10, z: 25};

const line = new WHS.Line({
geometry: {
start: new Vector3(startVect.x, startVect.y, startVect.z),
end: new Vector3(endVect.x, endVect.y, endVect.z)
}
});

expect(line.geometry.vertices[0]).toEqual({
x: startVect.x,
y: startVect.y,
z: startVect.z
});

expect(line.geometry.vertices[1]).toEqual({
x: endVect.x,
y: endVect.y,
z: endVect.z});
});

});
8 changes: 5 additions & 3 deletions src/components/meshes/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import {
Line as LineNative,
BufferGeometry,
Geometry,
BufferAttribute
BufferAttribute,
LineCurve3,
Vector3
} from 'three';

import {MeshComponent} from '../../core/MeshComponent';
Expand Down Expand Up @@ -33,7 +35,7 @@ class Line extends MeshComponent {
* @default <pre>
* {
* geometry: {
* curve: false,
* curve: new THREE.LineCurve3(new THREE.Vector3(10, 10, 0), new THREE.Vector3(10, 30, 0)),
* points: 50
* }
* }
Expand All @@ -42,7 +44,7 @@ class Line extends MeshComponent {
static defaults = {
...MeshComponent.defaults,
geometry: {
curve: false,
curve: new LineCurve3(new Vector3(10, 10, 0), new Vector3(10, 30, 0)),
points: 50
}
};
Expand Down

0 comments on commit a956611

Please sign in to comment.