Skip to content

Commit

Permalink
Merge pull request #547 from engaging-computing/dev
Browse files Browse the repository at this point in the history
Grid Hotfix
  • Loading branch information
kdvalin authored Mar 1, 2022
2 parents 728a4b3 + 4046be6 commit 04132a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/structural/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class View extends Component {
if (this.props.sceneConfig.settings.showCoordHelper) {
return (
<Fragment>
<a-grid height="53.33" width="53.33" position="-0.5 -0.26 -0.5" scale="1.5 1.5 1.5" material="shader:flat;"/>
<a-grid height="53.33" width="53.33" position="-0.5 -0.26 -0.5" scale="1.5 1.5 1.5" material="shader:flat;" gridmaterial/>
<a-tube path="-35 -0.2 0, 35 -0.2 0" radius="0.05" material="color: red; shader:flat;"></a-tube>
<a-tube path="0 -0.2 -35, 0 -0.2 35" radius="0.05" material="color: blue; shader:flat;"></a-tube>
<a-tube path="0 -35 0, 0 35 0" radius="0.05" material="color: green; shader:flat;"></a-tube>
Expand Down
19 changes: 18 additions & 1 deletion src/utils/AFramePhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ AFRAME.registerComponent("force-pushable", {
/**
* @summary This sets the side where the shadow should be cast on entity
*/
AFRAME.registerComponent("gridmaterial",{
schema:{
default:""
},
init: function(){
const texture = new THREE.TextureLoader().load("/img/grid_alpha_0.png");
texture.repeat = new THREE.Vector2(75,75);
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;

this.el.getObject3D("mesh").material = new THREE.MeshBasicMaterial({
map: texture,
transparent: true
});
}
});

//This sets the side where the shadow should be rendered
AFRAME.registerComponent("shadowcustomsetting", {
schema:{
default:""
Expand All @@ -56,7 +74,6 @@ AFRAME.registerComponent("shadowcustomsetting", {
},
});


/**
* @summary Calculate and sets the rotation of the entity based on 2 points
* This is use for the light indicator that has the property of lighttarget (directional and spot light)
Expand Down

0 comments on commit 04132a6

Please sign in to comment.