Skip to content

Commit

Permalink
Merge pull request #546 from Jlu18/dev
Browse files Browse the repository at this point in the history
Fixed missing texture due to merge-conflict
  • Loading branch information
kdvalin authored Mar 1, 2022
2 parents a20a7b6 + cd8787b commit 4046be6
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 4046be6

Please sign in to comment.